[gmx-users] Reading XTC files from fortran90

David van der Spoel spoel at xray.bmc.uu.se
Sun Sep 30 17:59:07 CEST 2007


Mark Abraham wrote:
> Jones de Andrade wrote:
>> Hi Tsjerk.
>>
>> Thanks for the prompt answer.
>>
>> Good idea, I can take the atom names from a .gro file, nad, probably 
>> some strange algorithm can also get the number of atoms per molecule 
>> and number of molecules from there, am I right? That would help a lot.
> 
> Simplest is to write a parser for a gmxdump of a .tpr file. This is what 
> Perl was made for. If you're constrained to use Fortran for your 
> analysis program, then developing an intermediate file format for it to 
> parse might be worthwhile.
> 
>> But: I'll still be unable to get atomic masses and point charges. No 
>> to mention the box shape. :( And I'll need a way to read these 
>> parameters too, unless I begin to write all them in a really awfull 
>> and strange index file.
>>
>>  From what I can understand on the "file logistics" of gromacs, these 
>> information are only stored in the whole ".top .itp .atp .rtp 
>> structure of files" or, in a condensed form, in the ".tpr" file. Is 
>> that right?
> 
> Yeah. Writing something to do the lookups in the .*tp files which grompp 
> does to form the .tpr is asking for trouble. Do the lookup in the .tpr 
> file. The .edr file has box dimensions, of course.
> 
> All this makes it sound like you should be dropping Fortran and writing 
> in C or Perl!
> 
the box is in the xtc file, if you need the atom names a corresponding 
pdb or gro file should do the trick. don't try to read tpr files or 
gmxdumps of it, that's a complete waste of time. you can e.g. use 
editconf to dump a pdb file with charges in the b-factor fields.

And indeed, using fortran will make your life quite miserable for these 
kind of things.

-- 
David van der Spoel, Ph.D.
Molec. Biophys. group, Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205. Fax: +4618511755.
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://folding.bmc.uu.se



More information about the gromacs.org_gmx-users mailing list