Difference between revisions of "Objects and Selections"

From PyMOLWiki
Jump to navigation Jump to search
Line 48: Line 48:
Advanced selections is really where it's at, in my opinion.
[[User:Inchoate|Tree]] 13:27, 11 March 2007 (CDT)
[[User:Inchoate|Tree]] 13:27, 11 March 2007 (CDT)

Latest revision as of 14:54, 11 September 2008

Objects and Selections

Selections are enclosed in parentheses and contain predicates, logical operations, object names, selection names and nested parenthesis: ( [... [(...) ... ]] )

name <atom names>            n. <atom names>          
resn <residue names>         r. <residue names>
resi <residue identifiers>   i. <residue identifiers>
chain <chain ID>             c. <chain identifiers>
segi <segment identifiers>   s. <segment identifiers>
elem <element symbol>        e. <element symbols>
flag <number>                f. <number>
numeric_type <numeric type>  nt. <numeric type>
text_type <text type>        tt. <text type>
b <operator> <value>         
q <operator> <value>         
formal_charge <op> <value>   fc. <operator> <value>
partial_charge <op> <value>  pc. <operator> <value>
id <original-index>          
hydrogen                     h.
all                          *
visible                      v.
<selection> and <selection>  <selection> & <selection>
<selection> or <selection>   <selection> | <selection>
not <selection>              ! <selection>
byres <selection>            br. <selection>
byobj <selection>            bo. <selection>
around <distance>            a. <distance>
expand <distance>            e. <distance>
gap <distance>               
in <selection>               
like <selection>             l. <selection>
<selection> within <distance> of <selection>
<selection> w. <distance> of <selection>


Working efficiently in PyMOL --- or any molecular visualization program --- requires in-depth knowledge of selections & representations. You can select objects by more than just their residue name, number, etc; for example

# color blue, whatever is visible
color blue, visible

# show sticks, for all residues that have a b-factor of 2.0
show sticks, all and b=2.0

# show the surface representation for all residues within 
# 5 angstroms of any hetero atoms in all molecules
show surface, byres all within 5 of het

Tree 13:27, 11 March 2007 (CDT)