[gmx-developers] Help needed with tng_io library
magnus.lundborg at scilifelab.se
Thu Aug 7 12:37:28 CEST 2014
I'll look into this when I'm back from vacation next week.
On 7 Aug 2014 12:19, "Semen Esilevsky" <yesint4 at yahoo.com> wrote:
> Dear All,
> I'm currently trying to add support for tng files to my code and I
> realised that I can't understand the logic of the library at all. I'm
> definetely doing something wrong, but can't figure out a mistake.
> The tng code is got from the latest git. Test trajectory is generated by
> Gromacs 5.0.
> I can open the tng file and can extract, for example, position exponential
> correctly, but after that...
> Problem #1: getting number of frames.
> int64_t n1,n2;
> tng_num_frames_get(trj, &n1);
> tng_num_frame_sets_get(trj, &n2);
> This gets
> n1 = 10761
> n2 = 1086
> The correct number of frames is 1086.
> What on Earth is returned from tng_num_frames_get()?
> Problem #2: Reading past the end of file.
> stat = tng_util_particle_data_next_frame_read(trj, TNG_TRAJ_POSITIONS,
> &datatype, &frame,
> This function should return false when no more frames are available,
> right? It doesn't do this and reads forever returning garbage in values
> when called in a loop. stat is always true. How should I use it correctly
> to finish reading at the end of file?
> Also concerning the strange thing with the number of frames and frame sets
> - what it reads actually each time?
> Problem #3: tng_util_pos_read_range() behaves insane
> int n=0;
> bool stat = true;
> stat = tng_util_pos_read_range(trj,n,n, &ptr, &len);
> This always stops at n=10 (why?!), while the number of frames is 1086!
> What I'm doing wrong here?
> I've also tried VMD plugin from pre-release VMD 1.9.2. It is said that
> this plugin is contributed by Gromacs developers, so it should work in
> principle. It doesn't work because of the bug #2 - it reads forever beyond
> the end of file.
> The test tng file is here:
> Any help is appreciated!
> Gromacs Developers mailing list
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
> * For (un)subscribe requests visit
> or send a mail to gmx-developers-request at gromacs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gromacs.org_gmx-developers