MDCONVERT(1)

πŸ’– MDCONVERT(1) πŸ’–

okay bestie, listen β€” this is mdconvert-mdtraj, a lil member of the MDTRAJ family, and it is literally your glowed-up little format-shifter for molecular dynamics trajectories. It lives in the User Commands section of the manual, so you know it's a real one. 🫢


✨ NAME ✨

mdconvert-mdtraj β€” bestie, it uses mdtraj to convert molecular dynamics trajectories between formats. that's the whole job. she's a converter. she converts. πŸ’…


🌸 DESCRIPTION 🌸

here's how you call her, in all her glory:

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

so what does she do? she converts molecular dynamics trajectories between formats, no cap. The DCD, XTC, TRR, PDB, binpos, NetCDF, binpos, LH5, and HDF5 formats are supported β€” that's (.dcd, .xtc, .trr, .binpos, .nc, .netcdf, .h5, .lh5, .pdb). yes, binpos is in there twice, and yes, we're keeping it exactly as written because that's what the manpage says. iconic behavior, honestly. πŸŽ€

πŸ¦‹ positional arguments πŸ¦‹

  • input β€” the path to one or more trajectory files. give her more than one and she'll concatenate them all together into the output file, in the exact order you supplied them. ⭐ important: all of the trajectories should be in the same format. the format gets detected based on the file extension. so like, don't be messy about it.

πŸ‘‘ required arguments πŸ‘‘

  • -o OUTPUT, --output OUTPUT β€” the path where you want to save the output. the output format gets chosen based on the file extension β€” one of (.dcd, .xtc, .trr, .binpos, .nc, .netcdf, .h5, .lh5, .pdb). you must give her this one. it's required. no output, no conversion, no vibes. 😭

πŸ’œ optional arguments πŸ’œ

  • -h, --help β€” show this help message and exit. the classic. the moment of clarity. πŸ™ˆ
  • -c CHUNK, --chunk CHUNK β€” how many frames to read in at once. this is literally what determines the memory requirements of this code. default is 1000. so if your laptop is fighting for its life, that's the knob, bestie. πŸ“
  • -f, --force β€” force overwrite if output already exsits. (that typo is hers, not mine, and we love her for it.) ⚠️ careful β€” this one just bulldozes over whatever's already there.
  • -s STRIDE, --stride STRIDE β€” load only every stride-th frame from the input file(s), to subsample. so -s 2 gives you every other frame, etc. great for when you want the highlight reel and not the whole director's cut. ✨
  • -i INDEX, --index INDEX β€” load a specific set of frames. it's flexible, but inefficient for a large trajectory β€” like, she will do it, but she will suffer. 😭 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. (again β€” the double "the the" and the missing closing quote in '-i N:M are hers. preserved. periodt. πŸ’…)
  • -a ATOM_INDICES, --atom_indices ATOM_INDICES β€” load only specific atoms from the input file(s). provide a path to a file containing a space, tab or newline separated list of the (zero-based) integer indices corresponding to the atoms you wish to keep. zero-based, bestie. do not forget. πŸ”₯
  • -t TOPOLOGY, --topology TOPOLOGY β€” path to a PDB/prmtop 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/binpos as a PDB file. and if you're converting to .h5, the topology will be stored inside the h5 file. so yeah, lowkey the glow-up option. 🧚

ok real talk though β€” watch your -i usage on big trajectories, the manpage straight up says it's inefficient, and the -f flag will overwrite without asking. protect your data, protect your peace. πŸ’–

this page is from the MDTRAJ manual, dated October 2020, and it's the MDCONVERT(1) entry. mwah, that's the whole page, bestie β€” go convert something gorgeous. πŸ’…βœ¨πŸ¦‹