Skip to content
Snippets Groups Projects
Commit 3eba172e authored by Gabriel Studer's avatar Gabriel Studer
Browse files

added checker function for residue completeness in compound lib.

not tested yet.
parent 2d490c5f
Branches
Tags
No related merge requests found
...@@ -135,6 +135,9 @@ void export_Compound() { ...@@ -135,6 +135,9 @@ void export_Compound() {
.def("Load", &CompoundLib::Load, arg("readonly")=true).staticmethod("Load") .def("Load", &CompoundLib::Load, arg("readonly")=true).staticmethod("Load")
.def("FindCompound", &find_compound, .def("FindCompound", &find_compound,
(arg("tlc"), arg("dialect")="PDB")) (arg("tlc"), arg("dialect")="PDB"))
.def("IsResidueComplete",&CompoundLib::IsResidueComplete, (arg("residue"),
arg("check_hydrogens")=false,
arg("dialect")="PDB"))
.def("ClearCache", &CompoundLib::ClearCache) .def("ClearCache", &CompoundLib::ClearCache)
.def("GetOSTVersionUsed", &CompoundLib::GetOSTVersionUsed) .def("GetOSTVersionUsed", &CompoundLib::GetOSTVersionUsed)
.def("GetCreationDate", &get_creation_date, (arg("comp_lib"))) .def("GetCreationDate", &get_creation_date, (arg("comp_lib")))
......
#include "compound_lib_base.hh"
namespace ost { namespace conop {
bool CompoundLibBase::IsResidueComplete(const ost::mol::ResidueHandle& res, bool check_hydrogens, Compound::Dialect dialect) const{
CompoundPtr compound = this->FindCompound(res.GetName(), dialect);
AtomSpecList a_spec = compound->GetAtomSpecs();
for(AtomSpecList::const_iterator it=a_spec.begin(); it!=a_spec.end();++it){
if(it->element=="H" || it->element=="D"){
if(check_hydrogens){
if(!res.FindAtom(it->name).IsValid()){
return false;
}
}
}
if(!res.FindAtom(it->name).IsValid()){
return false;
}
}
return true;
}
}}//namespace
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define OST_CONOP_COMPOUND_LIB_BASE_HH #define OST_CONOP_COMPOUND_LIB_BASE_HH
#include "compound.hh" #include "compound.hh"
#include <ost/mol/residue_handle.hh>
namespace ost { namespace conop { namespace ost { namespace conop {
...@@ -13,6 +14,10 @@ public: ...@@ -13,6 +14,10 @@ public:
virtual ~CompoundLibBase() {} virtual ~CompoundLibBase() {}
virtual CompoundPtr FindCompound(const String& id, virtual CompoundPtr FindCompound(const String& id,
Compound::Dialect dialect) const = 0; Compound::Dialect dialect) const = 0;
bool IsResidueComplete(const ost::mol::ResidueHandle& res,
bool check_hydrogens,
Compound::Dialect) const;
}; };
}} }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment