From 8b9685b430b82d004afcfc378cbcf46c35017687 Mon Sep 17 00:00:00 2001 From: Gerardo Tauriello <gerardo.tauriello@unibas.ch> Date: Fri, 21 Jul 2017 14:37:12 +0200 Subject: [PATCH] Export useful conop functions. --- modules/conop/pymod/export_processor.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/conop/pymod/export_processor.cc b/modules/conop/pymod/export_processor.cc index 27317133e..1f9a74281 100644 --- a/modules/conop/pymod/export_processor.cc +++ b/modules/conop/pymod/export_processor.cc @@ -24,6 +24,9 @@ using namespace ost; using namespace ost::conop; using namespace boost::python; +// WRAPPERS +namespace { + struct PyProcessor : public Processor {}; struct WrappedProcessor : public PyProcessor, public wrapper<WrappedProcessor> { WrappedProcessor(PyObject* self): self_(self) @@ -48,6 +51,13 @@ struct WrappedProcessor : public PyProcessor, public wrapper<WrappedProcessor> { PyObject* self_; }; +void (*AssignBackboneTorsionsChain)(mol::ChainHandle) = &AssignBackboneTorsions; +void (*AssignBackboneTorsionsResList)(mol::ResidueHandleList) + = &AssignBackboneTorsions; +void (*AssignBackboneTorsionsRes)(mol::ResidueHandle, mol::ResidueHandle, + mol::ResidueHandle) = &AssignBackboneTorsions; + +} // anon ns void export_processor() { @@ -84,6 +94,12 @@ void export_processor() { .def("DoProcess", &WrappedProcessor::DoProcessDefault) .def("ToString", &WrappedProcessor::ToStringDefault) ; - def("IsBondFeasible", &IsBondFeasible); + def("AssignBackboneTorsions", AssignBackboneTorsionsChain, (arg("chain"))); + def("AssignBackboneTorsions", AssignBackboneTorsionsResList, + (arg("residues"))); + def("AssignBackboneTorsions", AssignBackboneTorsionsRes, + (arg("prev"), arg("res"), arg("next"))); + def("IsBondFeasible", &IsBondFeasible, (arg("atom_a"), arg("atom_b"))); + def("GetUnknownAtomsOfResidue", &GetUnknownAtomsOfResidue, + (arg("residue"), arg("compound"), arg("strict_hydrogens")=false)); } - -- GitLab