The TPRParser module allows reading of a Gromacs portable run input file (a TPR file). At the moment, only atom information is read and used to build a minimal topology. Because the file format of the TPR file is changing rapidly, not all versions are currently supported. The known working versions and the approximate Gromacs release numbers are listed in the table TPR format versions.
TPX format | TPX generation | Gromacs release | read |
---|---|---|---|
?? | ?? | 3.3, 3.3.1 | no |
58 | 17 | 4.0, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.6, 4.0.7 | yes |
73 | 23 | 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.5.4, 4.5.5 | yes |
83 | 24 | 4.6, 4.6.1 | yes |
For further discussion and notes see Issue 2. Also add a comment to Issue 2 if a new or different TPR file format version should be supported.
The TPR reader is a pure-python implementation of a basic TPR parser. Currently the following sections of the topology are parsed:
Potential Bug: in the result of gmxdump, the “Proper Dih.:” section is actually a list of Improper Dih.
This tpr parser is written according to the following files
The function read_tpxheader() is based on the TPRReaderDevelopment notes. Functions with names starting with read_ or do_ are trying to be similar to those in gmxdump.c or tpxio.c, those with extract_ are new.
Wherever fver_err(fver) is used, it means the tpx version problem haven’t be resolved for those other than 58 and 73 (or gromacs version before 4.x)