diff --git a/modules/qa/src/CMakeLists.txt b/modules/qa/src/CMakeLists.txt index b4c7baf97796e995ac5d3aca326dea2ec45154b1..fee79e13a73d1c7a582c68ce7df81a4c5563f1a6 100644 --- a/modules/qa/src/CMakeLists.txt +++ b/modules/qa/src/CMakeLists.txt @@ -37,5 +37,6 @@ impl/reduced_impl.cc module(NAME qa SOURCES ${OST_QA_SOURCES} - HEADERS reduced_impl.hh IN_DIR impl ${OST_QA_HEADERS} DEPENDS_ON io) + HEADERS reduced_impl.hh IN_DIR impl ${OST_QA_HEADERS} + DEPENDS_ON io mol_alg) diff --git a/modules/qa/src/impl/reduced_impl.cc b/modules/qa/src/impl/reduced_impl.cc index fb7fd01d73eae1827041a64d11cb9f0c514fa9c1..f1e431199049c990e74a5753b1014546d4e63329 100644 --- a/modules/qa/src/impl/reduced_impl.cc +++ b/modules/qa/src/impl/reduced_impl.cc @@ -2,6 +2,7 @@ #include <ost/mol/residue_handle.hh> #include <ost/mol/atom_handle.hh> #include <ost/mol/atom_view.hh> +#include <ost/mol/alg/construct_cbeta.hh> #include "reduced_impl.hh" @@ -105,14 +106,7 @@ bool ReducedPotentialImpl::GetCAlphaCBetaPos(const mol::ResidueHandle& res, << " doesn't have enough atoms to reconstruct Cbeta position"); return false; } - geom::Vec3 v1=geom::Normalize(ca.GetPos()-n.GetPos()); - geom::Vec3 v2=geom::Normalize(ca.GetPos()-c.GetPos()); - geom::Vec3 in_plane_v=geom::Normalize(v1+v2); - geom::Plane p(ca.GetPos() ,n.GetPos(), c.GetPos()); - // rotate around vector perpendicular to p and in_plane_v - geom::Vec3 axis=geom::Normalize(geom::Cross(p.GetNormal(), in_plane_v)); - geom::Mat3 rot_mat=geom::AxisRotation(axis, (-54/180.0)*M_PI); - cb_pos=ca.GetPos()+rot_mat*in_plane_v*bond_length; + cb_pos=mol::alg::CBetaPosition(n.GetPos(), ca.GetPos(), c.GetPos()); return true; }