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 is1000. 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 2gives 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:Mto load frames N to M, etc. seehttp://bit.ly/143kloqfor details on the notation. (again β the double "the the" and the missing closing quote in'-i N:Mare 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 yourdcd/xtc/trr/netcdf/binposas 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-iusage on big trajectories, the manpage straight up says it's inefficient, and the-fflag 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. π β¨π¦
π¦ where this page comes from
- debian bookworm: python3-mdtraj 1.9.7-6 Β· LGPL-2.1-or-later
- debian trixie: python3-mdtraj 1.10.3-2+b1 Β· LGPL-2.1-or-later
- ubuntu jammy: python3-mdtraj 1.9.7-3 Β· LGPL-2.1-or-later
- ubuntu noble: python3-mdtraj 1.9.9-1ubuntu2 Β· LGPL-2.1-or-later
- ubuntu questing: python3-mdtraj 1.10.3-2build1
- ubuntu resolute: python3-mdtraj 1.11.0-2build1 Β· LGPL-2.1-or-later
- ubuntu stonking: python3-mdtraj 1.11.1.post1-3 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms