5.3 Selection Methods
5.3.8 Other selections
sequence
VMD supports selection based on the one-letter amino acid sequence with the sequenceselection keyword. This allows selections of the form
sequence APD
sequence "C..C" (might be used to pick out zinc fingers) sequence AATCGGAT
Unlike the other string selection commands which take one of three types of strings, all the strings forsequenceare taken as regular expressions (though strings with non-alphanumerics must still be quoted to get past the input parser). The method works by taking each of the protein and nucleic acid fragments (pfrag and nfrag) in turn and constructing the one-letter amino acid sequence. If a regular expression matches any of the sequence, the atoms in the matching residues are selected. Multiple matches are allowed, though they cannot overlap. As is usual with regular expressions, the largest possible match is made, so take care with expressions likeC.*C.
within and same
Two useful types of selection mechanisms available in VMDare: within <number> of <selection>
andsame <keyword> as <selection>. The first selects all atoms within the specified distance (in
˚A) from a selection, including the selection itself. Therefore, the command:
within 5 of name FE
selects all atoms within 5 ˚A of atoms named FE. One common use for this command is to limit the region of atoms shown on the screen. Another is to find atoms that may be involved in interactions.
For instance:
protein within 5 of nucleic
finds the protein atoms that are nearby nucleic acids. Some selections may be sped up by short circuiting [§5.3.3].
A related atom selection construct isexwithin, short for ’exclusive within’. The atom selection (within 3 of protein) and not proteinis equivalent to exwithin 3 of protein.
The same <keyword> as <selection>finds all the atoms which have the same ‘keyword’ as the atoms in the selection. This can be used for selections like
same fragment as resid 35
which finds all the atoms attached to residue id 35. Any keyword can be used, so selections like same resname as (protein within 5 of nucleic)
are fine, although weird. The perhaps the most useful keyword for this command is residue, so you can saysame residue as ....
Finding contact residues
Suppose you want to view the atoms in “A” which are in contact with “B”. Use the within
<distance> of <selection>selection command. For purposes of demonstration, let A be protein, B be nucleic, and define contact as an atom in A which is within 2 ˚A of an atom in B. Then the selection command is
protein within 2 of nucleic
If you want to see all the residues of A which have at least one atom in contact with B, use same residue as (protein within 2 of nucleic)
Keyword Arg Description
all bool everything
none bool nothing
name str atom name
type str atom type
index num the atom number, starting at 0 serial num the atom number, starting at 1 atomicnumber num atomic number (0 if undefined)
element str atomic element symbol string (’X’ if undefined) altloc str alternate location/conformation identifier chain str the one-character chain identifier
residue num a set of connected atoms with the same residue number protein bool a residue with atoms namedC, N, CA, and O
nucleic bool a residue with atoms namedP, O1P, O2Pand either O3’, C3’, C4’, C5’, O5’orO3*, C3*, C4*, C5*, O5*.
This definition assumes that the base is phosphorylated, an assumption which will be corrected in the future.
backbone bool theC,N,CA, and Oatoms of a protein and the equivalent atoms in a nucleic acid.
sidechain bool non-backbone atoms and bonds
water, bool all atoms with the resnameH2O, HH0, OHH, HOH, waters OH2, SOL, WAT, TIP, TIP2, TIP3orTIP4 fragment num a set of connected residues
pfrag num a set of connected protein residues nfrag num a set of connected nucleic residues sequence str a sequence given by one letter names numbonds num number of bonds
resname str residue name
resid num residue id
segname str segment name
x, y, z float x, y, or z coordinates radius float atomic radius
mass float atomic mass
charge float atomic charge beta float temperature factor occupancy float occupancy
user float time-varying user-specified value at bool residues named ADA A THY T acidic bool residues named ASP GLU acyclic bool “protein and not cyclic”
aliphatic bool residues named ALA GLY ILE LEU VAL alpha bool atom’s residue is an alpha helix
amino bool a residue with atoms namedC, N, CA, and O aromatic bool residues named HIS PHE TRP TYR
basic bool residues named ARG HIS LYS bonded bool atoms for which numbonds>0
buried bool residues named ALA LEU VAL ILE PHE CYS MET TRP cg bool residues named CYT C GUA G
charged bool “basic or acidic”
cyclic bool residues named HIS PHE PRO TRP TYR 77
Keyword Arg Description
hetero bool “not (protein or nucleic)”
hydrogen bool name ”[0-9]?H.*”
large bool “protein and not (small or medium)”
medium bool residues named VAL THR ASP ASN PRO CYS ASX PCA HYP
neutral bool residues named VAL PHE GLN TYR HIS CYS MET TRP ASX GLX PCA HYP
polar bool “protein and not hydrophobic”
purine bool residues named ADE A GUA G
pyrimidine bool residues named CYT C THY T URI U small bool residues named ALA GLY SER
surface bool “protein and not buried”
rasmol str translates Rasmol selection string to VMD alpha helix bool atom’s residue is in an alpha helix
pi helix bool atom’s residue is in a pi helix helix 3 10 bool atom’s residue is in a 3-10 helix
helix bool atom’s residue is in an alpha or pi or 3-10 helix extended beta bool atom’s residue is a beta sheet
bridge beta bool atom’s residue is a beta sheet sheet bool atom’s residue is a beta sheet
turn bool atom’s residue is in a turn conformation coil bool atom’s residue is in a coil conformation structure str single letter name for the secondary structure phi, psi float backbone conformational angles
within str selects atoms within a specified distance of a selection (i.ewithin 5 of name FE).
exwithin str exclusive within, equivalent to(within 3 of X) and not X.
same str selects atoms which have the same keyword as
the atoms in a given selection (i.e. same segname as resid 35) ufx, ufy, ufz num force to apply in the x, y, or z coordinates
Table 5.6: Atom selection keywords (continued).
Function Description sqr(x) square of x
sqrt(x) square root of x abs(x) absolute value of x
floor(x) largest integer not greater than x ceil(x) smallest integer not less than x sin(x) sine of x
cos(x) cosine of x tan(x) tangent of x atan(x) arctangent of x asin(x) arcsin of x acos(x) arccos of x
sinh(x) hyperbolic sine of x cosh(x) hyperbolic cosine of x tanh(x) hyperbolic tangent of x exp(x) “e to the power x”
log(x) natural log of x log10(x) log base 10 of x
Table 5.7: Atom selection functions.
Function Arg Description
volN float value of the voxel of the volumetric data of ID N nearest to the atom
interpvolN float interpolated value of the voxels of the volumetric data of ID N around the atom
Table 5.8: Read-only atom selection keywords which may be used to query the values of an under- lying volumetric map in the same molecule. The value ofN, which can be 0 to 7 inclusively, refers to the volID of the underlying volumetric data (e.g., you could typeinterpvol2).
Read-only atom selection keywords for querying volumetric data
Symbol Example Definition
. . , A.C match any character
[] [ABCabc] , [A-Ca-c] match any char in the list
[~] [~Z] , [~XYZ] , [^x-z] match all except the chars in the list
^ ^C , ^A.* next token must be the first part of string
$ [CO]G$ prev token must be the last part of string
* C* , [ab]* match 0 or more copies of prev char or regular expression token
+ C+ , [ab]+ match 1 or more copies of the prev token
\| C\|O match either the 1st token or the 2nd
\(\) \(CA\)+ combines multiple tokens into one Table 5.9: Regular expression methods.
X-PLOR Wildcard Description Regular Expression
* matches any string .*
% matches a single character .
+ matches any digit [0-9]
# matches any number [0-9]+
Table 5.10: Regular expression conversions.
Chapter 6
Viewing Modes
There are many different viewing modes available. These show the scene in orthographic or per- spective views, and in several mono- and stereo- graphic displays. The stereo mode can be changed using thestereoentry in the Display form or the text command display stereo mode.
6.1 Perspective/Orthographic views
In the perspective view (the default), objects which are far away are smaller than those nearby.
In the orthographic view, all objects appear at the same scale. Since some prefer one over the other, both options are available. Perspective viewpoints give more information about depth and are often easier to view because you use perspective views in real life. Orthographic viewpoints make it much easier to compare two parts of the molecule, as there is no question about how the viewpoint may affect the perception of distance.