Skip to content

Commit

Permalink
DAOTHER-9520: Do not remediate a cs line without mandatory atom_id an…
Browse files Browse the repository at this point in the history
…d ignore it
  • Loading branch information
yokochi47 committed Jul 1, 2024
1 parent 26812c8 commit d3c7de7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions wwpdb/utils/nmr/BMRBChemShiftStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,9 @@ def loadStatFromCsvFile(self, file_name, primary_th, secondary_th=None, comp_id_
elif comp_id == 'THR' and _atom_id == 'MG':
_atom_id = 'MG2'

elif _atom_id.endswith('"'):
_atom_id = _atom_id[:-1] + "'"

# methyl proton group
if _atom_id.startswith('M'):
_atom_id = re.sub(r'^M', 'H', _atom_id)
Expand Down Expand Up @@ -1706,6 +1709,9 @@ def checkAtomNomenclature(self, atom_id, comp_id=None, verbose=False):
# print(f'case 4. {_comp_id}:{atom_id} -> {comp_id}:{_atom_id}')
return True, comp_id, _atom_id

if comp_id == 'DC' and atom_id == 'H3': # DAOTHER-9198
return True, 'DNR', 'HN3'

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

Expand Down
10 changes: 7 additions & 3 deletions wwpdb/utils/nmr/NmrDpUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -20792,7 +20792,10 @@ def __testDataConsistencyInLoop__(self, file_list_id, file_name, file_type, cont
item = 'insufficient_data'
has_bad_pattern = True
elif clea:
if content_subtype.startswith('spectral_peak'):
if content_subtype == 'chem_shift':
warn += ' Partially assiged chemical shifts should be resolved or removed.'
item = 'incompletely_assigned_chemical_shift'
elif content_subtype.startswith('spectral_peak'):
warn += ' Unassigned spectral peaks can be included in your peak list(s).'
item = 'incompletely_assigned_spectral_peak'
else:
Expand Down Expand Up @@ -26982,9 +26985,10 @@ def test_seq_id_offset_as_is(lp, index, _row, _idx, chain_id, seq_id, comp_id, o
elif ambig_code in (4, 5, 6, 9):
has_genuine_ambig_code = True

lp.add_data(_row)
if _row[8] not in emptyValue: # DAOTHER-9520: Atom_isotppe_number is mandatory
lp.add_data(_row)

index += 1
index += 1

if trial == 0 and len(incomplete_comp_id_annotation) > 0: # DAOTHER-9286
regenerate_request = True
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.
2 changes: 2 additions & 0 deletions wwpdb/utils/tests-nmr/test_BMRBChemShiftStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ def test_dc_h3_stat(self):
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)
hn3_stat = next(cs_stat for cs_stat in self.bmrb_cs_stat.get('DNR') if cs_stat['atom_id'] == "HN3")
self.assertTrue(hn3_stat['avg'] > 5.0)


if __name__ == '__main__':
Expand Down

0 comments on commit d3c7de7

Please sign in to comment.