Difference between revisions of "Property Selectors"

From PyMOLWiki
Jump to: navigation, search
Line 169: Line 169:
[[Category:Selector Quick Reference]]
[[Category:Selector Quick Reference]]
[[Category:Making Selections]]
[[Category:Selecting|Selector Quick Reference]]

Revision as of 17:36, 2 November 2007

Property Selectors

PyMOL reads data files written in PDB, MOL/SDF, Macromodel, ChemPy Model, and Tinker XYZ formats. Some of the data fields in these formats allow PyMOL to assign properties to atoms. You can group and select atoms according to these properties using property selectors and identifiers: the selectors correspond to the fields in the data files, and the identifiers correspond to the target words to match, or the target numbers to compare.


The items in a list of identifiers are separated by plus signs (+) only. Do not add spaces within a list of identifiers. The selector resi takes (+)-separated lists of identifiers, as in

PyMOL> select nterm, resi 1+2+3

or, alternatively, it may take a range given with a dash

PyMOL> select nterm, resi 1-3

However, you will get an error message if you try to combine a list and a range in an identifier to a resi as in

PyMOL> select mistake, resi 1-3+6      <--This is WRONG

The identifier for a blank field in an input file is and empty pair of quotes

PyMOL> select unstruct, ss ""   # A named selection is created
                                # to contain all atoms that are not assigned 
                                # a secondary structure.

Property Selector Table

Most property selectors select matches to their identifiers

Matching Property Selector Short Form Selector Identifier and Example
symbol e.

list of 1- or 2-letter chemical symbols from the periodic table

PyMOL> select polar, symbol o+n
name n.


list of up to 4-letter codes for atoms in proteins or nucleic acids

PyMOL> select carbons, name ca+cb+cg+cd
resn r.

list of 3-letter codes for amino acids

PyMOL> select aas, resn asp+glu+asn+gln 

or list of up to 2-letter codes for nucleic acids

<B>PyMOL></B> select bases, resn a+g
resi i.

list of up to 4-digit residue numbers

PyMOL> select mults10, resi 1+10+100+1000


<B>PyMOL></B> select nterm, resi 1-10
alt alt

list of single letters

PyMOL> select altconf, alt a+""
chain c.

list of single letters or sometimes numbers

PyMOL> select firstch, chain a
segi s.


list of up to 4 letter identifiers

PyMOL> select ligand, segi lig 
flag f.

a single integer from 0 to 31

PyMOL> select f1, flag 0
  numeric_type   nt.

a single integer

PyMOL> select type1, nt. 5
text_type tt.

a list of up to 4 letter codes

PyMOL> select subset, text_type HA+HC
id id

a single integer

PyMOL> select idno, id 23
index idx.


a single integer

<PyMOL> select intid, index 11
ss ss

list of single letters

PyMOL> select allstrs, ss h+s+l+""

Numeric Selector Table

Other property selectors select by comparison to numeric identifiers

Numeric Selector Short Form Argument and Example
b b

comparison-operator b-factor-value
a real number

PyMOL> select fuzzy, b > 10
q q

comparison-operator occupancy-value
a real number

PyMOL> select lowcharges, q <0.50
  formal_charge   fc.

comparison-operator formal charge-value
an integer

PyMOL> select doubles, fc. = -1
  partial_charge   pc.

comparison-operator partial charge-value

a real number

PyMOL> select hicharges, pc. > 1

User Notes

To select atoms by their PDB ATOM number, use the id selector:

select Nt, id 1-30

makes a new selection called Nt and puts in it the first 30 atoms (assuming your PDB starts numbering at 1).