Module |
generic |
Description |
Usage |
Create a constant value from a PDB input file |
  |
output value |
type |
a value that is constructed from the information in the PDB file |
scalar/vector/matrix |
The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.
Keyword |
Type |
Description |
ARG |
scalar/vector |
read this single argument from the input rather than the atomic structure |
Further details and examples
Create a constant value from a PDB input file
This shortcut converts the contents of a PDB file to one or more CONSTANT actions.
Converting PDB files to Values in this way is useful because it means that when we implement methods, like those
in the refdist or mapping modules or the RMSD action, that calculate the distance between two
configurations those two configurations are both stored in PLUMED values. The same code can thus be used to
calculate the difference between the instantaneous configuration
and a constant reference configuration that was read from a file or between two reference configuration.
The following example illustrates how this action can be used to read a set of reference atomic positions
Click on the labels of the actions for more information on what each action computes
refThe PDB2CONSTANT action with label ref calculates the following quantities: Quantity | Type | Description |
ref | matrix | a value that is constructed from the information in the PDB file |
: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and it has hidden defaults. More details REFERENCEa file in pdb format containing the reference structure= ATOM 2 O ALA 2 -0.926 -2.447 -0.497 1.00 1.00 DIA O
ATOM 4 HNT ALA 2 0.533 -0.396 1.184 1.00 1.00 DIA H
ATOM 6 HT1 ALA 2 -0.216 -2.590 1.371 1.00 1.00 DIA H
ATOM 7 HT2 ALA 2 -0.309 -1.255 2.315 1.00 1.00 DIA H
ATOM 8 HT3 ALA 2 -1.480 -1.560 1.212 1.00 1.00 DIA H
ATOM 9 CAY ALA 2 -0.096 2.144 -0.669 1.00 1.00 DIA C
ATOM 10 HY1 ALA 2 0.871 2.385 -0.588 1.00 1.00 DIA H
ATOM 12 HY3 ALA 2 -0.520 2.679 -1.400 1.00 1.00 DIA H
ATOM 14 OY ALA 2 -1.139 0.931 -0.973 1.00 1.00 DIA O
ATOM 16 HN ALA 2 1.713 1.021 -0.873 1.00 1.00 DIA H
ATOM 18 HA ALA 2 0.099 -0.774 -2.218 1.00 1.00 DIA H
ATOM 19 CB ALA 2 2.063 -1.223 -1.276 1.00 1.00 DIA C
ATOM 20 HB1 ALA 2 2.670 -0.716 -2.057 1.00 1.00 DIA H
ATOM 21 HB2 ALA 2 2.556 -1.051 -0.295 1.00 1.00 DIA H
ATOM 22 HB3 ALA 2 2.070 -2.314 -1.490 1.00 1.00 DIA H
ref: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and uses the defaults shown here. More details REFERENCEa file in pdb format containing the reference structure= ATOM 2 O ALA 2 -0.926 -2.447 -0.497 1.00 1.00 DIA O
ATOM 4 HNT ALA 2 0.533 -0.396 1.184 1.00 1.00 DIA H
ATOM 6 HT1 ALA 2 -0.216 -2.590 1.371 1.00 1.00 DIA H
ATOM 7 HT2 ALA 2 -0.309 -1.255 2.315 1.00 1.00 DIA H
ATOM 8 HT3 ALA 2 -1.480 -1.560 1.212 1.00 1.00 DIA H
ATOM 9 CAY ALA 2 -0.096 2.144 -0.669 1.00 1.00 DIA C
ATOM 10 HY1 ALA 2 0.871 2.385 -0.588 1.00 1.00 DIA H
ATOM 12 HY3 ALA 2 -0.520 2.679 -1.400 1.00 1.00 DIA H
ATOM 14 OY ALA 2 -1.139 0.931 -0.973 1.00 1.00 DIA O
ATOM 16 HN ALA 2 1.713 1.021 -0.873 1.00 1.00 DIA H
ATOM 18 HA ALA 2 0.099 -0.774 -2.218 1.00 1.00 DIA H
ATOM 19 CB ALA 2 2.063 -1.223 -1.276 1.00 1.00 DIA C
ATOM 20 HB1 ALA 2 2.670 -0.716 -2.057 1.00 1.00 DIA H
ATOM 21 HB2 ALA 2 2.556 -1.051 -0.295 1.00 1.00 DIA H
ATOM 22 HB3 ALA 2 2.070 -2.314 -1.490 1.00 1.00 DIA H
NUMBER if there are multiple structures in the pdb file you can specify that you want the RMSD from a specific structure by specifying its place in the file here=0
# ref: PDB2CONSTANT REFERENCE=regtest/basic/rt19/test0.pdb
refThe CONSTANT action with label ref calculates the following quantities: Quantity | Type | Description |
ref | matrix | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details NROWS the number of rows in your input matrix=1 NCOLS the number of columns in your matrix=45 VALUESthe numbers that are in your constant value=-0.145193,0.000706667,-0.0741933,-0.0834933,-0.200593,-0.0621933,0.0345067,-0.104593,-0.166493,0.118707,-0.0426933,0.153707,0.214407,0.203007,0.154407,-0.21026,-0.00516,-0.22456,-0.09106,-0.12156,0.24884,0.27294,0.30234,0.12754,0.13654,-0.04296,-0.08786,-0.03716,-0.07066,-0.19696,-0.00800667,0.160093,0.178793,0.273193,0.162893,-0.0252067,-0.0171067,-0.0983067,-0.0556067,-0.0456067,-0.180107,-0.0859067,-0.164007,0.0121933,-0.107307
# --- End of included input ---
You can see how the reference positions are converted to CONSTANT action that outputs a vector by expanding the shortcut.
You can also use this command to read in multiple reference positions as illustrated below:
Click on the labels of the actions for more information on what each action computes
refThe PDB2CONSTANT action with label ref calculates the following quantities: Quantity | Type | Description |
ref | matrix | a value that is constructed from the information in the PDB file |
: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and it has hidden defaults. More details REFERENCEa file in pdb format containing the reference structure=
ref: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and uses the defaults shown here. More details REFERENCEa file in pdb format containing the reference structure= NUMBER if there are multiple structures in the pdb file you can specify that you want the RMSD from a specific structure by specifying its place in the file here=0
# ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-3/all.pdb
refThe CONSTANT action with label ref calculates the following quantities: Quantity | Type | Description |
ref | matrix | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details NROWS the number of rows in your input matrix=10 NCOLS the number of columns in your matrix=39 VALUESthe numbers that are in your constant value=-0.305585,-0.170385,-0.106185,-0.119785,-0.172985,0.0112154,0.0320154,0.0124154,0.123615,0.183815,0.153815,0.0988154,0.259215,0.00147692,-0.0423231,-0.116923,0.00607692,0.0680769,-0.0299231,-0.133123,-0.0145231,0.0518769,0.138877,0.0238769,-0.0441231,0.0906769,0.103354,0.0667538,0.138954,-0.0482462,-0.102246,-0.0990462,-0.0752462,-0.252046,-0.0348462,-0.0968462,0.0929538,0.140154,0.166354,-0.305785,-0.169685,-0.108385,-0.117885,-0.168985,0.0126154,0.0292154,0.0144154,0.126615,0.195215,0.149715,0.0881154,0.254815,0.00988462,-0.0372154,-0.111515,0.00708462,0.0684846,-0.0333154,-0.137115,-0.0220154,0.0458846,0.122485,0.0270846,-0.0326154,0.0928846,0.100908,0.0670077,0.141008,-0.0480923,-0.105892,-0.0981923,-0.0731923,-0.251592,-0.0360923,-0.102592,0.0953077,0.144608,0.166808,-0.295777,-0.163177,-0.0954769,-0.119477,-0.176577,0.00582308,0.0256231,-0.00437692,0.124923,0.193223,0.152623,0.0914231,0.261223,0.00602308,-0.0407769,-0.115777,0.00412308,0.0659231,-0.0350769,-0.138277,-0.0215769,0.0453231,0.114023,0.0343231,-0.0200769,0.101823,0.123631,0.0790308,0.149231,-0.0394692,-0.0916692,-0.0996692,-0.0756692,-0.252369,-0.0463692,-0.119869,0.0847308,0.139631,0.148831,-0.296715,-0.164115,-0.0986154,-0.118115,-0.173215,0.00788462,0.0248846,-0.00271538,0.127985,0.202485,0.148485,0.0834846,0.258285,0.00342308,-0.0427769,-0.121177,0.00522308,0.0697231,-0.0344769,-0.139177,-0.0167769,0.0422231,0.103123,0.0378231,-0.0105769,0.103423,0.119554,0.0769538,0.145154,-0.0402462,-0.0919462,-0.0994462,-0.0779462,-0.252146,-0.0451462,-0.118146,0.0883538,0.142454,0.152554,-0.296354,-0.163354,-0.0989538,-0.117454,-0.171354,0.00794615,0.0239462,-0.00405385,0.129546,0.209546,0.146046,0.0778462,0.256646,0.00252308,-0.0442769,-0.125977,0.00552308,0.0715231,-0.0349769,-0.139677,-0.0123769,0.0402231,0.0922231,0.0412231,-0.00147692,0.105523,0.121262,0.0769615,0.142762,-0.0388385,-0.0889385,-0.100338,-0.0813385,-0.252438,-0.0457385,-0.119838,0.0883615,0.144162,0.153962,-0.294615,-0.174515,-0.139015,-0.108315,-0.138015,0.00658462,-0.00661538,0.0131846,0.139085,0.239285,0.142185,0.0596846,0.261085,0.111046,0.0240462,-0.0318538,0.0102462,0.0567462,-0.0774538,-0.163754,-0.120154,-0.0126538,-0.0248538,0.0525462,0.0596462,0.116446,0.0541692,0.0574692,0.160469,-0.0569308,-0.139531,-0.0736308,-0.0117308,-0.220431,-0.0321308,-0.101531,0.0861692,0.139769,0.137869,-0.294215,-0.174615,-0.138915,-0.107615,-0.137315,0.00738462,-0.00761538,0.0134846,0.139885,0.242485,0.141285,0.0566846,0.259085,0.109038,0.0225385,-0.0368615,0.0114385,0.0606385,-0.0768615,-0.165462,-0.116362,-0.0151615,-0.0343615,0.0559385,0.0669385,0.118538,0.0575769,0.0587769,0.160977,-0.0555231,-0.136323,-0.0742231,-0.0148231,-0.222423,-0.0305231,-0.0949231,0.0831769,0.132277,0.135977,-0.294754,-0.175554,-0.142554,-0.106254,-0.134554,0.00854615,-0.00645385,0.0164462,0.140946,0.246146,0.138546,0.0525462,0.256946,0.1063,0.0189,-0.0422,0.0112,0.0622,-0.0769,-0.1669,-0.1127,-0.0171,-0.0426,0.0609,0.0757,0.1232,0.0574462,0.0580462,0.159246,-0.0556538,-0.135754,-0.0743538,-0.0182538,-0.224254,-0.0267538,-0.0841538,0.0819462,0.125246,0.137246,-0.286546,-0.177646,-0.161446,-0.0984462,-0.112646,0.00715385,-0.0236462,0.0255538,0.140754,0.247154,0.137154,0.0478538,0.254754,0.139323,0.0429231,-0.00477692,0.0109231,0.0521231,-0.0897769,-0.167877,-0.148477,-0.0364769,-0.0868769,0.0655231,0.0990231,0.124423,0.00981538,0.0360154,0.147615,-0.0667846,-0.155285,-0.0593846,0.00691538,-0.200185,-0.00658462,-0.0388846,0.0812154,0.106515,0.139015,-0.288869,-0.178869,-0.161769,-0.0988692,-0.113469,0.00773077,-0.0226692,0.0279308,0.141231,0.247031,0.137231,0.0483308,0.255031,0.133585,0.0381846,-0.0115154,0.00948462,0.0525846,-0.0890154,-0.169715,-0.145815,-0.0364154,-0.0913154,0.0707846,0.107885,0.131285,0.0142308,0.0387308,0.149631,-0.0642692,-0.151869,-0.0588692,0.00513077,-0.201269,-0.00506923,-0.0309692,0.0755308,0.0970308,0.132031
# --- End of included input ---
The CONSTANT that is created by this action is a matrix. Each row of the output matrix contains one set of reference positions.
Notice also that if you have a PDB input which contains multiple reference configurations you can create a vector constant by using the NUMBER
keyword to specify the particular configuration that you would like to read in as shown below:
Click on the labels of the actions for more information on what each action computes
refThe PDB2CONSTANT action with label ref calculates the following quantities: Quantity | Type | Description |
ref | matrix | a value that is constructed from the information in the PDB file |
: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut. More details REFERENCEa file in pdb format containing the reference structure= NUMBER if there are multiple structures in the pdb file you can specify that you want the RMSD from a specific structure by specifying its place in the file here=4
# ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-3/all.pdb NUMBER=4
refThe CONSTANT action with label ref calculates the following quantities: Quantity | Type | Description |
ref | matrix | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details NROWS the number of rows in your input matrix=1 NCOLS the number of columns in your matrix=39 VALUESthe numbers that are in your constant value=-0.296715,-0.164115,-0.0986154,-0.118115,-0.173215,0.00788462,0.0248846,-0.00271538,0.127985,0.202485,0.148485,0.0834846,0.258285,0.00342308,-0.0427769,-0.121177,0.00522308,0.0697231,-0.0344769,-0.139177,-0.0167769,0.0422231,0.103123,0.0378231,-0.0105769,0.103423,0.119554,0.0769538,0.145154,-0.0402462,-0.0919462,-0.0994462,-0.0779462,-0.252146,-0.0451462,-0.118146,0.0883538,0.142454,0.152554
# --- End of included input ---
The input above will reads in the fourth configuration in the input PDB file only.
PLUMED uses the PDB file format here and in several other places
- To read the molecular structure (MOLINFO).
- To read reference conformations (RMSD, but also in methods such as FIT_TO_TEMPLATE, etc).
The implemented PDB reader expects a file formatted correctly according to the
PDB standard.
In particular, the following columns are read from ATOM records
columns | content
1-6 | record name (ATOM or HETATM)
7-11 | serial number of the atom (starting from 1)
13-16 | atom name
18-20 | residue name
22 | chain id
23-26 | residue number
31-38 | x coordinate
39-46 | y coordinate
47-54 | z coordinate
55-60 | occupancy
61-66 | beta factor
The PLUMED parser is slightly more permissive than the official PDB format
in the fact that the format of real numbers is not fixed. In other words,
any real number that can be parsed is OK and the dot can be placed anywhere. However,
columns are interpret strictly. A sample PDB should look like the following
ATOM 2 CH3 ACE 1 12.932 -14.718 -6.016 1.00 1.00
ATOM 5 C ACE 1 21.312 -9.928 -5.946 1.00 1.00
ATOM 9 CA ALA 2 19.462 -11.088 -8.986 1.00 1.00
Notice that serial numbers need not to be consecutive. In the three-line example above,
only the coordinates of three atoms are provided. This is perfectly legal and indicates to PLUMED
that information about these atoms only is available. This could be both for structural
information in MOLINFO, where the other atoms would have no name assigned, and for
reference structures used in RMSD, where only the provided atoms would be used to compute RMSD.
Including arguments in PDB files
If you wish to specify reference values for PLUMED Values in the REMARKS of a PLUMED input file like this:
REMARK t1=-4.3345
REMARK t2=3.4725
END
You can read in these reference values by using the PDB2CONSTANT command as follows:
Click on the labels of the actions for more information on what each action computes
t1The TORSION action with label t1 calculates the following quantities: Quantity | Type | Description |
t1 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
t2The TORSION action with label t2 calculates the following quantities: Quantity | Type | Description |
t2 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=5,6,7,8
t1_refThe PDB2CONSTANT action with label t1_ref calculates the following quantities: Quantity | Type | Description |
t1_ref | vector | a value that is constructed from the information in the PDB file |
: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and it has hidden defaults. More details REFERENCEa file in pdb format containing the reference structure= ARGread this single argument from the input rather than the atomic structure=t1
t1_ref: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and uses the defaults shown here. More details REFERENCEa file in pdb format containing the reference structure= ARGread this single argument from the input rather than the atomic structure=t1 NUMBER if there are multiple structures in the pdb file you can specify that you want the RMSD from a specific structure by specifying its place in the file here=0
# t1_ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-4/epath.pdb ARG=t1
t1_refThe CONSTANT action with label t1_ref calculates the following quantities: Quantity | Type | Description |
t1_ref | vector | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details VALUESthe numbers that are in your constant value=-4.3345,-4.194,-4.0535,-3.913,-3.7724,-3.6319,-3.4914,-3.3508,-3.2103,-3.0698
# --- End of included input --- t2_refThe PDB2CONSTANT action with label t2_ref calculates the following quantities: Quantity | Type | Description |
t2_ref | vector | a value that is constructed from the information in the PDB file |
: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and it has hidden defaults. More details REFERENCEa file in pdb format containing the reference structure= ARGread this single argument from the input rather than the atomic structure=t2
t2_ref: PDB2CONSTANTCreate a constant value from a PDB input file This action is a shortcut and uses the defaults shown here. More details REFERENCEa file in pdb format containing the reference structure= ARGread this single argument from the input rather than the atomic structure=t2 NUMBER if there are multiple structures in the pdb file you can specify that you want the RMSD from a specific structure by specifying its place in the file here=0
# t2_ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-4/epath.pdb ARG=t2
t2_refThe CONSTANT action with label t2_ref calculates the following quantities: Quantity | Type | Description |
t2_ref | vector | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions More details VALUESthe numbers that are in your constant value=3.4725,3.342,3.2114,3.0809,2.9504,2.8199,2.6893,2.5588,2.4283,2.2978
# --- End of included input ---
Notice that the input must define values with the labels that are being read in from the reference file
and that separate PDB2CONSTANT commands are required for reading in t1
and t2
. Furthermore, because the
input PDB file contains multiple frames vectors containing all the values for t1
and t2
are output from
the constant commands that are created by the shortcuts in the above input. If you want to read only one of the
configurations in the input PDB file you can use a pdb with a single frame or the NUMBER
keyword described above.
Occupancy and beta factors
PLUMED also reads the occupancy and beta factors from the input PDB files. However, these columns of data are
given a very special meaning.
In cases where the PDB structure is used as a reference for an alignment (that's the case
for instance in RMSD and in FIT_TO_TEMPLATE), the occupancy column is used
to provide the weight of each atom in the alignment. In cases where, perhaps after alignment,
the displacement between running coordinates and the provided PDB is computed, the beta factors
are used as weight for the displacement.
Since setting the weights to zero is the same as not including an atom in the alignment or
displacement calculation, the two following reference files would be equivalent when used in an RMSD
calculation. First file:
\verbatim
ATOM 2 CH3 ACE 1 12.932 -14.718 -6.016 1.00 1.00
ATOM 5 C ACE 1 21.312 -9.928 -5.946 1.00 1.00
ATOM 9 CA ALA 2 19.462 -11.088 -8.986 0.00 0.00
\endverbatim
Second file:
\verbatim
ATOM 2 CH3 ACE 1 12.932 -14.718 -6.016 1.00 1.00
ATOM 5 C ACE 1 21.312 -9.928 -5.946 1.00 1.00
\endverbatim
However notice that many extra atoms with zero weight might slow down the calculation, so
removing lines is better than setting their weights to zero.
In addition, weights for alignment need not to be equivalent to weights for displacement.
Starting with PLUMED 2.7, if all the weights are set to zero they will be normalized to be equal to the
inverse of the number of involved atoms. This means that it will be possible to use files with
the weight columns set to zero obtaining a meaningful result. In previous PLUMED versions,
setting all weights to zero was resulting in an error instead.
Systems with more than 100k atoms
Notice that it very likely does not make any sense to compute the RMSD or any other structural
deviation using many atoms. However, if the protein for which you want to compute RMSD
has atoms with large serial numbers (e.g. because it is located after solvent in the sorted list of atoms)
you might end up with troubles with the limitations of the PDB format. Indeed, since there are 5
columns available for atom serial number, this number cannot be larger than 99999.
In addition, providing MOLINFO with names associated to atoms with a serial larger than 99999 would be impossible.
Since PLUMED 2.4 we allow the hybrid 36 format to be used to specify atom numbers.
This format is not particularly widespread, but has the nice feature that it provides a one-to-one mapping
between numbers up to approximately 80 millions and strings with 5 characters, plus it is backward compatible
for numbers smaller than 100000. This is not true for notations like the hex notation exported by VMD.
Using the hybrid 36 format, the ATOM records for atom ranging from 99997 to 100002 would read like these:
\verbatim
ATOM 99997 Ar X 1 45.349 38.631 15.116 1.00 1.00
ATOM 99998 Ar X 1 46.189 38.631 15.956 1.00 1.00
ATOM 99999 Ar X 1 46.189 39.471 15.116 1.00 1.00
ATOM A0000 Ar X 1 45.349 39.471 15.956 1.00 1.00
ATOM A0000 Ar X 1 45.349 38.631 16.796 1.00 1.00
ATOM A0001 Ar X 1 46.189 38.631 17.636 1.00 1.00
\endverbatim
There are tools that can be found to translate from integers to strings and back using hybrid 36 format
(a simple python script can be found here).
In addition, as of PLUMED 2.5, we provide a command line tool that can be used to renumber atoms in a PDB file.
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
ARG |
input |
none |
read this single argument from the input rather than the atomic structure |
REFERENCE |
compulsory |
none |
a file in pdb format containing the reference structure |
NUMBER |
compulsory |
0 |
if there are multiple structures in the pdb file you can specify that you want the RMSD from a specific structure by specifying its place in the file here |
NOARGS |
optional |
false |
the arguments that are being read from the PDB file are not in the plumed input |