[gmx-users] converting .xtc into .xyz

Oliver Beckstein obeckste at asu.edu
Sun Nov 5 18:35:59 CET 2017


> On Nov 5, 2017, at 10:13 AM, Justin Lemkul <jalemkul at vt.edu> wrote:
> 
> On 11/4/17 3:22 PM, Iman Ahmadabadi wrote:
>> Dear Users,
>> 
>> How could I convert .xtc (or .trr) file of output of a run frames into .xyz
>> format? my mean is to obtaining one .xyz file for whole frames that created
>> by run?
> 
> Use trjconv to convert to a plain-text trajectory format like .gro or .pdb and convert in whatever manner you can to .xyz (whatever that specification is, but it will require non-GROMACS programs or scripts to do).

Instead of writing your own script to do the conversion you could also use MDAnalysis https://mdanalysis.org and do the conversion from XTC/TRR to XYZ in Python:

-----

import MDAnalysis as mda

TPR = “system.tpr”
XTC = “md.xtc"

u = mda.Universe(TPR, XTC)
with mda.Writer(“md.xyz", n_atoms=u.atoms.n_atoms) as xyz:
   for ts in u.trajectory:
        xyz.write(ts)

-----

Please note that MDAnalysis is not Gromacs and people on this mailing list will not be able to help you with MDAnalysis. Instead ask on the MDAnalysis user list https://groups.google.com/forum/#!forum/mdnalysis-discussion for anything related to MDAnalysis. 

By the way, to my knowledge there is no strict definition of “the” XYZ format. MDAnalysis loosely follows the format that VMD recognizes as “XYZ”, see https://www.mdanalysis.org/docs/documentation_pages/coordinates/XYZ.html.

Oliver


> 
> -Justin
> 
> -- 
> ==================================================
> 
> Justin A. Lemkul, Ph.D.
> Assistant Professor
> Virginia Tech Department of Biochemistry
> 
> 303 Engel Hall
> 340 West Campus Dr.
> Blacksburg, VA 24061
> 
> jalemkul at vt.edu | (540) 231-3129
> http://www.biochem.vt.edu/people/faculty/JustinLemkul.html
> 
> ==================================================
> 

--
Oliver Beckstein, DPhil * oliver.beckstein at asu.edu
http://becksteinlab.physics.asu.edu/

Assistant Professor of Physics
Arizona State University
Center for Biological Physics and Department of Physics
Tempe, AZ 85287-1504
USA
	
Office: PSF 348
Phone: +1 (480) 727-9765
FAX: +1 (480) 965-4669

Department of Physics: https://physics.asu.edu/content/oliver-beckstein
Center for Biological Physics: https://cbp.asu.edu/content/oliver-beckstein



More information about the gromacs.org_gmx-users mailing list