LCOV - code coverage report
Current view: top level - setup - MolInfo.cpp (source / functions) Hit Total Coverage
Test: plumed test coverage Lines: 2 2 100.0 %
Date: 2021-11-18 15:22:58 Functions: 5 5 100.0 %

          Line data    Source code
       1             : /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
       2             :    Copyright (c) 2012-2020 The plumed team
       3             :    (see the PEOPLE file at the root of the distribution for a list of names)
       4             : 
       5             :    See http://www.plumed.org for more information.
       6             : 
       7             :    This file is part of plumed, version 2.
       8             : 
       9             :    plumed is free software: you can redistribute it and/or modify
      10             :    it under the terms of the GNU Lesser General Public License as published by
      11             :    the Free Software Foundation, either version 3 of the License, or
      12             :    (at your option) any later version.
      13             : 
      14             :    plumed is distributed in the hope that it will be useful,
      15             :    but WITHOUT ANY WARRANTY; without even the implied warranty of
      16             :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      17             :    GNU Lesser General Public License for more details.
      18             : 
      19             :    You should have received a copy of the GNU Lesser General Public License
      20             :    along with plumed.  If not, see <http://www.gnu.org/licenses/>.
      21             : +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
      22             : #include "core/ActionRegister.h"
      23             : #include "core/SetupMolInfo.h"
      24             : 
      25             : namespace PLMD {
      26             : namespace setup {
      27             : 
      28             : //+PLUMEDOC TOPOLOGY MOLINFO
      29             : /*
      30             : This command is used to provide information on the molecules that are present in your system.
      31             : 
      32             : The information on the molecules in your system can either be provided in the form of a pdb file
      33             : or as a set of lists of atoms that describe the various chains in your system. If a pdb file
      34             : is used plumed the MOLINFO command will endeavor to recognize the various chains and residues that
      35             : make up the molecules in your system using the chainIDs and resnumbers from the pdb file. You can
      36             : then use this information in later commands to specify atom lists in terms residues.  For example
      37             : using this command you can find the backbone atoms in your structure automatically.
      38             : 
      39             : \warning
      40             : Please be aware that the PDB parser in plumed is far from perfect. You should thus check the log file
      41             : and examine what plumed is actually doing whenever you use the MOLINFO action.
      42             : Also make sure that the atoms are listed in the pdb with the correct order.
      43             : If you are using gromacs, the safest way is to use reference pdb file
      44             : generated with `gmx editconf -f topol.tpr -o reference.pdb`.
      45             : 
      46             : More information of the PDB parser implemented in PLUMED can be found \ref pdbreader "at this page".
      47             : 
      48             : Providing `MOLTYPE=protein`, `MOLTYPE=rna`, or `MOLTYPE=dna` will instruct plumed to look
      49             : for known residues from these three types of molecule. In other words, this is available for
      50             : historical reasons and to allow future extensions where alternative lists will be provided.
      51             : As of now, you can just ignore this keyword.
      52             : 
      53             : Using \ref MOLINFO extends the possibility of atoms selection using the @ special
      54             : symbol. The following shortcuts are available that do not refer to one specific residue:
      55             : 
      56             : \verbatim
      57             : @nucleic : all atoms that are part of a DNA or RNA molecule
      58             : @protein : all atoms that are part of a protein
      59             : @water : all water molecules
      60             : @ions : all the ions
      61             : @hydrogens : all hydrogen atoms (those for which the first non-number in the name is a H)
      62             : @nonhydrogens : all non hydrogen atoms (those for which the first non-number in the name is not a H)
      63             : \endverbatim
      64             : 
      65             : \warning
      66             : Be careful since these choices are based on common names used in PDB files. Always check if
      67             : the selected atoms are correct.
      68             : 
      69             : In addition, atoms from a specific residue can be selected with a symbol in this form:
      70             : 
      71             : \verbatim
      72             : @"definition"-chain_residuenum
      73             : @"definition"-chainresiduenum
      74             : @"definition"-residuenum
      75             : \endverbatim
      76             : 
      77             : So for example
      78             : 
      79             : \verbatim
      80             : @psi-1 will select the atoms defining the psi torsion of residue 1
      81             : @psi-C1  or @psi-C_1 will define the same torsion for residue 1 of chain C.
      82             : @psi-3_1 will define the same torsion for residue 1 of chain 3.
      83             : \endverbatim
      84             : 
      85             : Using the underscore to separate chain and residue is available as of PLUMED 2.5 and allows selecting chains
      86             : with a numeric id.
      87             : 
      88             : In the following are listed the current available definitions:
      89             : 
      90             : For protein residues, the following groups are available:
      91             : 
      92             : \verbatim
      93             : @phi-#
      94             : @psi-#
      95             : @omega-#
      96             : @chi1-#
      97             : @chi2-#
      98             : @chi3-#
      99             : @chi4-#
     100             : @chi5-#
     101             : \endverbatim
     102             : 
     103             : that select the appropriate atoms that define each dihedral angle for residue #.
     104             : 
     105             : For DNA or RNA residues, the following groups are available:
     106             : 
     107             : \verbatim
     108             : # quadruplets for backbone dihedral angles
     109             : @alpha-#
     110             : @beta-#
     111             : @gamma-#
     112             : @delta-#
     113             : @epsilon-#
     114             : @zeta-#
     115             : 
     116             : # quadruplets for sugar dihedral angles
     117             : @v0-#
     118             : @v1-#
     119             : @v2-#
     120             : @v3-#
     121             : @v4-#
     122             : 
     123             : # quadruplet corresponding to the chi torsional angle
     124             : @chi-#
     125             : 
     126             : # backbone, sugar, and base heavy atoms
     127             : @back-#
     128             : @sugar-#
     129             : @base-#
     130             : 
     131             : # ordered triplets of atoms on the 6-membered ring of nucleobases
     132             : # namely:
     133             : #  C2/C4/C6 for pyrimidines
     134             : #  C2/C6/C4 for purines
     135             : @lcs-#
     136             : \endverbatim
     137             : 
     138             : Notice that `zeta` and `epsilon` groups should not be used on 3' end residue and `alpha` and `beta`
     139             : should not be used on 5' end residue.
     140             : 
     141             : Furthermore it is also possible to pick single atoms using the syntax
     142             : `atom-chain_residuenum`, `@atom-chainresiduenum` or `@atom-residuenum`.
     143             : As of PLUMED 2.5, this also works when the residue is not a protein/rna/dna residue.
     144             : For instance, `@OW-100` will select oxygen of water molecule with residue number 100.
     145             : 
     146             : Finally, notice that other shortcuts are available even when not using the \ref MOLINFO command (see \ref atomSpecs).
     147             : 
     148             : \warning If a residue-chain is repeated twice in the reference pdb only the first entry will be selected.
     149             : 
     150             : \bug At the moment the HA1 atoms in a GLY residues are treated as if they are the CB atoms. This may or
     151             : may not be true - GLY is problematic for secondary structure residues as it is achiral.
     152             : 
     153             : \bug If you use WHOLEMOLECULES RESIDUES=1-10 for a 18 amino acid protein
     154             : ( 18 amino acids + 2 terminal groups = 20 residues ) the code will fail as it will not be able to
     155             : interpret terminal residue 1.
     156             : 
     157             : \par Examples
     158             : 
     159             : In the following example the MOLINFO command is used to provide the information on which atoms
     160             : are in the backbone of a protein to the ALPHARMSD CV.
     161             : 
     162             : \plumedfile
     163             : #SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
     164             : MOLINFO STRUCTURE=reference.pdb
     165             : ALPHARMSD RESIDUES=all TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12} LABEL=a
     166             : \endplumedfile
     167             : 
     168             : The following example prints the distance corresponding to the hydrogen bonds
     169             : in a GC Watson-Crick pair.
     170             : 
     171             : \plumedfile
     172             : #SETTINGS MOLFILE=regtest/basic/rt-ermsd/ref.pdb
     173             : MOLINFO STRUCTURE=reference.pdb MOLTYPE=dna
     174             : hb1: DISTANCE ATOMS=@N2-2,@O2-15
     175             : hb2: DISTANCE ATOMS=@N1-2,@N3-15
     176             : hb3: DISTANCE ATOMS=@O6-2,@N4-15
     177             : PRINT ARG=hb1,hb2,hb3
     178             : \endplumedfile
     179             : 
     180             : This example use MOLINFO to calculate torsion angles
     181             : 
     182             : \plumedfile
     183             : #SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
     184             : MOLINFO MOLTYPE=protein STRUCTURE=myprotein.pdb
     185             : t1: TORSION ATOMS=@phi-3
     186             : t2: TORSION ATOMS=@psi-4
     187             : PRINT ARG=t1,t2 FILE=colvar STRIDE=10
     188             : \endplumedfile
     189             : 
     190             : */
     191             : //+ENDPLUMEDOC
     192             : 
     193             : 
     194             : /*
     195             : This action is defined in core/ as it is used by other actions.
     196             : Anyway, it is registered here, so that excluding this module from
     197             : compilation will exclude it from plumed.
     198             : */
     199             : 
     200             : typedef PLMD::SetupMolInfo MolInfo;
     201             : 
     202        7488 : PLUMED_REGISTER_ACTION(MolInfo,"MOLINFO")
     203             : 
     204             : }
     205        5517 : }

Generated by: LCOV version 1.14