Skip to content

Commit

Permalink
DAOTHER-9317, 9511: Prevent wrong atom_id mapping DC:H3 (extended imi…
Browse files Browse the repository at this point in the history
…no proton) -> DC:H3' of BMRB chemical shift statistics
  • Loading branch information
yokochi47 committed Jun 27, 2024
1 parent 2a00b69 commit 93cce50
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wwpdb/utils/nmr/BMRBChemShiftStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,8 @@ def checkAtomNomenclature(self, atom_id, comp_id=None, verbose=False):
return True, comp_id, atom_id[:-1]

_atom_id = translateToStdAtomName(atom_id, comp_id, refAtomIdList=_ref_atom_ids, ccU=self.__ccU, unambig=False)
if _atom_id in _ref_atom_ids:
# prevent wrong atom_id mapping DC:H3 (extended imino proton) -> DC:H3' (DAOTHER-9317, 9511)
if _atom_id in _ref_atom_ids and (("'" not in atom_id and "'" not in _atom_id) or ("'" in atom_id and "'" in _atom_id)):
# print(f'case 4. {_comp_id}:{atom_id} -> {comp_id}:{_atom_id}')
return True, comp_id, _atom_id

Expand Down
Binary file modified wwpdb/utils/nmr/bmrb_cs_stat/dna_filt.pkl
Binary file not shown.
Binary file modified wwpdb/utils/nmr/bmrb_cs_stat/dna_full.pkl
Binary file not shown.
Binary file modified wwpdb/utils/nmr/bmrb_cs_stat/others.pkl
Binary file not shown.
Binary file modified wwpdb/utils/nmr/bmrb_cs_stat/rna_full.pkl
Binary file not shown.
6 changes: 6 additions & 0 deletions wwpdb/utils/tests-nmr/test_BMRBChemShiftStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ def test_get_ile_cs_stat(self):
self.assertEqual([stat['atom_id'] for stat in self.bmrb_cs_stat.get('ILE') if 'avg' in stat and stat['desc'] == 'methyl' and stat['atom_id'][0] == 'H'],
['HD11', 'HD12', 'HD13', 'HG21', 'HG22', 'HG23'])

def test_dc_h3_stat(self):
h3c_stat = next(cs_stat for cs_stat in self.bmrb_cs_stat.get('DC') if cs_stat['atom_id'] == "H3'")
self.assertTrue(h3c_stat['avg'] < 5.0)
h3_stat = next((cs_stat for cs_stat in self.bmrb_cs_stat.get('DC') if cs_stat['atom_id'] == "H3"), None)
self.assertIsNone(h3_stat)


if __name__ == '__main__':
unittest.main()

0 comments on commit 93cce50

Please sign in to comment.