This is the low-level (non object-oriented) interface to atom selection objects.
To create a new atomsel: .. currentmodule:: vmd.atomsel .. automethod:: __init__
Atomsel objects have attributes. New in vmd-python > 3.0.0, you can access these attributes directly from the atomsel object to both get and set! For example:
protein = atomsel("protein") protein.chain = "A"
Here are basic methods working with an atom selection object:
||Recompute which atoms in the molecule belong to this selection.|
||Write atoms in this selection to a file of the given type|
Fitting selections to each other¶
These methods can be used to move selections around or calculate the differences between them.
||Compute the transformation matrix for the root-mean-square (RMS) alignment of this selection to the one given.|
||Shift the selection by a vector|
||Apply a coordinate transformation to the selection.|
Many calculations can be performed on atomsel objects. For speed, the following are implemented internally in C:
||Get the coordinates of the center of the selection, optionally with weights on the selection atoms|
||Get the coordinates of the center of each residue in the selection, optionally weighted by weight|
||Finds all atoms in selection within a given distance of any atom in the given selection that are not directly bonded to it.|
||Get hydrogen bonds present in current frame of selection using simple geometric criteria.|
||Get minimum and maximum coordinates for selected atoms|
||Calculate the radius of gyration of this selection|
||Calculate the root-mean-square distance (RMSD) between selections.|
||Calculate the root-mean-square distance (RMSD) between selection after rotating them optimally|
||Get the per-residue root-mean-square (RMS) distance between selections|
||Measures the root-mean-square fluctuation (RMSF) along a trajectory on a per-atom basis.|
||Measures the root-mean-square fluctuation (RMSF) along a trajectory on a per-residue basis.|
||Get solvent accessible surface area of selection|
There are many attributes, some of which are changeable by the user. To get them, use:
||List available atom attributes|
Here are the atomselection attributes that may be get or set using this module. If the attribute refers to some inherent feature of the atom (such as “backbone”), using the get function returns a list of booleans.
If changing attributes, make sure to call update() on the atom selection to ensure that changes are applied to your atom selection.
These attributes describe the atom selection itself, and may be assigned to.
||For each atom in selection, a list of the indices of atoms to which it is bonded.|
||Get the frame an atomsel object references.|
||The molecule ID the selection is associated with|
These attributes are features characteristic of an atom:
name: Atom name
type: Atom type
index: Atom index, counting from 1
serial: Atom index, counting from 0
mass: Atomic mass
atomicnumber: Atomic number
element: Atomic element
altloc: Alternate atom location, if present
insertion: Atom insertion code
numbonds: Number of bonds atom participates in. Does not take into account bond order
beta: Beta factor for the atom, if present
occupancy: Occupancy of the atom, if present
charge: Charge on the atom, if present
radius: The radius of the atom. Used in SASA calculations and visualization
Per-atom spatial attributes¶
These attributes deal mostly with the coordinates of the atoms
z: X, Y, or Z coordinate of the atom
vz: X, Y, or Z velocity of the atom, if present
ufz: X, Y, or Z force on the atom, if present
These attributes give information about the atom in the context of its environment.
residue: Internal residue number to which atom belongs, counting from 0.
resid: Residue ID to which atom belongs, using canonical numbering if present in input molecule
resname: Residue name to which atom belongs
chain: Chain to which atom belongs, usually a single letter
segname: Segment name to which atom belongs, if present
segid: Segment index to which atom belongs
fragment: Molecular fragment to which atom belongs, counting from 0
pfrag: Protein fragment to which atom belongs, counting from 0. If atom is not part of a protein fragment, is set to -1
nfrag: Nucleic acid fragment to which atom belongs, counting from 0. If atom is not part of a nucleic acid, is set to -1
phi: Phi backbone angle for the residue this atom is in
psi: Psi backbone angel for the residue this atom is in
backbone: If the atom is part of a protein backbone
sidechain: If the atom is in a protein sidechain
protein: If the atom is part of a protein
nucleic: If the atom is part of a nucleic acid
waters: If the atom is water
vmd_fast_hydrogen: True if the atom is hydrogen, faster than using element.
Secondary structure attributes¶
If there is no secondary structure information parsed from the input molecule file, the accuracy of these attributes depends on the quality of predicted secondary structure by VMD or STRIDE.
The DSSP classification corresponding to each keyword is also listed.
helix: G,H,I If the atom is part of a helix
alpha_helix: H If the atom is part of an alpha helix
helix_3_10: G If the atom is part of a 3 10 helix
pi_helix: I If the atom is part of a pi helix
beta_sheet: E,B If the atom is part of a beta sheet
extended_beta: E If the atom is part of an extended sheet
bridge_beta: B If the atom is part of an isolated beta bridge
turn: T If the atom is part of a hydrogen-bonded turn
coil: C If the atom is part of any other secondary structure conformation
structure: The DSSP classification of the secondary structure
pucker: The amount of pucker on a ring, designed for carbohydrates
These fields are populated when there is a volumetric dataset loaded into the molecule. Otherwise, they’re all NaN.
volindex7: Indices into volumetric dataset for atom
vol7: Volume value at this atom
interpvol7: Interpolated volume value at this atom
These fields can be used to assign per-atom data of your choice:
user4: Four floating-point fields for your data
flag7: Seven boolean fields for your data