This is a read-only mirror of pymolwiki.org

Difference between revisions of "Pse export version"

From PyMOL Wiki
Jump to navigation Jump to search
m (1 revision)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Find polar pairs with the [[find_pairs|cmd.find_pairs]] function and return them as a list of atom pairs. It finds (more or less) the same contacts like [[distance|cmd.distance(mode=2)]].
+
The [[pse_export_version]] setting switches to a legacy format when saving PSEs, so far possible. The value is the floating point number representation of the targeted legacy PyMOL version, for example '''1.74''' to save a session for PyMOL 1.7.4.
  
== Example ==
+
''New in PyMOL 1.7.6''
  
<source lang="python">
+
Session file loading is always backwards compatible, so any newer version of PyMOL can load old session files.
pairs = polarpairs('chain A', 'chain B')
 
for p in pairs:
 
    dist = cmd.get_distance('(%s`%s)' % p[0], '(%s`%s)' % p[1])
 
    print p, 'Distance: %.2f' % (dist)
 
</source>
 
  
== The Script ==
+
== Examples ==
  
<source lang="python">
+
<syntaxhighlight lang="python">
'''
+
# current version (default)
(c) 2011 Thomas Holder, MPI for Developmental Biology
+
set pse_export_version, 0
'''
+
save current.pse
  
from pymol import cmd
+
# compatible with PyMOL 1.7.4
 +
set pse_export_version, 1.74
 +
save 174compat.pse
 +
</syntaxhighlight>
  
def polarpairs(sel1, sel2, cutoff=4.0, angle=63.0, name='', state=1, quiet=1):
+
== Known Limitations ==
    '''
 
ARGUMENTS
 
  
    sel1, sel2 = string: atom selections
+
The following objects are not or only partly supported:
  
    cutoff = float: distance cutoff
+
* scenes before 1.7.6 (support added in 1.8.4)
 +
* volumes before 1.7.2
 +
* ramps
 +
* CGOs
  
    angle = float: h-bond angle cutoff in degrees. If angle="default", take
+
== See Also ==
    "h_bond_max_angle" setting. If angle=0, do not detect h-bonding.
 
  
    name = string: If given, also create a distance object for visual representation
+
* [[save]]
  
SEE ALSO
+
[[Category:Settings]]
 
 
    cmd.find_pairs, cmd.distance
 
    '''
 
    cutoff = float(cutoff)
 
    quiet = int(quiet)
 
    state = int(state)
 
    if angle == 'default':
 
        angle = cmd.get('h_bond_max_angle', cmd.get_object_list(sel1)[0])
 
    angle = float(angle)
 
    mode = 1 if angle > 0 else 0
 
    x = cmd.find_pairs('(%s) and donors' % sel1, '(%s) and acceptors' % sel2,
 
            state, state,
 
            cutoff=cutoff, mode=mode, angle=angle) + \
 
        cmd.find_pairs('(%s) and acceptors' % sel1, '(%s) and donors' % sel2,
 
            state, state,
 
            cutoff=cutoff, mode=mode, angle=angle)
 
    x = sorted(set(x))
 
    if not quiet:
 
        print 'Settings: cutoff=%.1fangstrom angle=%.1fdegree' % (cutoff, angle)
 
        print 'Found %d polar contacts' % (len(x))
 
    if len(name) > 0:
 
        for p in x:
 
            cmd.distance(name, '(%s`%s)' % p[0], '(%s`%s)' % p[1])
 
    return x
 
 
 
cmd.extend('polarpairs', polarpairs)
 
</source>
 
 
 
[[Category:Plugins]]
 
[[Category:Biochemical_Scripts]]
 

Latest revision as of 00:07, 17 October 2016

The pse_export_version setting switches to a legacy format when saving PSEs, so far possible. The value is the floating point number representation of the targeted legacy PyMOL version, for example 1.74 to save a session for PyMOL 1.7.4.

New in PyMOL 1.7.6

Session file loading is always backwards compatible, so any newer version of PyMOL can load old session files.

Examples

# current version (default)
set pse_export_version, 0
save current.pse

# compatible with PyMOL 1.7.4
set pse_export_version, 1.74
save 174compat.pse

Known Limitations

The following objects are not or only partly supported:

  • scenes before 1.7.6 (support added in 1.8.4)
  • volumes before 1.7.2
  • ramps
  • CGOs

See Also