Specifying atoms

Many of the actions in PLUMED take a list of atom positions in input. Within PLUMED atoms are specified using their numerical indices in the molecular dynamics input file.

In PLUMED lists of atoms can be either provided directly inside the definition of each action, or predefined as a GROUP that can be reused multiple times. Lists of atoms can be written as:

If you want to use the atoms in a group as the input for a action you use the label of the group as shown in the following input:

Click on the labels of the actions for more information on what each action computes
tested onnewmanual
g5: GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=1,2
d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=g5

A few other wasys of using groups in the input to actions are also available:

The MOLINFO command

You can access many useful shortcuts for specifying atomic positions to PLUMED by using the MOLINFO, which takes a PDB structure file in input. This command allows you to access the following list of shortcuts.

Name Description
@allatoms refers to all the MD codes atoms and PLUMEDs vatoms
@mdatoms refers to all the MD codes atoms but not PLUMEDs vatoms
@ndx: load a group from a GROMACS index file
@alpha- the four atoms that are required to calculate the alpha backbone dihedral for
@back- the protein/dna/rna backbone atoms in
@base- the heavy atoms of the base in
@beta- the four atoms that are required to calculate the beta backbone dihedral for
@chi- the four atoms that are required to alcullate the chi dihedral for
@chi1- the four atoms that are required to calculate the chi1 dihedral for
@chi2- the four atoms that are required to calculate the chi2 dihedral for
@chi3- the four atoms that are required to calculate the chi3 dihedral for
@chi4- the four atoms that are required to calculate the chi4 dihedral for
@chi5- the four atoms that are required to calculate the chi5 dihedral for
@delta- the four atoms that are required to calculate the delta backbone dihedral for
@epsilon- the four atoms that are required to calculate the backbone epsilon dihedral for
@gamma- the four atoms that are required to calculate the gamma backbone dihedral for
@hydrogens all hydrogen atoms
@ions all the ions
@lcs- an ordered triplet of atoms on the 6-membered ring of the nucleobase in
@mda: atom selection built using syntax for MDAnalysis
@mdt: atom selection built using syntax for mdtraj
@nonhydrogens all non hydrogen atoms
@nucleic all atoms that are part of a DNA or RNA molecule
@omega- the four atoms that are required to calculate the omega dihedral for
@phi- the four atoms that are required to calculate the phi dihedral for
@protein all atoms that are part of a protein
@psi- the four atoms that are required to calculate the psi dihedral for
@sidechain- the protein sidechain atoms in
@sugar- the heavy atoms of the sugar in
@v0- the four atoms that are required to calculate the v0 sugar dihedral for
@v1- the four atoms that are required to calculate the v1 sugar dihedral for
@v2- the four atoms that are required to calculate the v2 sugar dihedral for
@v3- the four atoms that are required to calculate the v3 sugar dihedral for
@v4- the four atoms that are required to calculate the v4 sugar dihedral for
@vmd: atom selection built using syntax for VMD python module
@vmdexec: atom selection built using syntax for VMD
@water all water molecules
@zeta- the four atoms that are required to calculate the zeta backbone dihedral for

Virtual atoms

Sometimes, when calculating a collective variable, you may not want to use the positions of a number of atoms directly. Instead you may wish to use the position of a virtual atom whose position is generated based on the positions of a collection of other atoms. For example you might want to use the center of mass of a group of atoms. PLUMED has a number of routines for calculating the positions of these virtual atoms from lists of atoms that are in the vatom module.

To specify to an action that you want to use the position of a virtual atom to calculate an action rather than one of the atoms in your system you simply use the label for your virtual atom in place of the usual numerical index. Virtual atoms and normal atoms can be mixed together in the input to actions as shown below:

Click on the labels of the actions for more information on what each action computes
tested onnewmanual
com1: COMCalculate the center of mass for a group of atoms. More details ATOMSthe list of atoms which are involved the virtual atom's definition=1,10 
d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=11,com1

If you don’t want to calculate CVs from the virtual atom. That is to say you just want to monitor the position of a virtual atom (or any set of atoms) over the course of your trajectory you can do this using DUMPATOMS.

The list of the virtual atoms defined in PLUMED can be obtained by using the command GROUP ATOMS=@allatoms REMOVE=@mdatoms.

Broken molecules and Periodic Boundary Conditions

PLUMED is designed so that for the majority of the CVs implemented the periodic boundary conditions are treated in the same manner as they would be treated in the host code. In some codes this can be problematic when the actions you are using involve some property of a molecule. These codes allow the atoms in the molecules to become separated by periodic boundaries, a fact which PLUMED could only deal with if the topology is passed from the MD code to PLUMED. Doing this work would involve a lot laborious programming and goes against our original aim of having a general patch that can be implemented in a wide variety of MD codes. Consequentially, we have implemented a more pragmatic solution to this problem - the user specifies in input any molecules (or parts of molecules) that must be kept in tact throughout the simulation run using the WHOLEMOLECULES command.

The following input computes the end-to-end distance for a polymer of 100 atoms and keeps it at a value around 5.

Click on the labels of the actions for more information on what each action computes
tested onnewmanual
WHOLEMOLECULESThis action is used to rebuild molecules that can become split by the periodic boundary conditions. More details ENTITY0the atoms that make up a molecule that you wish to align=1-100
e2e: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,100 NOPBC ignore the periodic boundary conditions when calculating distances
RESTRAINTAdds harmonic and/or linear restraints on one or more variables. More details ARGthe values the harmonic restraint acts upon=e2e KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=1 ATthe position of the restraint=5

Notice that NOPBC is used to in the DISTANCE action so as to ensure that if the end-to-end distance is larger than half the simulation box the distance is compute properly. Also notice that, since many MD codes break molecules across cell boundary, it might be necessary to use the WHOLEMOLECULES keyword (also notice that it should be before distance).

Notice that most expressions are invariant with respect to a change in the order of the atoms, but some of them depend on that order. E.g., with WHOLEMOLECULES it could be useful to specify atom lists in a reversed order.

Click on the labels of the actions for more information on what each action computes
tested onnewmanual
# to see the effect, one could dump the atoms as they were before molecule reconstruction:
# DUMPATOMS FILE=dump-broken.xyz ATOMS=1-20
WHOLEMOLECULESThis action is used to rebuild molecules that can become split by the periodic boundary conditions. More details STRIDE the frequency with which molecules are reassembled=1 ENTITY0the atoms that make up a molecule that you wish to align=1-20
DUMPATOMSDump selected atoms on a file. More details FILEfile on which to output coordinates; extension is automatically detected=dump.xyz ATOMSthe atom indices whose positions you would like to print out=1-20

Notice that there are other ways to manipulate the coordinates stored within PLUMED: