TNG API
1.8.0
A flexible binary trajectory format
|
The TNG format is developed as part of the ScalaLife EU project. It is flexible by design to allow parallel writing, custom data blocks, different output frequencies and different compression algorithms.
Each block can contain MD5 hashes to verify data integrity and the file can be signed by the user to ensure that the origin is correct.
The intention is that the API and ABI should be stable, but it is still possible that future changes might make that impossible, in which case that will be clarified.
The API and all examples are released without any warranties. Use them at your own risk.
The TNG trajectory format is developed by:
Magnus Lundborg magnu s.lu ndbor g@sc ilife lab. se
Daniel SpÄngberg danie ls@m kem.u u.se
Rossen Apostolov rosse n@kt h.se
The API is implemented mainly by:
Magnus Lundborg
Copyright (c) 2012, The GROMACS development team. check out http://www.gromacs.org for more information.
The TNG API is released under the Revised BSD License and is free to redistribute according to that license.
A license file (named COPYING) should be included with each copy of the API.
Test by running:
See git log for full revision history.
Revisions
v. 1.8 - Added GROMACS energy block IDs.
v. 1.7 - Fifth stable release of the API
- Added function tng_util_num_frames_with_data_of_block_id_get(). - Merged some functions and data structures to make less difference between data blocks. - Bugs fixed
v. 1.6 - Fourth stable release of the API.
- Removed OpenMP option when building. - Functionality for migrating data blocks. - Improved handling of molecules. - Improved installation of TNG documentation. - Enhancements to CMake usage. - Required CMake version raised to 2.8.8. - Bugs fixed.
v. 1.5 - Third stable release of the API.
- Fortran wrapper split into separate file - Added more block IDs. - Some new functions and utility functions added. - Improved compression precision settings. - Improved tests. - Make appending to file work better. - Modified CMake settings - Bugs fixed
v. 1.4 - Changed from LGPL to the Revised BSD License.
- More flexible support for digital signatures in header. - Block ID numbers changed.
v. 1.3 - Second stable release of the API.
- Added multiplication factor for coordinate units to general info. - Added time stamps and time per frame in frame sets. - High-level API functions added (not for managing molecules yet) - Added functions for reading data blocks into 1D arrays. - TNG compression added. - C++ interface added. - Avoid memory allocation if no data is submitted when adding data blocks. - Added function tng_num_frames_per_frame_set_set - Added data block IDs for charges, b-factors and occupancy. - GZIP compression added. - Fixed bug when updating MD5 hashes of data blocks. - Fixed bug in chain_name_of_particle_get(...) - Update frame set pointers properly. - Moved fortran wrapper from header file to source file. - Write sparse data in mdrun examples. - Fixed bugs related to reading and writing sparse data. - Fixed memory leak for non-trajectory particle data blocks. - Fixed bug when writing data blocks. - Fixed wrong values in dependency constants - Write box shape, partial charges and annotation data in tng_testing - Bug fixes in tng_testing (frame sets not written before)
v. 1.0 - First stable release of the API.
There are some examples of how to use the library located in src/tests/
The build directory contains an example_files directory, which in turn contains a very short example of a TNG file containing a few water molecules, a box shape description and positions in 10 frames.
It is also possible to run the bin/examples/md_openmp_util (see src/tests/md_openmp_util.c) testing program, which will save MD simulations output to a new file (saved in the example_files directory).
These files can be read using the bin/examples/tng_io_read_pos_util program.
Example writing data to a TNG file (just an excerpt):
Example reading positions from a TNG file:
The TNG library can be used from Fortran. It requires cray pointers, which are not part of the Fortran 77 standard, but available in most compilers.
To compile the fortran example -DTNG_BUILD_FORTRAN=ON needs to be specified when running cmake.