Skip to content

Commit

Permalink
Reconciled fix between 2ruj and 2mf8 and permit instance of HO5' atom…
Browse files Browse the repository at this point in the history
… of standard nuclic acids (e.g. DA:HO5') in the cooridnate (2mf8)
  • Loading branch information
yokochi47 committed May 8, 2024
1 parent 7e1fc06 commit 1406951
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
14 changes: 9 additions & 5 deletions wwpdb/utils/nmr/NEFTranslator/NEFTranslator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,10 @@ def skip_empty_value_error(lp, idx):

for loop in loops:

_test_on_index = test_on_index
if self.__remediation_mode and len(loop.data) > MAX_ROWS_TO_PERFORM_REDUNDANCY_CHECK:
_test_on_index = False

if allowed_tags is not None:

if 'Details' in loop.tags and 'Details' not in allowed_tags:
Expand Down Expand Up @@ -2694,7 +2698,7 @@ def skip_empty_value_error(lp, idx):

tag_data = get_lp_tag(loop, tags)

if test_on_index and len(idx_tag_ids) > 0 and len(tag_data) <= MAX_ROWS_TO_PERFORM_REDUNDANCY_CHECK:
if _test_on_index: # and len(idx_tag_ids) > 0 and len(tag_data) <= MAX_ROWS_TO_PERFORM_REDUNDANCY_CHECK:

for idx, idx_tag_id in enumerate(idx_tag_ids):

Expand Down Expand Up @@ -2738,7 +2742,7 @@ def skip_empty_value_error(lp, idx):
raise ValueError(f"{name} must not be empty. "
f"#_of_row {idx + 1}, data_of_row {r}.")

if test_on_index and key_len > 0:
if _test_on_index and key_len > 0:
keys = set()

rechk = False
Expand Down Expand Up @@ -2926,7 +2930,7 @@ def skip_empty_value_error(lp, idx):

tag_data = get_lp_tag(loop, tags)

if test_on_index and key_len > 0:
if _test_on_index and key_len > 0:
keys = set()

rechk = False
Expand Down Expand Up @@ -3221,7 +3225,7 @@ def skip_empty_value_error(lp, idx):
+ f"{name} {val!r} must be {self.readableItemType[type]}.")
if static_val[name] is None:
static_val[name] = val
elif val != static_val[name] and test_on_index:
elif val != static_val[name] and _test_on_index:
raise ValueError(get_idx_msg(idx_tag_ids, tags, ent)
+ f"{name} {val} vs {static_val[name]} must be {self.readableItemType[type]}.")
elif type == 'float':
Expand Down Expand Up @@ -3575,7 +3579,7 @@ def skip_empty_value_error(lp, idx):
+ f"{name} {val!r} must be {self.readableItemType[type]}.")
if static_val[name] is None:
static_val[name] = val
elif val != static_val[name] and test_on_index:
elif val != static_val[name] and _test_on_index:
raise ValueError(get_idx_msg(idx_tag_ids, tags, ent)
+ f"{name} {val} vs {static_val[name]} must be {self.readableItemType[type]}.")
elif type == 'float':
Expand Down
24 changes: 24 additions & 0 deletions wwpdb/utils/nmr/NmrDpUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -18989,6 +18989,10 @@ def __validateAtomNomenclature__(self, file_name, file_type, content_subtype, sf
if self.__remediation_mode and atom_id[0] == 'Q': # DAOTHER-8663, 8751
continue

if self.__remediation_mode and self.__csStat.getTypeOfCompId(comp_id)[1]\
and atom_id == "HO5'":
continue

err = f"Invalid atom_id {atom_id!r} (comp_id {comp_id!r}) in a loop {lp_category}."

self.report.error.appendDescription('invalid_atom_nomenclature',
Expand Down Expand Up @@ -19068,6 +19072,10 @@ def __validateAtomNomenclature__(self, file_name, file_type, content_subtype, sf
elif self.__remediation_mode and atom_id[0] == 'Q': # DAOTHER-8663, 8751
pass

elif self.__remediation_mode and self.__csStat.getTypeOfCompId(comp_id)[1]\
and atom_id == "HO5'":
pass

else:
is_valid, cc_name, cc_rel_status = self.__getChemCompNameAndStatusOf(comp_id)

Expand Down Expand Up @@ -19216,6 +19224,10 @@ def __validateAtomNomenclature__(self, file_name, file_type, content_subtype, sf
if self.__remediation_mode and _auth_atom_id[0] == 'Q': # DAOTHER-8663, 8751
continue

if self.__remediation_mode and self.__csStat.getTypeOfCompId(comp_id)[1]\
and atom_id == "HO5'":
continue

auth_atom_ids = self.__getAtomIdListInXplor(comp_id, _auth_atom_id)

if len(auth_atom_ids) > 0:
Expand Down Expand Up @@ -19250,6 +19262,10 @@ def __validateAtomNomenclature__(self, file_name, file_type, content_subtype, sf
if self.__remediation_mode and auth_atom_id[0] == 'Q': # DAOTHER-8663, 8751
continue

if self.__remediation_mode and self.__csStat.getTypeOfCompId(comp_id)[1]\
and atom_id == "HO5'":
continue

warn = f"Unmatched Auth_atom_ID {auth_atom_id!r} (Auth_comp_ID {auth_comp_id})."

self.report.warning.appendDescription('auth_atom_nomenclature_mismatch',
Expand Down Expand Up @@ -19287,6 +19303,10 @@ def __validateAtomNomenclature__(self, file_name, file_type, content_subtype, sf
if self.__remediation_mode and auth_atom_id[0] == 'Q': # DAOTHER-8663, 8751
continue

if self.__remediation_mode and self.__csStat.getTypeOfCompId(comp_id)[1]\
and atom_id == "HO5'":
continue

warn = f"Unmatched Auth_atom_ID {auth_atom_id!r} (Auth_comp_ID {comp_id}, non-standard residue)."

self.report.warning.appendDescription('auth_atom_nomenclature_mismatch',
Expand All @@ -19313,6 +19333,10 @@ def __validateAtomNomenclature__(self, file_name, file_type, content_subtype, sf
if self.__remediation_mode and auth_atom_id[0] == 'Q': # DAOTHER-8663, 8751
continue

if self.__remediation_mode and self.__csStat.getTypeOfCompId(comp_id)[1]\
and atom_id == "HO5'":
continue

warn = f"Unmatched Auth_atom_ID {auth_atom_id!r} (Auth_comp_ID {comp_id}, non-standard residue)."

self.report.warning.appendDescription('auth_atom_nomenclature_mismatch',
Expand Down

0 comments on commit 1406951

Please sign in to comment.