Objects and Selections

From PyMOLWiki
Jump to navigation Jump to search

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>
alt                    
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.
hetatm                       
<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>

USER COMMENTS

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

Advanced selections is really where it's at, in my opinion.

Tree 13:27, 11 March 2007 (CDT)