Skip to content

Commit

Permalink
DAOTHER-9317: Correct comments to avoid confusion when remapping chem…
Browse files Browse the repository at this point in the history
…ical shift statistics of non-standard residues based on CCD since the error message is ignorable
  • Loading branch information
yokochi47 committed Apr 19, 2024
1 parent 59108d6 commit c3bab52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions wwpdb/utils/nmr/BMRBChemShiftStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# 11-Nov-2022 M. Yokochi - add getProtonsInSameGroup() (NMR restraint remediation)
# 20-Apr-2023 M. Yokochi - change backbone definition to be consistent with NMR restraint validation
# 13-Dec-2023 M. Yokochi - support peptide-like residues containing symmetric aromatic ring (DAOTHER-8945)
# 19-Apr-2024 M. Yokochi - add testAtomNomenclatureOfLibrary (DAOTHER-9317)
# 19-Apr-2024 M. Yokochi - remap chemical shift statistics in reference to CCD (DAOTHER-9317)
##
""" Wrapper class for retrieving BMRB chemical shift statistics.
@author: Masashi Yokochi
Expand Down Expand Up @@ -1080,6 +1080,7 @@ def __appendExtraFromCcd(self, comp_id):

def checkAtomNomenclature(self, atom_id, comp_id=None):
""" Check atom nomenclature.
@return: status (bool), mapped comp_id, mapped atom_id
"""

if comp_id is not None:
Expand Down Expand Up @@ -1114,7 +1115,7 @@ def checkAtomNomenclature(self, atom_id, comp_id=None):

if len(ref_atom_ids) == 0 or cc_rel_status != 'REL':
if self.__verbose:
self.__lfh.write(f"+BMRBChemShiftStat.checkAtomNomenclature() ++ Error - {comp_id} is not valid CCD ID, status code: {cc_rel_status}\n")
self.__lfh.write(f"+BMRBChemShiftStat.checkAtomNomenclature() ++ Warning - {comp_id} is not valid CCD ID, status code: {cc_rel_status}\n")
return False, None, None

ref_alt_atom_ids = [a[self.__ccU.ccaAltAtomId] for a in self.__ccU.lastAtomList]
Expand Down Expand Up @@ -1150,7 +1151,7 @@ def checkAtomNomenclature(self, atom_id, comp_id=None):

if len(_ref_atom_ids) == 0:
if self.__verbose:
self.__lfh.write(f"+BMRBChemShiftStat.checkAtomNomenclature() ++ Error - {comp_id}:{atom_id} did not match with any atom in CCD. No candidates foud\n")
self.__lfh.write(f"+BMRBChemShiftStat.checkAtomNomenclature() ++ Warning - {comp_id}:{atom_id} did not match with any atom in CCD. No candidates foud\n")

return False, None, None

Expand All @@ -1168,7 +1169,7 @@ def checkAtomNomenclature(self, atom_id, comp_id=None):
return True, comp_id, _atom_id

if self.__verbose:
self.__lfh.write(f"+BMRBChemShiftStat.checkAtomNomenclature() ++ Error - {comp_id}:{atom_id} did not match with any atom in CCD, {_ref_atom_ids}\n")
self.__lfh.write(f"+BMRBChemShiftStat.checkAtomNomenclature() ++ Warning - {comp_id}:{atom_id} did not match with any atom in CCD, {_ref_atom_ids}\n")

return False, None, None

Expand Down Expand Up @@ -1753,6 +1754,7 @@ def __updateCompIdSet(self):

def testAtomNomenclatureOfLibrary(self):
""" Report inconsistencies between BMRB chemical shift statistics and current CCD.
@return: status (bool)
"""

def check_bmrb_cs_stat(atm_list):
Expand Down
6 changes: 3 additions & 3 deletions wwpdb/utils/nmr/mr/ParserListenerUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1826,15 +1826,15 @@ def translateToStdAtomName(atomId, refCompId=None, refAtomIdList=None, ccU=None,
return "H2'1"
if atomId == "H2''" and "H2'2" in refAtomIdList: # DCZ, THM
return "H2'2"
if atomId == "H2''" and "HO2'" in refAtomIdList: # 5MC (DAOTHER-9313)
if atomId == "H2''" and "HO2'" in refAtomIdList: # 5MC (DAOTHER-9317)
return "HO2'"
if atomId == "H2''" and "H2'" in refAtomIdList:
return "H2'"
if atomId == "H2''''" and "H2''" in refAtomIdList:
return "H2''"
if atomId == "H2''''" and "H2'2" in refAtomIdList: # DCZ, THM
return "H2'2"
if atomId == "H2''''" and "HO2'" in refAtomIdList: # 5MC (DAOTHER-9313)
if atomId == "H2''''" and "HO2'" in refAtomIdList: # 5MC (DAOTHER-9317)
return "HO2'"
if atomId == "H2''1" and "H2'1" in refAtomIdList: # 4EN
return "H2'1"
Expand All @@ -1848,7 +1848,7 @@ def translateToStdAtomName(atomId, refCompId=None, refAtomIdList=None, ccU=None,
return "H2'1"
if atomId == "H2''" and "H2'2" in _refAtomIdList: # DCZ, THM
return "H2'2"
if atomId == "H2''" and "HO2'" in _refAtomIdList: # 5MC (DAOTHER-9313)
if atomId == "H2''" and "HO2'" in _refAtomIdList: # 5MC (DAOTHER-9317)
return "HO2'"
if atomId == "H2''" and "H2'" in _refAtomIdList:
return "H2'"
Expand Down

0 comments on commit c3bab52

Please sign in to comment.