Skip to content

Commit

Permalink
Fixed examples for inputs in generic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello committed Nov 11, 2024
1 parent 9e51cfc commit b482245
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 28 deletions.
22 changes: 21 additions & 1 deletion src/function/Bessel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,27 @@ namespace function {
/*
Calculate the value of a Bessel function.
\par Examples
This action can be used to evaluate [Bessel functions](https://en.wikipedia.org/wiki/Bessel_function).
This was action is needed because the modified Bessel function of the first kind of order 0 is needed in
order to calculate the [von-Misses distribution](https://en.wikipedia.org/wiki/Von_Mises_distribution)
that is used in the implementation of [KERNEL](KERNEL.md). You can thus only use this function to evaluate the
modified Bessel function of the first kind of order 0. You can evaluate the value of this Bessel function
at $x=1$ by using the following input:
```plumed
c: CONSTANT VALUE=1
b: BESSEL ARG=c ORDER=0
```
Notice that you can also use a vector in the input for this action as illustrated below:
```plumed
c: CONSTANT VALUES=1,1,5,2
b: BESSEL ARG=c ORDER=0
```
The value output by BESSEL in this case is also a vector with three components. These components give the values
of the Bessel function at 1.0, 1.5 and 2.0 respectively.
*/
//+ENDPLUMEDOC
Expand Down
3 changes: 3 additions & 0 deletions src/function/LessThan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#include "LessThan.h"
#include "FunctionShortcut.h"
#include "FunctionOfScalar.h"
#include "FunctionOfVector.h"
#include "FunctionOfMatrix.h"
#include "core/ActionRegister.h"
Expand Down Expand Up @@ -196,6 +197,8 @@ Transform all the elements of a matrix using a switching function that is one wh

typedef FunctionShortcut<LessThan> LessThanShortcut;
PLUMED_REGISTER_ACTION(LessThanShortcut,"LESS_THAN")
typedef FunctionOfScalar<LessThan> ScalarLessThan;
PLUMED_REGISTER_ACTION(ScalarLessThan,"LESS_THAN_SCALAR")
typedef FunctionOfVector<LessThan> VectorLessThan;
PLUMED_REGISTER_ACTION(VectorLessThan,"LESS_THAN_VECTOR")
typedef FunctionOfMatrix<LessThan> MatrixLessThan;
Expand Down
3 changes: 3 additions & 0 deletions src/function/MoreThan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#include "MoreThan.h"
#include "FunctionShortcut.h"
#include "FunctionOfScalar.h"
#include "FunctionOfVector.h"
#include "FunctionOfMatrix.h"
#include "core/ActionRegister.h"
Expand Down Expand Up @@ -59,6 +60,8 @@ Transform all the elements of a matrix using a switching function that is one wh

typedef FunctionShortcut<MoreThan> MoreThanShortcut;
PLUMED_REGISTER_ACTION(MoreThanShortcut,"MORE_THAN")
typedef FunctionOfScalar<MoreThan> ScalarMoreThan;
PLUMED_REGISTER_ACTION(ScalarMoreThan,"MORE_THAN_SCALAR")
typedef FunctionOfVector<MoreThan> VectorMoreThan;
PLUMED_REGISTER_ACTION(VectorMoreThan,"MORE_THAN_VECTOR")
typedef FunctionOfMatrix<MoreThan> MatrixMoreThan;
Expand Down
2 changes: 1 addition & 1 deletion src/generic/Constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ PRINT ARG=c1,c2,c3,c4,c5 FILE=five_scalars
Lastly, if you want to create a constant $2\times 3$ matrix you would use an input like the one below:
```plumed
c: CONSTANT VALUE=1,2,3,4,5,6 NROWS=2 NCOLS=3
c: CONSTANT VALUES=1,2,3,4,5,6 NROWS=2 NCOLS=3
PRINT ARG=c FILE=matrix
```
Expand Down
4 changes: 2 additions & 2 deletions src/generic/DumpAtoms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ You can also enforce the output file type by using the `TYPE` keyword as shown b
```plumed
c1: COM ATOMS=11-20
DUMPATOMS STRIDE=10 FILE=file.xyz ATOMS=1-10,c1 UNITS=A TYPE=gro
DUMPATOMS STRIDE=10 FILE=file.xyz ATOMS=1-10,c1 TYPE=gro
FLUSH STRIDE=1
```
Expand All @@ -120,7 +120,7 @@ your input file as shown below:
```plumed
#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
# this is required to have proper atom names:
MOLINFO STRUCTURE=regtest/basic/rt32/reference.pdb
MOLINFO STRUCTURE=regtest/basic/rt32/helix.pdb
# if omitted, atoms will have "X" name...
c1: COM ATOMS=11-20
Expand Down
2 changes: 2 additions & 0 deletions src/generic/GatherReplicas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ working the vectors of values. You then use this action to average over replica
example shown below.
```plumed
#SETTINGS NREPLICAS=2
# Calculate distance between atoms 1 and 2 on for all 2 replicas
d: DISTANCE ATOMS=1,2
# Now gather the values of this distance on all the replicas:
Expand All @@ -55,6 +56,7 @@ PRINT ARG=s FILE=colvar
Now suppose that we wanted to calculate a time average of the distance and an average over the replicas. We could use an input like this:
```plumed
#SETTINGS NREPLICAS=2
d: DISTANCE ATOMS=1,2
g: GATHER_REPLICAS ARG=d
s: COMBINE ARG=g.rep-0,g.rep-1 COEFFICIENTS=0.5,0.5 PERIODIC=NO
Expand Down
2 changes: 1 addition & 1 deletion src/generic/MassChargeInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The first column of numbers is a numerical index, the second column is the masse
You can read masses and charges from a PDB file instead by using an input like the one shown below:
```plumed
#SETTINGS INPUTFILES=regtest/basic/rt-readmasscharge/test.pdb
#SETTINGS NATOMS=108 INPUTFILES=regtest/basic/rt-readmasscharge/test.pdb
mq: READMASSCHARGE PDBFILE=regtest/basic/rt-readmasscharge/test.pdb
```
Expand Down
9 changes: 5 additions & 4 deletions src/generic/MolInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ are in the backbone of a protein to the [ALPHARMSD](ALPHARMSD.md) action is show
```plumed
#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
MOLINFO STRUCTURE=reference.pdb
MOLINFO STRUCTURE=regtest/basic/rt32/helix.pdb
ALPHARMSD RESIDUES=all TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12} LABEL=a
```
Expand All @@ -42,7 +42,7 @@ in a GC Watson-Crick pair.
```plumed
#SETTINGS MOLFILE=regtest/basic/rt-ermsd/ref.pdb
MOLINFO STRUCTURE=reference.pdb MOLTYPE=dna
MOLINFO STRUCTURE=regtest/basic/rt-ermsd/ref.pdb MOLTYPE=dna
hb1: DISTANCE ATOMS=@N2-2,@O2-15
hb2: DISTANCE ATOMS=@N1-2,@N3-15
hb3: DISTANCE ATOMS=@O6-2,@N4-15
Expand All @@ -53,7 +53,7 @@ The last example shows you how you can use MOLINFO to calculate torsion angles
```plumed
#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
MOLINFO MOLTYPE=protein STRUCTURE=myprotein.pdb
MOLINFO MOLTYPE=protein STRUCTURE=regtest/basic/rt32/helix.pdb
t1: TORSION ATOMS=@phi-3
t2: TORSION ATOMS=@psi-4
PRINT ARG=t1,t2 FILE=colvar STRIDE=10
Expand Down Expand Up @@ -205,7 +205,8 @@ Finally, notice that some shortcuts are available even when you not using the MO
Since PLUMED 2.6 it is possible to use the expressive selection syntax of [mdtraj](http://mdtraj.org/latest/atom_selection.html) and/or [MDAnalysis](https://www.mdanalysis.org/docs/documentation_pages/selections.html):
```plumed
MOLINFO STRUCTURE=helix.pdb PYTHON_BIN=python
#SETTINGS MOLFILE=regtest/basic/rt32/helix.pdb
MOLINFO STRUCTURE=regtest/basic/rt32/helix.pdb PYTHON_BIN=python
g1: GROUP ATOMS=@mda:backbone
g2: GROUP ATOMS={@mda:{resnum 1 or resid 3:5}}
#g3: GROUP ATOMS={@mda:{resid 3:5} @mda:{resnum 1}}
Expand Down
2 changes: 1 addition & 1 deletion src/generic/Ones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The following input creates and outputs a constant vector with 10 elements that
```plumed
ones: ONES SIZE=10
PRINT ARG=ones FILES=onesfile
PRINT ARG=ones FILE=onesfile
```
Notice that the ONES action is a shortcut to [CONSTANT](CONSTANT.md).
Expand Down
10 changes: 5 additions & 5 deletions src/generic/PDB2Constant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The following example illustrates how this action can be used to read a set of r
```plumed
#SETTINGS INPUTFILES=regtest/basic/rt19/test0.pdb
ref: PDB2CONSTANT FILE=regtest/basic/rt19/test0.pdb
ref: PDB2CONSTANT REFERENCE=regtest/basic/rt19/test0.pdb
```
You can see how the reference positions are converted to [CONSTANT](CONSTANT.md) action that outputs a vector by expanding the shortcut.
Expand All @@ -52,7 +52,7 @@ You can also use this command to read in multiple reference positions as illustr
```plumed
#SETTINGS INPUTFILES=regtest/mapping/rt-pathtools-3/all.pdb
ref: PDB2CONSTANT FILE=regtest/mapping/rt-pathtools-3/all.pdb
ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-3/all.pdb
```
The [CONSTANT](CONSTANT.md) that is created by this action is a matrix. Each row of the output matrix contains one set of reference positions.
Expand All @@ -61,7 +61,7 @@ keyword to specify the particular configuration that you would like to read in a
```plumed
#SETTINGS INPUTFILES=regtest/mapping/rt-pathtools-3/all.pdb
ref: PDB2CONSTANT FILE=regtest/mapping/rt-pathtools-3/all.pdb NUMBER=4
ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-3/all.pdb NUMBER=4
```
The input above will reads in the fourth configuration in the input PDB file only.
Expand Down Expand Up @@ -123,8 +123,8 @@ You can read in these reference values by using the PDB2CONSTANT command as foll
```plumed
#SETTINGS INPUTFILES=regtest/mapping/rt-pathtools-4/epath.pdb
t1_ref: PDB2CONSTANT FILE=regtest/mapping/rt-pathtools-4/epath.pdb ARG=t1
t2_ref: PDB2CONSTANT FILE=regtest/mapping/rt-pathtools-4/epath.pdb ARG=t2
t1_ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-4/epath.pdb ARG=t1
t2_ref: PDB2CONSTANT REFERENCE=regtest/mapping/rt-pathtools-4/epath.pdb ARG=t2
```
Notice that separate PDB2CONSTANT commands are required for reading in `t1` and `t2`. Furthermore, because the
Expand Down
14 changes: 2 additions & 12 deletions src/generic/ResetCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,14 @@ arbitrary.
Reset cell to be triangular after a rototranslational fit
```plumed
#SETTINGS INPUTFILES=regtest/basic/rt63/align.pdb
DUMPATOMS FILE=dump-original.xyz ATOMS=1-20
FIT_TO_TEMPLATE STRIDE=1 REFERENCE=ref.pdb TYPE=OPTIMAL
FIT_TO_TEMPLATE STRIDE=1 REFERENCE=regtest/basic/rt63/align.pdb TYPE=OPTIMAL
DUMPATOMS FILE=dump-fit.xyz ATOMS=1-20
RESET_CELL TYPE=TRIANGULAR
DUMPATOMS FILE=dump-reset.xyz ATOMS=1-20
```
The reference file for the FIT_TO_TEMPLATE is just a normal pdb file with the format shown below:
\auxfile{ref.pdb}
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
END
\endauxfile
*/
//+ENDPLUMEDOC

Expand Down
2 changes: 1 addition & 1 deletion src/multicolvar/DumpMultiColvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This action has been depracated as the same result can be be achieved using [DUM
at the expanded version of the shortct in the example input below:
```plumed
c1: COORDINATION SPECIES=1-100 SWITCH={RATIONAL R_0=0.1}
c1: COORDINATIONNUMBER SPECIES=1-100 SWITCH={RATIONAL R_0=0.1}
DUMPMULTICOLVAR DATA=dd FILE=coords.xyz
```
Expand Down

1 comment on commit b482245

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/CLASSICAL_MDS.tmp
Found broken examples in automatic/CONVERT_TO_FES.tmp
Found broken examples in automatic/COORDINATIONNUMBER.tmp
Found broken examples in automatic/DISTANCE_FROM_CONTOUR.tmp
Found broken examples in automatic/DUMPCUBE.tmp
Found broken examples in automatic/DUMPGRID.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/FIND_CONTOUR.tmp
Found broken examples in automatic/FIND_CONTOUR_SURFACE.tmp
Found broken examples in automatic/FIND_SPHERICAL_CONTOUR.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GPROPERTYMAP.tmp
Found broken examples in automatic/HISTOGRAM.tmp
Found broken examples in automatic/INTERPOLATE_GRID.tmp
Found broken examples in automatic/LOCAL_AVERAGE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/METATENSOR.tmp
Found broken examples in automatic/MULTICOLVARDENS.tmp
Found broken examples in automatic/PCA.tmp
Found broken examples in automatic/PCAVARS.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PYCVINTERFACE.tmp
Found broken examples in automatic/PYTHONFUNCTION.tmp
Found broken examples in automatic/Q3.tmp
Found broken examples in automatic/Q4.tmp
Found broken examples in automatic/Q6.tmp
Found broken examples in automatic/QUATERNION.tmp
Found broken examples in automatic/REWEIGHT_BIAS.tmp
Found broken examples in automatic/REWEIGHT_METAD.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_LINEAR_PROJ.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_MAHA_DIST.tmp
Found broken examples in AnalysisPP.md
Found broken examples in CollectiveVariablesPP.md
Found broken examples in MiscelaneousPP.md

Please sign in to comment.