script_template

Script template for scripts that process MD trajectories.

Deprecated since version 1.6.0: Example deprecation warning. scripts.script_template will be removed in MDTools 2.0.0. It is replaced by scripts.script_template_new, because the latter has additional functionality xyz.

Todo

  • Example todo list.

  • Implement feature xyz.

The following is a guide/template on how to write a docstring for a MDTools script. For more information see the Developer’s guide and the NumPy docstring convention.

The first part of the docstring should contain the following paragraphs (all separated by a blank line):

  1. One-sentence summary (preferably one line only).

  2. Potential deprecation warning.

  3. Potential todo list.

  4. Extended summary clarifying functionality, not implementation details or background theory (this goes in the Notes section).

Note that you will have to repeat parts of the docstring (especially the summary and a potentially abbreviated version of the Options section) when implementing the command-line interface with argparse.

Options

An reStructuredText option list listing all options with which the script can/must be called and their meaning.

-f

Trajectory file. See supported coordinate formats of MDAnalysis.

-s

Topology file. See supported topology formats of MDAnalysis.

-o

Output filename.

-b

First frame to read from the trajectory. Frame numbering starts at zero. Default: 0.

-e

Last frame to read from the trajectory. This is exclusive, i.e. the last frame read is actually END - 1. A value of -1 means to read the very last frame. Default: -1.

--every

Read every n-th frame from the trajectory. Default: 1.

--sel

Selection string to select a group of atoms for the analysis. See MDAnalysis’ selection syntax for possible choices.

--cmp

{‘group’, ‘segments’, ‘residues’, ‘molecules’, ‘fragments’, ‘atoms’}

The compounds of the selection group to use for the analysis. Compounds can be ‘group’ (the entire selection group), ‘segments’, ‘residues’, ‘molecules’, ‘fragments’, or ‘atoms’. Refer to the MDAnalysis’ user guide for an explanation of these terms. Note that in any case, even if CMP is e.g. ‘residues’, only the atoms belonging to the selection group are taken into account, even if the compound might comprise additional atoms that are not contained in the selection group. Default: 'atoms'.

--center

{‘cog’, ‘com’, ‘coc’}

The center of the compounds to use for the analysis.

  • 'cog': Center of geometry

  • 'com': Center of mass

  • 'coc': Center of charge

Note that MDAnalysis always guesses atom masses from the atom types, even if the input file contains the masses. Default: 'cog'.

--debug

Run in debug mode.

Output

Optional section containing for example a list of files which are created by the script.

Outfile1 (-o).txt

A text file containing abc.

Outfile2 (--dtrj-out): .npz

A compressed .npz archive containing a binary NumPy .npy file called dtrj.npy that holds the discrete trajectory. The discrete trajectory is stored as numpy.ndarray of dtype numpy.uint32 and shape (n, f), where n is the number of reference compounds and f is the number of frames. The elements of the discrete trajectory are the states in which a given compound resides at a given frame.

See also

scripts.templates.script_template_dtrj

Script template for scripts that process discrete trajectories

scripts.templates.script_template_plot

Script template for scripts that create plots

some_function()

A function that is not defined in this script, but which helps understanding the script’s output or what the script does

Notes

Implementation details and background theory, i.e. a detailed description of the scientific problem which is solved by the script and particularly how it is solved.[1]

References

Examples

At least one particular use case of the script, optimally with a graph demonstrating how the generated data can be visualized.