[gmx-users] Formatting of spacing in .top and .itp files

Justin Lemkul jalemkul at vt.edu
Thu Apr 12 20:13:59 CEST 2018



On 4/12/18 2:12 PM, Andrew DeYoung wrote:
> Hi,
>
> I am running Gromacs 4.5.5.  In that rather old version, there is a
> binary called g_x2top -- I think it is now called something else -- to
> generate "a primitive topology from a coordinate file."
>
> When I use g_x2top with my (custom) force field, g_x2top generates a
> nicely formatted topology file (either .top or .itp).  Here is a
> snippet from the nicely formatted topology (assuming you display the
> text in a fixed width font):
>
> [ dihedrals ]
> ;  ai    aj    ak    al funct            c0            c1
> c2            c3            c4            c5
>     81    97   113   129     1
>    112    97   113   114     1
>    112    97   113   129     1
>     82    98    99    83     1
>     82    98    99   115     1
>
> (Only atom indices and a function type are printed because I used the
> option -noparam in g_x2top.)
>
> But, what if I want to generate my own .top or .itp text file, using
> for example Fortran, Perl, or Python?  Are .top and .itp fixed-spaced
> file formats?  In other words, do I have to nicely align the columns
> as g_x2top does?  Or can I just use any number of spaces to delimit
> the columns, like in the following example?
>
> [ dihedrals ]
> 81 97 113 129 1
> 112 97 113 114 1
> 112 97 113 129 1
> 82 98 99 83 1
> 82 98 99 115 1
>
> I have tried this ugly formatting, and it seems to give the same
> results as the nice formatting.  But can anyone confirm that .top and
> .itp are NOT fixed-spaced file formats (unlike .pdb and .gro for
> example)?

GROMACS topologies are free format.

-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.thelemkullab.com

==================================================



More information about the gromacs.org_gmx-users mailing list