Skip to content

Commit

Permalink
DAOTHER-9200: Ignore anomalous chemical shift warning if statsistics …
Browse files Browse the repository at this point in the history
…for the atom is not enough
  • Loading branch information
yokochi47 committed Feb 29, 2024
1 parent c65ffb1 commit 2393c1e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions wwpdb/utils/nmr/NmrDpUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -22279,7 +22279,9 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
if self.__csStat.hasEnoughStat(comp_id, polypeptide_like):
tolerance = std_value

if (value < min_value - tolerance or value > max_value + tolerance) and sigma > self.cs_anomalous_error_scaled_by_sigma:
if (value < min_value - tolerance or value > max_value + tolerance)\
and sigma > self.cs_anomalous_error_scaled_by_sigma\
and std_value > max_inclusive:

na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down Expand Up @@ -22426,7 +22428,7 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
loop.data[idx][details_col] += ('' if '\n' in _details else '\n') + details
modified = True

elif sigma > self.cs_anomalous_error_scaled_by_sigma:
elif sigma > self.cs_anomalous_error_scaled_by_sigma and std_value > max_inclusive:

na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down Expand Up @@ -22504,7 +22506,7 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
if self.__verbose:
self.__lfh.write(f"+NmrDpUtility.__validateCsValue() ++ Warning - {warn}\n")

elif sigma > self.cs_unusual_error_scaled_by_sigma:
elif sigma > self.cs_unusual_error_scaled_by_sigma and std_value > max_inclusive:

na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down Expand Up @@ -22572,7 +22574,9 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
else:
tolerance = std_value * 10.0

if min_value < max_value and (value < min_value - tolerance or value > max_value + tolerance) and sigma > self.cs_anomalous_error_scaled_by_sigma:
if min_value < max_value and (value < min_value - tolerance or value > max_value + tolerance)\
and sigma > self.cs_anomalous_error_scaled_by_sigma\
and std_value > max_inclusive:

na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down Expand Up @@ -22718,7 +22722,7 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
loop.data[idx][details_col] += ('' if '\n' in _details else '\n') + details
modified = True

elif sigma > self.cs_anomalous_error_scaled_by_sigma:
elif sigma > self.cs_anomalous_error_scaled_by_sigma and std_value > max_inclusive:

na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down Expand Up @@ -22881,7 +22885,9 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
sigma = abs(z_score)
tolerance = std_value

if (value < min_value - tolerance or value > max_value + tolerance) and sigma > self.cs_unusual_error_scaled_by_sigma:
if (value < min_value - tolerance or value > max_value + tolerance)\
and sigma > self.cs_unusual_error_scaled_by_sigma\
and std_value > max_inclusive:

na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down Expand Up @@ -23027,7 +23033,7 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
loop.data[idx][details_col] += ('' if '\n' in _details else '\n') + details
modified = True

elif sigma > self.cs_unusual_error_scaled_by_sigma: # Set 5.0 to be consistent with validation report
elif sigma > self.cs_unusual_error_scaled_by_sigma and std_value > max_inclusive: # Set 5.0 to be consistent with validation report

na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down Expand Up @@ -23105,7 +23111,7 @@ def __validateCsValue__(self, file_list_id, file_name, file_type, content_subtyp
if self.__verbose:
self.__lfh.write(f"+NmrDpUtility.__validateCsValue() ++ Warning - {warn}\n")
# """ Can skip this to be consistent with validation report
# elif sigma > self.cs_unusual_error_scaled_by_sigma:
# elif sigma > self.cs_unusual_error_scaled_by_sigma and std_value > max_inclusive:

# na = self.__getNearestAromaticRing(chain_id, seq_id, atom_id_, self.cutoff_aromatic)
# pa = self.__getNearestParaFerroMagneticAtom(chain_id, seq_id, atom_id_, self.cutoff_paramagnetic)
Expand Down

0 comments on commit 2393c1e

Please sign in to comment.