1GMX-TRJCONV(1) GROMACS GMX-TRJCONV(1)
2
3
4
6 gmx-trjconv - Convert and manipulates trajectory files
7
9 gmx trjconv [-f [<.xtc/.trr/...>]] [-s [<.tpr/.gro/...>]] [-n [<.ndx>]]
10 [-fr [<.ndx>]] [-sub [<.ndx>]] [-drop [<.xvg>]]
11 [-o [<.xtc/.trr/...>]] [-b <time>] [-e <time>]
12 [-tu <enum>] [-[no]w] [-xvg <enum>] [-skip <int>]
13 [-dt <time>] [-[no]round] [-dump <time>] [-t0 <time>]
14 [-timestep <time>] [-pbc <enum>] [-ur <enum>]
15 [-[no]center] [-boxcenter <enum>] [-box <vector>]
16 [-trans <vector>] [-shift <vector>] [-fit <enum>]
17 [-ndec <int>] [-[no]vel] [-[no]force] [-trunc <time>]
18 [-exec <string>] [-split <time>] [-[no]sep]
19 [-nzero <int>] [-dropunder <real>] [-dropover <real>]
20 [-[no]conect]
21
23 gmx trjconv can convert trajectory files in many ways:
24
25 • from one format to another
26
27 • select a subset of atoms
28
29 • change the periodicity representation
30
31 • keep multimeric molecules together
32
33 • center atoms in the box
34
35 • fit atoms to reference structure
36
37 • reduce the number of frames
38
39 • change the timestamps of the frames (-t0 and -timestep)
40
41 • select frames within a certain range of a quantity given in an .xvg
42 file.
43
44 The option to write subtrajectories (-sub) based on the information ob‐
45 tained from cluster analysis has been removed from gmx trjconv and is
46 now part of [gmx extract-cluster]
47
48 gmx trjcat is better suited for concatenating multiple trajectory
49 files.
50
51 The following formats are supported for input and output: .xtc, .trr,
52 .gro, .g96, .pdb and .tng. The file formats are detected from the file
53 extension. The precision of the .xtc output is taken from the input
54 file for .xtc, .gro and .pdb, and from the -ndec option for other input
55 formats. The precision is always taken from -ndec, when this option is
56 set. All other formats have fixed precision. .trr output can be single
57 or double precision, depending on the precision of the gmx trjconv bi‐
58 nary. Note that velocities are only supported in .trr, .tng, .gro and
59 .g96 files.
60
61 Option -sep can be used to write every frame to a separate .gro, .g96
62 or .pdb file. By default, all frames all written to one file. .pdb
63 files with all frames concatenated can be viewed with rasmol -nmrpdb.
64
65 It is possible to select part of your trajectory and write it out to a
66 new trajectory file in order to save disk space, e.g. for leaving out
67 the water from a trajectory of a protein in water. ALWAYS put the
68 original trajectory on tape! We recommend to use the portable .xtc
69 format for your analysis to save disk space and to have portable files.
70 When writing .tng output the file will contain one molecule type of the
71 correct count if the selection name matches the molecule name and the
72 selected atoms match all atoms of that molecule. Otherwise the whole
73 selection will be treated as one single molecule containing all the se‐
74 lected atoms.
75
76 There are two options for fitting the trajectory to a reference either
77 for essential dynamics analysis, etc. The first option is just plain
78 fitting to a reference structure in the structure file. The second op‐
79 tion is a progressive fit in which the first timeframe is fitted to the
80 reference structure in the structure file to obtain and each subsequent
81 timeframe is fitted to the previously fitted structure. This way a con‐
82 tinuous trajectory is generated, which might not be the case when using
83 the regular fit method, e.g. when your protein undergoes large confor‐
84 mational transitions.
85
86 Option -pbc sets the type of periodic boundary condition treatment:
87
88 • mol puts the center of mass of molecules in the box, and requires
89 a run input file to be supplied with -s.
90
91 • res puts the center of mass of residues in the box.
92
93 • atom puts all the atoms in the box.
94
95 • nojump checks if atoms jump across the box and then puts them
96 back. This has the effect that all molecules will remain whole
97 (provided they were whole in the initial conformation). Note that
98 this ensures a continuous trajectory but molecules may diffuse out
99 of the box. The starting configuration for this procedure is taken
100 from the structure file, if one is supplied, otherwise it is the
101 first frame.
102
103 • cluster clusters all the atoms in the selected index such that
104 they are all closest to the center of mass of the cluster, which
105 is iteratively updated. Note that this will only give meaningful
106 results if you in fact have a cluster. Luckily that can be checked
107 afterwards using a trajectory viewer. Note also that if your mole‐
108 cules are broken this will not work either.
109
110 • whole only makes broken molecules whole.
111
112 Option -ur sets the unit cell representation for options mol, res and
113 atom of -pbc. All three options give different results for triclinic
114 boxes and identical results for rectangular boxes. rect is the ordi‐
115 nary brick shape. tric is the triclinic unit cell. compact puts all
116 atoms at the closest distance from the center of the box. This can be
117 useful for visualizing e.g. truncated octahedra or rhombic dodecahedra.
118 The center for options tric and compact is tric (see below), unless the
119 option -boxcenter is set differently.
120
121 Option -center centers the system in the box. The user can select the
122 group which is used to determine the geometrical center. Option -box‐
123 center sets the location of the center of the box for options -pbc and
124 -center. The center options are: tric: half of the sum of the box vec‐
125 tors, rect: half of the box diagonal, zero: zero. Use option -pbc mol
126 in addition to -center when you want all molecules in the box after the
127 centering.
128
129 Option -box sets the size of the new box. This option only works for
130 leading dimensions and is thus generally only useful for rectangular
131 boxes. If you want to modify only some of the dimensions, e.g. when
132 reading from a trajectory, you can use -1 for those dimensions that
133 should stay the same It is not always possible to use combinations of
134 -pbc, -fit, -ur and -center to do exactly what you want in one call to
135 gmx trjconv. Consider using multiple calls, and check out the GROMACS
136 website for suggestions.
137
138 With -dt, it is possible to reduce the number of frames in the output.
139 This option relies on the accuracy of the times in your input trajec‐
140 tory, so if these are inaccurate use the -timestep option to modify the
141 time (this can be done simultaneously). For making smooth movies, the
142 program gmx filter can reduce the number of frames while using low-pass
143 frequency filtering, this reduces aliasing of high frequency motions.
144
145 Using -trunc gmx trjconv can truncate .trr in place, i.e. without
146 copying the file. This is useful when a run has crashed during disk I/O
147 (i.e. full disk), or when two contiguous trajectories must be concate‐
148 nated without having double frames.
149
150 Option -dump can be used to extract a frame at or near one specific
151 time from your trajectory. If the frames in the trajectory are not in
152 temporal order, the result is unspecified.
153
154 Option -drop reads an .xvg file with times and values. When options
155 -dropunder and/or -dropover are set, frames with a value below and
156 above the value of the respective options will not be written.
157
159 Options to specify input files:
160
161 -f [<.xtc/.trr/...>] (traj.xtc)
162 Trajectory: xtc trr cpt gro g96 pdb tng
163
164 -s [<.tpr/.gro/...>] (topol.tpr) (Optional)
165 Structure+mass(db): tpr gro g96 pdb brk ent
166
167 -n [<.ndx>] (index.ndx) (Optional)
168 Index file
169
170 -fr [<.ndx>] (frames.ndx) (Optional)
171 Index file
172
173 -sub [<.ndx>] (cluster.ndx) (Optional)
174 Index file
175
176 -drop [<.xvg>] (drop.xvg) (Optional)
177 xvgr/xmgr file
178
179 Options to specify output files:
180
181 -o [<.xtc/.trr/...>] (trajout.xtc)
182 Trajectory: xtc trr gro g96 pdb tng
183
184 Other options:
185
186 -b <time> (0)
187 Time of first frame to read from trajectory (default unit ps)
188
189 -e <time> (0)
190 Time of last frame to read from trajectory (default unit ps)
191
192 -tu <enum> (ps)
193 Unit for time values: fs, ps, ns, us, ms, s
194
195 -[no]w (no)
196 View output .xvg, .xpm, .eps and .pdb files
197
198 -xvg <enum> (xmgrace)
199 xvg plot formatting: xmgrace, xmgr, none
200
201 -skip <int> (1)
202 Only write every nr-th frame
203
204 -dt <time> (0)
205 Only write frame when t MOD dt = first time (ps)
206
207 -[no]round (no)
208 Round measurements to nearest picosecond
209
210 -dump <time> (-1)
211 Dump frame nearest specified time (ps)
212
213 -t0 <time> (0)
214 Starting time (ps) (default: don't change)
215
216 -timestep <time> (0)
217 Change time step between input frames (ps)
218
219 -pbc <enum> (none)
220 PBC treatment (see help text for full description): none, mol,
221 res, atom, nojump, cluster, whole
222
223 -ur <enum> (rect)
224 Unit-cell representation: rect, tric, compact
225
226 -[no]center (no)
227 Center atoms in box
228
229 -boxcenter <enum> (tric)
230 Center for -pbc and -center: tric, rect, zero
231
232 -box <vector> (0 0 0)
233 Size for new cubic box (default: read from input)
234
235 -trans <vector> (0 0 0)
236 All coordinates will be translated by trans. This can advanta‐
237 geously be combined with -pbc mol -ur compact.
238
239 -shift <vector> (0 0 0)
240 All coordinates will be shifted by framenr*shift
241
242 -fit <enum> (none)
243 Fit molecule to ref structure in the structure file: none,
244 rot+trans, rotxy+transxy, translation, transxy, progressive
245
246 -ndec <int> (3)
247 Number of decimal places to write to .xtc output
248
249 -[no]vel (yes)
250 Read and write velocities if possible
251
252 -[no]force (no)
253 Read and write forces if possible
254
255 -trunc <time> (-1)
256 Truncate input trajectory file after this time (ps)
257
258 -exec <string>
259 Execute command for every output frame with the frame number as
260 argument
261
262 -split <time> (0)
263 Start writing new file when t MOD split = first time (ps)
264
265 -[no]sep (no)
266 Write each frame to a separate .gro, .g96 or .pdb file
267
268 -nzero <int> (0)
269 If the -sep flag is set, use these many digits for the file num‐
270 bers and prepend zeros as needed
271
272 -dropunder <real> (0)
273 Drop all frames below this value
274
275 -dropover <real> (0)
276 Drop all frames above this value
277
278 -[no]conect (no)
279 Add CONECT PDB records when writing .pdb files. Useful for visu‐
280 alization of non-standard molecules, e.g. coarse grained ones
281
283 gmx(1)
284
285 More information about GROMACS is available at <‐
286 http://www.gromacs.org/>.
287
289 2022, GROMACS development team
290
291
292
293
2942022.2 Jun 16, 2022 GMX-TRJCONV(1)