File: mdconvert.rst

package info (click to toggle)
mdtraj 1.11.1.post1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 79,424 kB
  • sloc: python: 25,486; ansic: 6,266; cpp: 5,685; xml: 1,252; makefile: 207; sh: 22
file content (73 lines) | stat: -rw-r--r-- 3,747 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
``mdconvert`` (``mdconvert-mdtraj``)
=============

``mdconvert`` is a command-line script installed with MDTraj to convert
molecular dynamics trajectories between formats. The DCD, XTC, TRR,
NetCDF, and HDF5 formats are supported (.xtc, .nc, .trr, .h5,
.pdb, .dcd). ``mdconvert`` is memory-efficient, and processes
trajectories in a chunked, streaming fashion. It is capable of converting
trajectory files which cannot be fully loaded into memory. It can also
concatenate trajectories, convert only a subset of the atoms in a trajectory
(i.e. strip solvent molecules), and down-sample trajectories by extract only a
subset of the frames.

On Debian systems ``mdconvert`` has been renamed to ``mdconvert-mdtraj``.

After installing the library, it should be in your  ``$PATH``. You can check
this from the command line with this command. ::

  $ which mdconvert-mdtraj


Here's the ``mdconvert`` (``mdconvert-mdtraj``) help text. ::

  $ mdconvert-mdtraj -h
  usage: mdconvert-mdtraj [-h] -o OUTPUT [-c CHUNK] [-f] [-s STRIDE] [-i INDEX]
                   [-a ATOM_INDICES] [-t TOPOLOGY]
                   input [input ...]

  Convert molecular dynamics trajectories between formats. The DCD, XTC, TRR,
  NetCDF, and HDF5 formats are supported (.xtc, .nc, .trr, .h5,
  .pdb, .dcd)

  positional arguments:
    input                 path to one or more trajectory files. Multiple
                          trajectories, if supplied, will be concatenated
                          together in the output file in the order supplied. all
                          of the trajectories should be in the same format. the
                          format will be detected based on the file extension

  required arguments:
    -o OUTPUT, --output OUTPUT
                          path to the save the output. the output format will
                          chosen based on the file extension (.xtc, .nc, .trr,
                          .h5, .pdb, .dcd)

  optional arguments:
    -h, --help            show this help message and exit
    -c CHUNK, --chunk CHUNK
                          number of frames to read in at once. this determines
                          the memory requirements of this code. default=1000
    -f, --force           force overwrite if output already exsits
    -s STRIDE, --stride STRIDE
                          load only every stride-th frame from the input
                          file(s), to subsample.
    -i INDEX, --index INDEX
                          load a *specific* set of frames. flexible, but
                          inefficient for a large trajectory. specify your
                          selection using (pythonic) "slice notation" e.g. '-i
                          N' to load the the Nth frame, '-i -1' will load the
                          last frame, '-i N:M to load frames N to M, etc. see
                          http://bit.ly/143kloq for details on the notation
    -a ATOM_INDICES, --atom_indices ATOM_INDICES
                          load only specific atoms from the input file(s).
                          provide a path to file containing a space, tab or
                          newline separated list of the (zero-based) integer
                          indices corresponding to the atoms you wish to keep.
    -t TOPOLOGY, --topology TOPOLOGY
                          path to a PDB file. this will be used to parse the
                          topology of the system. it's optional, but useful. if
                          specified, it enables you to output the coordinates of
                          your dcd/xtc/trr/netcdf as a PDB file. If
                          you're converting *to* .h5, the topology will be
                          stored inside the h5 file.