Skip to content
Snippets Groups Projects
Commit 8e73634f authored by Marco Biasini's avatar Marco Biasini
Browse files

added always_remove_bb parameter to FilterClashes

parent 7f49c161
No related branches found
No related tags found
No related merge requests found
......@@ -35,8 +35,8 @@ namespace {
Real (*ldt_a)(const mol::EntityView&, const mol::EntityView& ref, Real, Real)=&mol::alg::LocalDistTest;
Real (*ldt_b)(const seq::AlignmentHandle&,Real, Real, int, int)=&mol::alg::LocalDistTest;
mol::EntityView (*fc_a)(const mol::EntityView&, Real)=&mol::alg::FilterClashes;
mol::EntityView (*fc_b)(const mol::EntityHandle&, Real)=&mol::alg::FilterClashes;
mol::EntityView (*fc_a)(const mol::EntityView&, Real,bool)=&mol::alg::FilterClashes;
mol::EntityView (*fc_b)(const mol::EntityHandle&, Real, bool)=&mol::alg::FilterClashes;
}
BOOST_PYTHON_MODULE(_mol_alg)
......@@ -48,8 +48,8 @@ BOOST_PYTHON_MODULE(_mol_alg)
def("LocalDistTest", ldt_a);
def("LocalDistTest", ldt_b, (arg("ref_index")=0, arg("mdl_index")=1));
def("FilterClashes", fc_a, (arg("ent"), arg("tolerance")=0.1));
def("FilterClashes", fc_b, (arg("ent"), arg("tolerance")=0.1));
def("FilterClashes", fc_a, (arg("ent"), arg("tolerance")=0.1, arg("always_remove_bb")=false));
def("FilterClashes", fc_b, (arg("ent"), arg("tolerance")=0.1, arg("always_remove_bb")=false));
def("SuperposeFrames", &ost::mol::alg::SuperposeFrames,
(arg("source"), arg("sel")=ost::mol::EntityView(), arg("begin")=0,
arg("end")=-1, arg("ref")=-1));
......
......@@ -69,7 +69,8 @@ Real GetThreshold(const String& ele1, const String& ele2) {
}
EntityView FilterClashes(const EntityView& ent, Real tolerance)
EntityView FilterClashes(const EntityView& ent, Real tolerance,
bool always_remove_bb)
{
EntityView filtered=ent.CreateEmptyView();
ResidueViewList residues=ent.GetResidueList();
......@@ -106,6 +107,10 @@ EntityView FilterClashes(const EntityView& ent, Real tolerance)
Real threshold=GetThreshold(ele1, ele2)-tolerance;
if (d<threshold*threshold) {
remove_sc=true;
if (always_remove_bb==true) {
remove_bb=true;
continue;
}
String name=atom.GetName();
if (name=="CA" || name=="N" || name=="O" || name=="C") {
remove_bb=true;
......@@ -134,9 +139,10 @@ EntityView FilterClashes(const EntityView& ent, Real tolerance)
}
EntityView FilterClashes(const EntityHandle& ent, Real tolerance)
EntityView FilterClashes(const EntityHandle& ent, Real tolerance,
bool always_remove_bb)
{
return FilterClashes(ent.CreateFullView(), tolerance);
return FilterClashes(ent.CreateFullView(), tolerance, always_remove_bb);
}
......
......@@ -26,10 +26,12 @@ namespace ost { namespace mol { namespace alg {
EntityView DLLEXPORT_OST_MOL_ALG FilterClashes(const EntityView& ent,
Real tolerance=0.1);
Real tolerance=0.1,
bool always_remove_bb=false);
EntityView DLLEXPORT_OST_MOL_ALG FilterClashes(const EntityHandle& ent,
Real tolerance=0.1);
Real tolerance=0.1,
bool always_remove_bb=false);
}}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment