querying.py (pymol-v2.1.0.tar.bz2) | : | querying.py (pymol-open-source-2.2.0) | ||
---|---|---|---|---|
skipping to change at line 242 | skipping to change at line 242 | |||
if not quiet: | if not quiet: | |||
if r!=None: | if r!=None: | |||
print(" get_title: %s"%r) | print(" get_title: %s"%r) | |||
finally: | finally: | |||
_self.unlock(r,_self) | _self.unlock(r,_self) | |||
if _raising(r,_self): raise pymol.CmdException | if _raising(r,_self): raise pymol.CmdException | |||
return r | return r | |||
def angle(name=None, selection1="(pk1)", selection2="(pk2)", | def angle(name=None, selection1="(pk1)", selection2="(pk2)", | |||
selection3="(pk3)", mode=None, label=1, reset=0, | selection3="(pk3)", mode=None, label=1, reset=0, | |||
zoom=0, state=0, quiet=1, _self=cmd): | zoom=0, state=0, quiet=1, _self=cmd, | |||
state1=-3, state2=-3, state3=-3): | ||||
''' | ''' | |||
DESCRIPTION | DESCRIPTION | |||
"angle" shows the angle formed between any three atoms. | "angle" shows the angle formed between any three atoms. | |||
USAGE | USAGE | |||
angle [ name [, selection1 [, selection2 [, selection3 ]]]] | angle [ name [, selection1 [, selection2 [, selection3 ]]]] | |||
skipping to change at line 319 | skipping to change at line 320 | |||
try: | try: | |||
_self.lock(_self) | _self.lock(_self) | |||
if selection2!="same": | if selection2!="same": | |||
selection2 = "("+selection2+")" | selection2 = "("+selection2+")" | |||
if selection3!="same": | if selection3!="same": | |||
selection3 = "("+selection3+")" | selection3 = "("+selection3+")" | |||
r = _cmd.angle(_self._COb,str(nam),"("+str(selection1)+")", | r = _cmd.angle(_self._COb,str(nam),"("+str(selection1)+")", | |||
str(selection2), | str(selection2), | |||
str(selection3), | str(selection3), | |||
int(mode),int(label),int(reset), | int(mode),int(label),int(reset), | |||
int(zoom),int(quiet),int(state)-1) | int(zoom),int(quiet),int(state)-1, | |||
int(state1)-1, int(state2)-1, int(state3)-1) | ||||
finally: | finally: | |||
_self.unlock(r,_self) | _self.unlock(r,_self) | |||
if _raising(r,_self): raise pymol.CmdException | if _raising(r,_self): raise pymol.CmdException | |||
return r | return r | |||
def dihedral(name=None, selection1="(pk1)", selection2="(pk2)", | def dihedral(name=None, selection1="(pk1)", selection2="(pk2)", | |||
selection3="(pk3)", selection4="(pk4)", mode=None, | selection3="(pk3)", selection4="(pk4)", mode=None, | |||
label=1, reset=0, zoom=0, state=0, quiet=1, _self=cmd): | label=1, reset=0, zoom=0, state=0, quiet=1, _self=cmd): | |||
''' | ''' | |||
DESCRIPTION | DESCRIPTION | |||
skipping to change at line 419 | skipping to change at line 421 | |||
int(mode),int(label), | int(mode),int(label), | |||
int(reset),int(zoom), | int(reset),int(zoom), | |||
int(quiet),int(state)-1) | int(quiet),int(state)-1) | |||
finally: | finally: | |||
_self.unlock(r,_self) | _self.unlock(r,_self) | |||
if _raising(r,_self): raise pymol.CmdException | if _raising(r,_self): raise pymol.CmdException | |||
return r | return r | |||
def distance(name=None, selection1="(pk1)", selection2="(pk2)", | def distance(name=None, selection1="(pk1)", selection2="(pk2)", | |||
cutoff=None, mode=None, zoom=0, width=None, length=None, | cutoff=None, mode=None, zoom=0, width=None, length=None, | |||
gap=None, label=1, quiet=1, reset=0, state=0, _self=cmd): | gap=None, label=1, quiet=1, reset=0, state=0, | |||
state1=-3, state2=-3, _self=cmd): | ||||
''' | ''' | |||
DESCRIPTION | DESCRIPTION | |||
"distance" creates a new distance object between two selections. | "distance" creates a new distance object between two selections. | |||
USAGE | USAGE | |||
distance [name [, selection1 [, selection2 [, cutoff [, mode ]]]]] | distance [name [, selection1 [, selection2 [, cutoff [, mode ]]]]] | |||
skipping to change at line 451 | skipping to change at line 454 | |||
mode = 1: only bond distances | mode = 1: only bond distances | |||
mode = 2: only show polar contact distances | mode = 2: only show polar contact distances | |||
mode = 3: like mode=0, but use distance_exclusion setting | mode = 3: like mode=0, but use distance_exclusion setting | |||
mode = 4: distance between centroids (does not support | mode = 4: distance between centroids (does not support | |||
dynamic_measures; new in PyMOL 1.8.2) | dynamic_measures; new in PyMOL 1.8.2) | |||
state = int: object state to create the measurement object in | ||||
and to get coordinates from {default: 0 (all states)} | ||||
state1, state2 = int: overrule 'state' argument to measure distances | ||||
between different states {default: use state} | ||||
EXAMPLES | EXAMPLES | |||
distance mydist, 14/CA, 29/CA | distance mydist, 14/CA, 29/CA | |||
distance hbonds, all, all, 3.2, mode=2 | distance hbonds, all, all, 3.2, mode=2 | |||
NOTES | NOTES | |||
The distance wizard makes measuring distances easier than using | The distance wizard makes measuring distances easier than using | |||
the "dist" command for real-time operations. | the "dist" command for real-time operations. | |||
skipping to change at line 527 | skipping to change at line 536 | |||
selection1 = selector.process(selection1) | selection1 = selector.process(selection1) | |||
selection2 = selector.process(selection2) | selection2 = selector.process(selection2) | |||
# now do the deed | # now do the deed | |||
try: | try: | |||
_self.lock(_self) | _self.lock(_self) | |||
if selection2!="same": | if selection2!="same": | |||
selection2 = "("+selection2+")" | selection2 = "("+selection2+")" | |||
r = _cmd.dist(_self._COb,str(nam),"("+str(selection1)+")", | r = _cmd.dist(_self._COb,str(nam),"("+str(selection1)+")", | |||
str(selection2),int(mode),float(cutoff), | str(selection2),int(mode),float(cutoff), | |||
int(label),int(quiet),int(reset), | int(label),int(quiet),int(reset), | |||
int(state)-1,int(zoom)) | int(state)-1,int(zoom), | |||
int(state1)-1, int(state2)-1) | ||||
if width!=None: | if width!=None: | |||
_self.set("dash_width",width,nam) | _self.set("dash_width",width,nam) | |||
if length!=None: | if length!=None: | |||
_self.set("dash_length",length,nam) | _self.set("dash_length",length,nam) | |||
if gap!=None: | if gap!=None: | |||
_self.set("dash_gap",gap,nam) | _self.set("dash_gap",gap,nam) | |||
finally: | finally: | |||
_self.unlock(r,_self) | _self.unlock(r,_self) | |||
if (r<0.0) and (not quiet): | if (r<0.0) and (not quiet): | |||
# a negative value is an warning signal from PyMOL... | # a negative value is an warning signal from PyMOL... | |||
skipping to change at line 1644 | skipping to change at line 1654 | |||
def get_object_state(name, _self=cmd): | def get_object_state(name, _self=cmd): | |||
''' | ''' | |||
DESCRIPTION | DESCRIPTION | |||
Returns the effective object state. | Returns the effective object state. | |||
''' | ''' | |||
states = _self.count_states('%' + name) | states = _self.count_states('%' + name) | |||
if states < 2 and _self.get_setting_boolean('static_singletons'): | if states < 2 and _self.get_setting_boolean('static_singletons'): | |||
return 1 | return 1 | |||
if _self.get_setting_int('all_states', name): | ||||
return 0 | ||||
state = _self.get_setting_int('state', name) | state = _self.get_setting_int('state', name) | |||
if state > states: | if state > states: | |||
raise pymol.CmdException('Invalid state %d for object %s' % (state, name)) | raise pymol.CmdException('Invalid state %d for object %s' % (state, name)) | |||
return state | return state | |||
def get_selection_state(selection, _self=cmd): | def get_selection_state(selection, _self=cmd): | |||
''' | ''' | |||
DESCRIPTION | DESCRIPTION | |||
Returns the effective object state for all objects in given selection. | Returns the effective object state for all objects in given selection. | |||
skipping to change at line 1690 | skipping to change at line 1702 | |||
(assume it was loaded from a file without occupancy information). | (assume it was loaded from a file without occupancy information). | |||
SEE ALSO | SEE ALSO | |||
get_extent | get_extent | |||
''' | ''' | |||
from chempy import cpv | from chempy import cpv | |||
state, quiet = int(state), int(quiet) | state, quiet = int(state), int(quiet) | |||
if state < 0: | if state < 0: | |||
states = [get_selection_state(selection)] | state = _self.get_selection_state(selection) | |||
elif state == 0: | if state == 0: | |||
states = list(range(1, _self.count_states(selection)+1)) | states = list(range(1, _self.count_states(selection)+1)) | |||
else: | else: | |||
states = [state] | states = [state] | |||
com = cpv.get_null() | com = cpv.get_null() | |||
totmass = 0.0 | totmass = 0.0 | |||
for state in states: | for state in states: | |||
model = _self.get_model(selection, state) | model = _self.get_model(selection, state) | |||
for a in model.atom: | for a in model.atom: | |||
End of changes. 7 change blocks. | ||||
6 lines changed or deleted | 18 lines changed or added |