diff --git a/wwpdb/utils/nmr/NEFTranslator/NEFTranslator.py b/wwpdb/utils/nmr/NEFTranslator/NEFTranslator.py index f7e3628b..3ce322ed 100644 --- a/wwpdb/utils/nmr/NEFTranslator/NEFTranslator.py +++ b/wwpdb/utils/nmr/NEFTranslator/NEFTranslator.py @@ -137,7 +137,8 @@ from wwpdb.utils.nmr.CifToNmrStar import CifToNmrStar from wwpdb.utils.nmr.mr.ParserListenerUtil import (ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS, ALLOWED_AMBIGUITY_CODES, - translateToStdResName) + translateToStdResName, + translateToStdAtomName) except ImportError: from nmr.AlignUtil import (LEN_LARGE_ASYM_ID, LOW_SEQ_COVERAGE, emptyValue, trueValue, monDict3, @@ -152,7 +153,8 @@ from nmr.CifToNmrStar import CifToNmrStar from nmr.mr.ParserListenerUtil import (ISOTOPE_NUMBERS_OF_NMR_OBS_NUCS, ALLOWED_AMBIGUITY_CODES, - translateToStdResName) + translateToStdResName, + translateToStdAtomName) __package_name__ = 'wwpdb.utils.nmr' @@ -6683,7 +6685,7 @@ def get_valid_star_atom_for_ligand_remap(self, comp_id, atom_id, coord_atom_site if details is not None and comp_id not in monDict3 and self.__csStat.peptideLike(comp_id) and atom_id[0] in ('H', 'C', 'N', 'O', 'P')\ and len_atom_id > 1 and atom_id[1] in ('A', 'B', 'G', 'D', 'E', 'Z', 'H')\ - and (atom_id[0] != 'H' or (atom_id[0] == 'H' and atom_id[-1] not in ('%', '#'))): + and (atom_id[0] != 'H' or (atom_id[0] == 'H' and atom_id[-1] not in ('%', '*'))): grk_atoms = self.__ccU.getAtomsBasedOnGreekLetterSystem(comp_id, atom_id) if len(grk_atoms) > 0: atom_list = [] @@ -7011,6 +7013,10 @@ def get_valid_star_atom_in_xplor(self, comp_id, atom_id, details=None, leave_unm if '#' in atom_id: atom_id = atom_id.replace('#', '%') + if atom_id[-1] in ('%', '*') and atom_id[-2] != "'" and self.__csStat.getTypeOfCompId(comp_id)[1]: + atom_id = translateToStdAtomName(atom_id[:-1], refCompId=comp_id, ccU=self.__ccU) + atom_id[-1] + print(atom_id) + if atom_id[0] in ('1', '2', '3'): atom_list, ambiguity_code, details = self.get_valid_star_atom(comp_id, atom_id, details, leave_unmatched, methyl_only) if details is None: @@ -7349,7 +7355,7 @@ def get_valid_star_atom(self, comp_id, atom_id, details=None, leave_unmatched=Tr if details is not None and comp_id not in monDict3 and self.__csStat.peptideLike(comp_id) and atom_id[0] in ('H', 'C', 'N', 'O', 'P')\ and len_atom_id > 1 and atom_id[1] in ('A', 'B', 'G', 'D', 'E', 'Z', 'H')\ - and (atom_id[0] != 'H' or (atom_id[0] == 'H' and atom_id[-1] not in ('%', '#'))): + and (atom_id[0] != 'H' or (atom_id[0] == 'H' and atom_id[-1] not in ('%', '*'))): grk_atoms = self.__ccU.getAtomsBasedOnGreekLetterSystem(comp_id, atom_id) if len(grk_atoms) > 0: atom_list = [] diff --git a/wwpdb/utils/nmr/mr/ParserListenerUtil.py b/wwpdb/utils/nmr/mr/ParserListenerUtil.py index fe813a03..71039a91 100644 --- a/wwpdb/utils/nmr/mr/ParserListenerUtil.py +++ b/wwpdb/utils/nmr/mr/ParserListenerUtil.py @@ -2183,7 +2183,7 @@ def translateToStdAtomName(atomId, refCompId=None, refAtomIdList=None, ccU=None, elif refCompId in ('DT', 'T') and atomId.startswith('H5'): # 2lsz if atomId in ('H51', 'H52', 'H53'): return 'H7' + atomId[-1] - if atomId in 'H5': + if atomId in ('H5', 'H5%', 'H5#', 'H5*'): return 'H7' elif refCompId in ('DT', 'T') and (atomId.startswith('C5') or atomId == 'CM'): # 7dju, 7pdu return 'C7' @@ -2193,7 +2193,7 @@ def translateToStdAtomName(atomId, refCompId=None, refAtomIdList=None, ccU=None, if atomId.startswith('H7'): if atomId in ('H71', 'H72', 'H73'): return 'HM5' + atomId[-1] - if atomId in 'H7': + if atomId in ('H7', 'H7%', 'H7#', 'H7*'): return 'HM5' if atomId in ('C7', 'CM'): # 7png, 7pdu return 'C5M'