Skip to content

Commit

Permalink
[test_nomenclature.Test_KLIFS_finder.test_finds_online] Deduplicate b…
Browse files Browse the repository at this point in the history
…onds when having read a pdb online before comparing (mdtraj/mdtraj#1849)
  • Loading branch information
gph82 committed Jun 6, 2024
1 parent aab374f commit 355248f
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/test_nomenclature.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,24 @@ def test_finds_online(self):
assert self.KLIFS_df.UniProtAC == "P31751"
assert self.KLIFS_df.kinase_ID == 2
assert self.KLIFS_df.structure_ID == 1904
assert self.KLIFS_df.PDB_geom == self.geom
try:
assert self.KLIFS_df.PDB_geom == self.geom
except AssertionError:
# Versions of mdtraj prior to 1.10.0 duplicated some bonds (https://github.com/mdtraj/mdtraj/pull/1849)
# when reading from pdb file (_KLIFS_finder <- _KLIFS_web_lookup <- _KLIFS_structure_ID2Trajectory).
# But py37 (which is currently supported by mdcioo)
# doesn't update to mdtraj 1.10.0, so we need to de-duplicate these bonds
# (only here and only for testing purposes) before comparing to the topology
# created by _read_excel_as_KDF <- _Spreadsheets2mdTrajectory <- from_dataframe
import sys
assert sys.version[0]==3 and sys.version[1]==7
_bonds = []
for b1 in self.KLIFS_df.PDB_geom.top._bonds:
if b1 not in _bonds:
_bonds.append(b1)
self.KLIFS_df.PDB_geom.top._bonds = _bonds
assert self.KLIFS_df.PDB_geom == self.geom



def test_finds_local_with_uniprot(self):
Expand Down

0 comments on commit 355248f

Please sign in to comment.