Skip to content

Commit

Permalink
DAOTHER-9317: Fix IndexError exception of the previsou commits
Browse files Browse the repository at this point in the history
  • Loading branch information
yokochi47 committed Apr 19, 2024
1 parent d17d7ea commit fee9f60
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions wwpdb/utils/nmr/BMRBChemShiftStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,8 @@ def loadStatFromCsvFile(self, file_name, primary_th, secondary_th=None, comp_id_

# DAOTHER-9317: representative methyl group
elif any(rep_methyl_proton.startswith(_atom_id) for rep_methyl_proton in rep_methyl_protons
if rep_methyl_proton != _atom_id and 0 <= len(rep_methyl_proton) - len(_atom_id) <= 1 and _atom_id not in non_rep_methyl_protons):
if rep_methyl_proton != _atom_id and 0 <= len(rep_methyl_proton) - len(_atom_id) <= 1
and _atom_id not in non_rep_methyl_protons):

rep_methyl_proton = next(rep_methyl_proton for rep_methyl_proton in rep_methyl_protons
if rep_methyl_proton.startswith(_atom_id))
Expand Down Expand Up @@ -1030,7 +1031,8 @@ def loadStatFromCsvFile(self, file_name, primary_th, secondary_th=None, comp_id_

# DAOTHER-9317: general methylene/amino group
elif any(rep_methylene_proton.startswith(_atom_id) for rep_methylene_proton in rep_methylene_protons
if rep_methylene_proton != _atom_id and 0 <= len(rep_methylene_proton) - len(_atom_id) <= 1 and _atom_id not in non_rep_methylene_protons):
if rep_methylene_proton != _atom_id and 0 <= len(rep_methylene_proton) - len(_atom_id) <= 1
and _atom_id not in non_rep_methylene_protons):

rep_methylene_proton = next(rep_methylene_proton for rep_methylene_proton in rep_methylene_protons
if rep_methylene_proton.startswith(_atom_id))
Expand Down Expand Up @@ -2005,6 +2007,8 @@ def getAtomLikeNameSet(self, excl_minor_atom=False, primary=False, minimum_len=1
ambig_code = self.getMaxAmbigCodeWoSetId(comp_id, name)

if name in methyl_list:
if len(name) < 3:
continue
_name = name[:-1]
if _name[0] == 'H':
name_set.add('M' + _name[1:])
Expand All @@ -2021,6 +2025,8 @@ def getAtomLikeNameSet(self, excl_minor_atom=False, primary=False, minimum_len=1
elif ambig_code >= 2:
geminal_name = self.getGeminalAtom(comp_id, name)
if geminal_name is not None:
if len(name) < 3:
continue
_name = name[:-1]
if _name[0] == 'H':
name_set.add('Q' + _name[1:])
Expand Down

0 comments on commit fee9f60

Please sign in to comment.