Property Selectors: Difference between revisions
m (→See Also: add link to identify command) |
(examples: ignore_case=0 compatible) |
||
Line 11: | Line 11: | ||
PyMOL> select nterm, resi 1-3 | PyMOL> select nterm, resi 1-3 | ||
</source> | </source> | ||
The identifier for a blank field in an input file is an empty pair of quotes | |||
The identifier for a blank field in an input file is | |||
<source lang="python"> | <source lang="python"> | ||
PyMOL> select unstruct, ss "" # A named selection is created | PyMOL> select unstruct, ss "" # A named selection is created | ||
Line 34: | Line 30: | ||
<BR> list of 1- or 2-letter chemical symbols from the periodic table | <BR> list of 1- or 2-letter chemical symbols from the periodic table | ||
<BR> | <BR> | ||
<pre>PyMOL> select polar, symbol | <pre>PyMOL> select polar, symbol O+N</pre> | ||
</TD></TR> | </TD></TR> | ||
<TR><TD ALIGN="CENTER">name</TD><TD ALIGN="CENTER"> n.</TD><TD><I> | <TR><TD ALIGN="CENTER">name</TD><TD ALIGN="CENTER"> n.</TD><TD><I> | ||
atom-name-list</I> | atom-name-list</I> | ||
<BR> list of up to 4-letter codes for atoms in proteins or nucleic acids | <BR> list of up to 4-letter codes for atoms in proteins or nucleic acids | ||
<BR> | <BR> | ||
<pre>PyMOL> select carbons, name | <pre>PyMOL> select carbons, name CA+CB+CG+CD</pre> | ||
</TD></TR> | </TD></TR> | ||
<TR><TD ALIGN="CENTER">resn</TD><TD ALIGN="CENTER"> r.</TD><TD><I> | <TR><TD ALIGN="CENTER">resn</TD><TD ALIGN="CENTER"> r.</TD><TD><I> | ||
residue-name-list</I> | residue-name-list</I> | ||
<BR> list of 3-letter codes for amino acids | <BR> list of 3-letter codes for amino acids | ||
<BR> | <BR> | ||
<pre>PyMOL> select aas, resn | <pre>PyMOL> select aas, resn ASP+GLU+ASN+GLN</pre> | ||
or list of up to 2-letter codes for nucleic acids | or list of up to 2-letter codes for nucleic acids | ||
<BR> | <BR> | ||
<pre>PyMOL> select bases, resn | <pre>PyMOL> select bases, resn A+G</pre> | ||
</TD></TR> | </TD></TR> | ||
<TR><TD ALIGN="CENTER">resi</TD><TD ALIGN="CENTER"> i.</TD><TD><I> | <TR><TD ALIGN="CENTER">resi</TD><TD ALIGN="CENTER"> i.</TD><TD><I> | ||
Line 67: | Line 61: | ||
alternate-conformation-identifier-list</I> | alternate-conformation-identifier-list</I> | ||
<BR> list of single letters | <BR> list of single letters | ||
<pre>PyMOL> select altconf, alt | <pre>PyMOL> select altconf, alt A+""</pre> | ||
</TD></TR> | </TD></TR> | ||
<TR><TD ALIGN="CENTER">chain</TD><TD ALIGN="CENTER"> c.</TD><TD><I> | <TR><TD ALIGN="CENTER">chain</TD><TD ALIGN="CENTER"> c.</TD><TD><I> | ||
Line 74: | Line 68: | ||
<BR> list of single letters or sometimes numbers | <BR> list of single letters or sometimes numbers | ||
<BR> | <BR> | ||
<pre>PyMOL> select firstch, chain | <pre>PyMOL> select firstch, chain A</pre> | ||
</TD></TR> | </TD></TR> | ||
<TR><TD ALIGN="CENTER"> segi</TD><TD ALIGN="CENTER"> s.</TD><TD><I> | <TR><TD ALIGN="CENTER"> segi</TD><TD ALIGN="CENTER"> s.</TD><TD><I> | ||
segment-identifier-list</I> | segment-identifier-list</I> | ||
<BR> list of up to 4 letter identifiers | <BR> list of up to 4 letter identifiers | ||
<pre>PyMOL> select ligand, segi lig </pre> | <pre>PyMOL> select ligand, segi lig </pre> | ||
Line 110: | Line 103: | ||
<TR><TD ALIGN="CENTER">index</TD><TD ALIGN="CENTER"> idx.</TD><TD><I> | <TR><TD ALIGN="CENTER">index</TD><TD ALIGN="CENTER"> idx.</TD><TD><I> | ||
internal-index-number</I> | internal-index-number</I> | ||
<BR> a single integer | <BR> a single integer | ||
<BR> | <BR> | ||
Line 118: | Line 110: | ||
secondary-structure-type</I> | secondary-structure-type</I> | ||
<BR> list of single letters | <BR> list of single letters | ||
<BR> | <BR> | ||
<pre>PyMOL> select allstrs, ss | <pre>PyMOL> select allstrs, ss H+S+L+""</pre> | ||
</TD></TR> | </TD></TR> | ||
</TABLE> | </TABLE> | ||
Line 152: | Line 143: | ||
<TR><TD ALIGN="CENTER"> partial_charge </TD><TD ALIGN="CENTER"> pc.</TD><TD> | <TR><TD ALIGN="CENTER"> partial_charge </TD><TD ALIGN="CENTER"> pc.</TD><TD> | ||
<I> comparison-operator partial charge-value</I> | <I> comparison-operator partial charge-value</I> | ||
<BR> a real number | <BR> a real number | ||
<pre>PyMOL> select hicharges, pc. > 1</pre> | <pre>PyMOL> select hicharges, pc. > 1</pre> |
Revision as of 08:39, 20 April 2016
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.
General
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
The identifier for a blank field in an input file is an 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. |
chemical-symbol-list
PyMOL> select polar, symbol O+N |
name | n. |
atom-name-list
PyMOL> select carbons, name CA+CB+CG+CD |
resn | r. |
residue-name-list
PyMOL> select aas, resn ASP+GLU+ASN+GLN or list of up to 2-letter codes for nucleic acids
PyMOL> select bases, resn A+G |
resi | i. |
residue-identifier-list
PyMOL> select mults10, resi 1+10+100+1000 residue-identifier-range
PyMOL> select nterm, resi 1-10 |
alt | alt |
alternate-conformation-identifier-list
PyMOL> select altconf, alt A+"" |
chain | c. |
chain-identifier-list
PyMOL> select firstch, chain A |
segi | s. |
segment-identifier-list
PyMOL> select ligand, segi lig |
flag | f. |
flag-number
PyMOL> select f1, flag 0 |
numeric_type | nt. |
type-number
PyMOL> select type1, nt. 5 |
text_type | tt. |
type-string
PyMOL> select subset, text_type HA+HC |
id | id |
external-index-number
PyMOL> select idno, id 23 |
index | idx. |
internal-index-number
PyMOL> select intid, index 11 |
ss | ss |
secondary-structure-type
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
PyMOL> select fuzzy, b > 10 |
q | q |
comparison-operator occupancy-value
PyMOL> select lowcharges, q <0.50 |
formal_charge | fc. |
comparison-operator formal charge-value
PyMOL> select doubles, fc. = -1 |
partial_charge | pc. |
comparison-operator partial charge-value
PyMOL> select hicharges, pc. > 1 |
User Notes
Select by PDB Assigned Atom Number
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).
Selecting via a Negative Identifier
If you have a residue id < 0, eg. resi -55, then you have to escape the minus sign or renumber the atoms:
select i. \-55
Alternate Locations
Select All Alternate Locations
- To select all residues with alternate locations (alt, alt loc), simply do:
select aa, not alt ""
Try it on 1CBN.
Select All Alternate Locations Except the A-Locations
- To select and remove all atoms with alternate locations (ALT, alt loc) that aren't the A record try the following. This removes all alt locations that are not the original A location. For example given the following pdb record,
ATOM 949 N ARG A 124 6.039 8.484 9.313 1.00 9.82 N
ATOM 950 CA ARG A 124 5.839 7.071 8.980 1.00 10.05 C
ATOM 951 C ARG A 124 6.009 6.809 7.493 1.00 9.18 C
ATOM 952 O ARG A 124 5.803 7.715 6.648 1.00 9.06 O
ATOM 953 CB ARG A 124 4.437 6.660 9.425 1.00 10.61 C
ATOM 954 CG AARG A 124 4.381 6.539 10.955 0.50 12.54 C
ATOM 955 CG BARG A 124 4.170 6.743 10.930 0.50 14.58 C
ATOM 956 CD AARG A 124 2.996 6.418 11.561 0.50 11.86 C
ATOM 957 CD BARG A 124 2.700 7.091 11.242 0.50 17.41 C
ATOM 958 NE AARG A 124 2.110 7.506 11.144 0.50 13.01 N
ATOM 959 NE BARG A 124 2.229 6.746 12.588 0.50 19.94 N
ATOM 960 CZ AARG A 124 0.912 7.729 11.654 0.50 12.21 C
ATOM 961 CZ BARG A 124 2.123 5.510 13.067 0.50 21.42 C
ATOM 962 NH1AARG A 124 0.433 6.958 12.627 0.50 12.93 N
ATOM 963 NH1BARG A 124 2.470 4.470 12.319 0.50 24.35 N
ATOM 964 NH2AARG A 124 0.185 8.735 11.188 0.50 11.89 N
ATOM 965 NH2BARG A 124 1.658 5.310 14.313 0.50 18.28 N
the command below will remove the (not A so) B-locations (lines 7, 9, 11, 13, 15, 17).
# select & remove all non A altlocs
remove not (alt ''+A)
# reset the PDB information
alter all, alt=''
See also, removeAlt for a script to do this for you.
See Also
Single-word Selectors Selection Macros Selection_Algebra Identify