From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Jul 31 2008 - 19:51:10 CDT

On Thu, 31 Jul 2008, Nicolas Bigaouette wrote:

NB> Haaaa.. I see ;)
NB>
NB> I chose .gro as the file format since I wanted a simple format. I do not
NB> know the types of atoms before iterating on them, so I need a file format
NB> where I can specify the atom/ion/electron.
NB>
NB> I only need positions as a function of time, with a non fixed number of

this is a second problem. for efficiency reasons, VMD assumes that
the number of atoms is always the same and that the ordering and
assignment stays the same as well.

we have somewhat of a workaround in:

http://www.ks.uiuc.edu/Research/vmd/plugins/multimolanim/

but that is not overly elegant. there are a bunch of other
workarounds, depending on what exactly you want to achieve
and what exactly the system is that you are working on.

NB> atoms. And ideally with units of Angstrom ;)
NB> Do you have a suggestion?

if you don't need residue names and box dimensions,
you can try xmol/xyz which is the simplest possible
format (in angstrom).

cheers,
   axel.

NB>
NB> Thank you
NB>
NB> Nicolas
NB>
NB>
NB> 2008/7/31 Axel Kohlmeyer <akohlmey_at_cmm.chem.upenn.edu>
NB>
NB> > On Thu, 31 Jul 2008, Nicolas Bigaouette wrote:
NB> >
NB> > NB> [...]
NB> > NB> But when I import them in VMD, the position are multiplied by 10, so it
NB> > is
NB> > NB> (0,2,2) instead of (0,0.2,0.2)
NB> >
NB> > NB> It did not happen with other file format (VTF). I checked the source,
NB> > and to
NB> > NB> my surprise there is a comment at the begining of Gromacs.h:
NB> > NB> * o gro_rec() assumes positions in .gro files are nanometers and
NB> > NB> * converts to angstroms, whereas they really could be any unit
NB> > NB> and a couple of lines later, there is a degine:
NB> > NB> #define ANGS_PER_NM 10
NB> >
NB> > NB> Why is it converting the file's value?? If the data file is wrong, then
NB> > I
NB> > NB> prefer changing it myself then having to hack VMD's code to remove the
NB> > NB> scaling factor. The file says 0.2, I want to see 0.2 in VMD.
NB> >
NB> > no!!!
NB> >
NB> > VMD's internal units are angstrom and Gromacs uses nanometers.
NB> > this is not wrong, but required for consistency. if you change
NB> > this scaling factor, all hell will break loose since nothing will
NB> > work anymore that handles molecular systems, _particularly_ real
NB> > gromacs output. if you want the same numbers in VMD than you write
NB> > to your files, use a file format that uses angstrom as internal units.
NB> >
NB> > cheers,
NB> > axel.
NB> >
NB> > NB> I did a patch to change that:
NB> > NB>
NB> > NB> --- plugins/molfile_plugin/src/Gromacs.h.orig 2008-07-31
NB> > NB> 19:26:41.000000000 -0400
NB> > NB> +++ plugins/molfile_plugin/src/Gromacs.h 2008-07-31
NB> > 19:27:11.000000000
NB> > NB> -0400
NB> > NB> @@ -96,8 +96,10 @@
NB> > NB> #define MAX_G96_LINE 500 // Maximum line length of .g96 files
NB> > NB> #define MAX_TRX_TITLE 80 // Maximum length of a title in .trX
NB> > NB> #define MAX_MDIO_TITLE 80 // Maximum supported title length
NB> > NB> -#define ANGS_PER_NM 10 // Unit conversion factor
NB> > NB> -#define ANGS2_PER_NM2 100 // Unit conversion factor
NB> > NB> +//#define ANGS_PER_NM 10 // Unit conversion factor
NB> > NB> +//#define ANGS2_PER_NM2 100 // Unit conversion factor
NB> > NB> +#define ANGS_PER_NM 1 // Unit conversion factor
NB> > NB> +#define ANGS2_PER_NM2 1 // Unit conversion factor
NB> > NB>
NB> > NB>
NB> > NB> // All the supported file types and their respective extensions
NB> > NB>
NB> >
NB> > --
NB> > =======================================================================
NB> > Axel Kohlmeyer akohlmey_at_cmm.chem.upenn.edu http://www.cmm.upenn.edu
NB> > Center for Molecular Modeling -- University of Pennsylvania
NB> > Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
NB> > tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
NB> > =======================================================================
NB> > If you make something idiot-proof, the universe creates a better idiot.
NB> >
NB>

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.