Skip to content

Commit

Permalink
refine: ignore bad ideal chirals
Browse files Browse the repository at this point in the history
N-terminal Pro lead to geometry target of NaN, because of MonomerLibrary/monomers#38
  • Loading branch information
keitaroyam committed Dec 5, 2023
1 parent 4d8006e commit 1fb16d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions servalcat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
Mozilla Public License, version 2.0; see LICENSE.
"""

__version__ = '0.4.42'
__date__ = '2023-12-01'
__version__ = '0.4.43'
__date__ = '2023-12-05'
5 changes: 4 additions & 1 deletion src/refine/geom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ inline void Geometry::load_topo(const gemmi::Topo& topo) {
} else if (rule.rkind == gemmi::Topo::RKind::Chirality) {
const gemmi::Topo::Chirality& t = topo.chirs[rule.index];
const auto val_sigma = ideal_chiral_abs_volume_sigma(topo, t);
if (val_sigma.second <= 0) return;
if (val_sigma.second <= 0 ||
!std::isfinite(val_sigma.first) || !std::isfinite(val_sigma.second)) return;
chirs.emplace_back(t.atoms[0], t.atoms[1], t.atoms[2], t.atoms[3]);
chirs.back().value = val_sigma.first;
chirs.back().sigma = val_sigma.second;
Expand Down Expand Up @@ -1017,6 +1018,8 @@ inline double Geometry::calc(bool use_nucleus, bool check_only,
if (!check_only && ridge_dmax > 0)
calc_jellybody(); // no contribution to target

if (std::isnan(ret))
gemmi::fail("geom became NaN");
// TODO intervals, specials
return ret;
}
Expand Down

0 comments on commit 1fb16d4

Please sign in to comment.