Skip to content

Commit

Permalink
geom: use hydrogen torsion angles
Browse files Browse the repository at this point in the history
  • Loading branch information
keitaroyam committed Dec 1, 2023
1 parent 29376cb commit 4d8006e
Show file tree
Hide file tree
Showing 3 changed files with 14 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.41'
__date__ = '2023-11-30'
__version__ = '0.4.42'
__date__ = '2023-12-01'
2 changes: 2 additions & 0 deletions src/refine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,8 @@ void add_refine(py::module& m) {
.def_readwrite("dinc_dummy", &Geometry::dinc_dummy)
.def_readwrite("vdw_sdi_dummy", &Geometry::vdw_sdi_dummy)
.def_readwrite("max_vdw_radius", &Geometry::max_vdw_radius)
// torsion parameters
.def_readwrite("use_hydr_tors", &Geometry::use_hydr_tors)
// ADP restraint parameters
.def_readwrite("adpr_max_dist", &Geometry::adpr_max_dist)
.def_readwrite("adpr_d_power", &Geometry::adpr_d_power)
Expand Down
11 changes: 10 additions & 1 deletion src/refine/geom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,9 @@ struct Geometry {
//double dvdw_cut_min_x = 1.75; // used as twice in fast_hessian_tabulation.f // VDWR VDWC val
double max_vdw_radius = 2.0;

// torsion
bool use_hydr_tors = true;

// ADP restraints
float adpr_max_dist = 4.;
double adpr_d_power = 4;
Expand Down Expand Up @@ -665,12 +668,17 @@ inline void Geometry::load_topo(const gemmi::Topo& topo) {
}
};

auto test_link_r = [&topo](const gemmi::Topo::Rule& rule, const std::string& link_id) {
auto test_hydr_tors = [&](const gemmi::Topo::Torsion &t) {
return use_hydr_tors && (t.atoms[0]->is_hydrogen() || t.atoms[3]->is_hydrogen());
};
auto test_link_r = [&topo,&test_hydr_tors](const gemmi::Topo::Rule& rule, const std::string& link_id) {
if (rule.rkind != gemmi::Topo::RKind::Torsion)
return true;
const gemmi::Topo::Torsion& t = topo.torsions[rule.index];
if (t.restr->label.find("sp2_sp2") == 0)
return true;
if (test_hydr_tors(t))
return true;
return ((link_id == "TRANS" || link_id != "CIS" ||
link_id == "PTRANS" || link_id != "PCIS" ||
link_id == "NMTRANS" || link_id != "NMCIS") &&
Expand All @@ -691,6 +699,7 @@ inline void Geometry::load_topo(const gemmi::Topo& topo) {
for (const gemmi::Topo::Rule& rule : ri.monomer_rules) {
if (rule.rkind != gemmi::Topo::RKind::Torsion ||
topo.torsions[rule.index].restr->label.find("sp2_sp2") == 0 ||
test_hydr_tors(topo.torsions[rule.index]) ||
(ri.orig_chemcomp && ri.orig_chemcomp->group == gemmi::ChemComp::Group::Peptide &&
topo.torsions[rule.index].restr->label.find("chi") == 0))
add(rule, true);
Expand Down

0 comments on commit 4d8006e

Please sign in to comment.