Skip to content

Commit

Permalink
Support TPR files produced by gromacs 2023 (MDAnalysis#4052)
Browse files Browse the repository at this point in the history
* Add test TPR files for gromacs 2023

* Allow tpx version 129

These files are produced by gromacs 2023. Note that we only allow the
tpx version here. We do not implement any of the changes to the tpr
format.

* Update changelog to account for TPR 129

* Update the documentation to account for tpx 129
  • Loading branch information
jbarnoud authored Mar 2, 2023
1 parent 6fc901f commit 79e0c86
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The rules for this file:
------------------------------------------------------------------------------

??/??/?? IAlibay, pgbarletta, mglagolev, hmacdope, manuel.nuno.melo, chrispfae,
ooprathamm, MeetB7, BFedder, v-parmar, MoSchaeffler
ooprathamm, MeetB7, BFedder, v-parmar, MoSchaeffler, jbarnoud
* 2.5.0

Fixes
Expand All @@ -28,6 +28,7 @@ Fixes
(Issue #3336)

Enhancements
* Add support for TPR files produced by Gromacs 2023 (Issue #4047)
* Add distopia distance calculation library bindings as a selectable backend
for `calc_bonds` in `MDA.lib.distances`. (Issue #3783, PR #3914)
* AuxReaders are now pickle-able and copy-able (Issue #1785, PR #3887)
Expand Down
1 change: 1 addition & 0 deletions package/MDAnalysis/topology/TPRParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
119 27 2020[*]_ yes
122 28 2021 yes
127 28 2022 yes
129 28 2023 yes
========== ============== ==================== =====
.. [*] Files generated by the beta versions of Gromacs 2020 are NOT supported.
Expand Down
2 changes: 1 addition & 1 deletion package/MDAnalysis/topology/tpr/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"""

#: Gromacs TPR file format versions that can be read by the TPRParser.
SUPPORTED_VERSIONS = (58, 73, 83, 100, 103, 110, 112, 116, 119, 122, 127)
SUPPORTED_VERSIONS = (58, 73, 83, 100, 103, 110, 112, 116, 119, 122, 127, 129)

# Some constants
STRLEN = 4096
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 6 additions & 2 deletions testsuite/MDAnalysisTests/datafiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@
"TPR450", "TPR451", "TPR452", "TPR453", "TPR454", "TPR455", "TPR455Double",
"TPR460", "TPR461", "TPR502", "TPR504", "TPR505", "TPR510", "TPR2016",
"TPR2018", "TPR2019B3", "TPR2020B2", "TPR2020", "TPR2020Double",
"TPR2021", "TPR2021Double", "TPR2022RC1",
"TPR2021", "TPR2021Double", "TPR2022RC1", "TPR2023",
"TPR510_bonded", "TPR2016_bonded", "TPR2018_bonded", "TPR2019B3_bonded",
"TPR2020B2_bonded", "TPR2020_bonded", "TPR2020_double_bonded",
"TPR2021_bonded", "TPR2021_double_bonded", "TPR2022RC1_bonded",
"TPR334_bonded",
"TPR334_bonded", "TPR2023_bonded",
"TPR_EXTRA_2021", "TPR_EXTRA_2020", "TPR_EXTRA_2018",
"TPR_EXTRA_2016", "TPR_EXTRA_407", "TPR_EXTRA_2022RC1",
"TPR_EXTRA_2023",
"PDB_sub_sol", "PDB_sub_dry", # TRRReader sub selection
"TRR_sub_sol",
"XTC_sub_sol",
Expand Down Expand Up @@ -383,6 +384,7 @@
TPR2020 = resource_filename(__name__, 'data/tprs/2lyz_gmx_2020.tpr')
TPR2021 = resource_filename(__name__, 'data/tprs/2lyz_gmx_2021.tpr')
TPR2022RC1 = resource_filename(__name__, 'data/tprs/2lyz_gmx_2022-rc1.tpr')
TPR2023 = resource_filename(__name__, 'data/tprs/2lyz_gmx_2023.tpr')
# double precision
TPR455Double = resource_filename(__name__, 'data/tprs/drew_gmx_4.5.5.double.tpr')
TPR460 = resource_filename(__name__, 'data/tprs/ab42_gmx_4.6.tpr')
Expand All @@ -401,7 +403,9 @@
TPR2021_bonded = resource_filename(__name__, 'data/tprs/all_bonded/dummy_2021.tpr')
TPR2021_double_bonded = resource_filename(__name__, 'data/tprs/all_bonded/dummy_2021_double.tpr')
TPR2022RC1_bonded = resource_filename(__name__, 'data/tprs/all_bonded/dummy_2022-rc1.tpr')
TPR2023_bonded = resource_filename(__name__, 'data/tprs/all_bonded/dummy_2023.tpr')
# all interactions
TPR_EXTRA_2023 = resource_filename(__name__, 'data/tprs/virtual_sites/extra-interactions-2023.tpr')
TPR_EXTRA_2022RC1 = resource_filename(__name__, 'data/tprs/virtual_sites/extra-interactions-2022-rc1.tpr')
TPR_EXTRA_2021 = resource_filename(__name__, 'data/tprs/virtual_sites/extra-interactions-2021.tpr')
TPR_EXTRA_2020 = resource_filename(__name__, 'data/tprs/virtual_sites/extra-interactions-2020.tpr')
Expand Down
10 changes: 7 additions & 3 deletions testsuite/MDAnalysisTests/topology/test_tprparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@
TPR450, TPR451, TPR452, TPR453, TPR454, TPR455, TPR455Double,
TPR460, TPR461, TPR502, TPR504, TPR505, TPR510, TPR510_bonded,
TPR2016, TPR2018, TPR2019B3, TPR2020B2, TPR2020, TPR2020Double,
TPR2021, TPR2021Double, TPR2022RC1,
TPR2021, TPR2021Double, TPR2022RC1, TPR2023,
TPR2016_bonded, TPR2018_bonded, TPR2019B3_bonded,
TPR2020B2_bonded, TPR2020_bonded, TPR2020_double_bonded,
TPR2021_bonded, TPR2021_double_bonded, TPR334_bonded,
TPR2022RC1_bonded,
TPR2022RC1_bonded, TPR2023_bonded,
TPR_EXTRA_2021, TPR_EXTRA_2020, TPR_EXTRA_2018,
TPR_EXTRA_2016, TPR_EXTRA_407, TPR_EXTRA_2022RC1,
TPR_EXTRA_2023,
XTC,
)
from MDAnalysisTests.topology.base import ParserBase
Expand All @@ -55,6 +56,8 @@
TPR2020_bonded,
TPR2020_double_bonded,
TPR2022RC1_bonded,
TPR2023_bonded,
TPR_EXTRA_2023,
TPR_EXTRA_2022RC1,
TPR_EXTRA_2021,
TPR_EXTRA_2020,
Expand Down Expand Up @@ -111,7 +114,7 @@ class TestTPRGromacsVersions(TPRAttrs):
TPR407, TPR450, TPR451, TPR452, TPR453, TPR454,
TPR455, TPR502, TPR504, TPR505, TPR510, TPR2016,
TPR2018, TPR2019B3, TPR2020, TPR2020Double,
TPR2021, TPR2021Double, TPR2022RC1])
TPR2021, TPR2021Double, TPR2022RC1, TPR2023,])
def filename(self, request):
return request.param

Expand Down Expand Up @@ -238,6 +241,7 @@ def test_all_impropers(topology, impr):
@pytest.fixture(params=(
TPR400, TPR402, TPR403, TPR404, TPR405, TPR406, TPR407, TPR450, TPR451,
TPR452, TPR453, TPR454, TPR502, TPR504, TPR505, TPR510, TPR2016, TPR2018,
TPR2023,
))
def bonds_water(request):
parser = MDAnalysis.topology.TPRParser.TPRParser(request.param).parse()
Expand Down

0 comments on commit 79e0c86

Please sign in to comment.