diff --git a/modules/mol/base/pymod/export_coord_frame.cc b/modules/mol/base/pymod/export_coord_frame.cc index 93f80a7e7fb83594bc3aba2a9d67ba1e2145e2cf..e4c02c926f525c0443bc22a3d74eebd8306b3764 100644 --- a/modules/mol/base/pymod/export_coord_frame.cc +++ b/modules/mol/base/pymod/export_coord_frame.cc @@ -38,6 +38,10 @@ Real (CoordFrame::*get_min_dist_cm_v)(const mol::EntityView& sele1, const mol::E Real (CoordFrame::*get_rmsd)(const mol::EntityView& Reference_View, const mol::EntityView& sele_View) = &CoordFrame::GetRMSD; Real (CoordFrame::*get_min_dist)(const mol::EntityView& view1, const mol::EntityView& view2) = &CoordFrame::GetMinDistance; Real (CoordFrame::*get_alpha)(const mol::EntityView& segment) = &CoordFrame::GetAlphaHelixContent; +geom::Line3 (CoordFrame::*get_odr_line)(const mol::EntityView& view1) = &CoordFrame::GetODRLine; +geom::Line3 (CoordFrame::*get_odr_line2)() = &geom::Vec3List::GetODRLine; +geom::Plane (CoordFrame::*get_odr_plane)(const mol::EntityView& view1) = &CoordFrame::GetODRPlane; + void export_CoordFrame() { @@ -53,7 +57,9 @@ void export_CoordFrame() .def("GetMinDistBetwCenterOfMassAndView", get_min_dist_cm_v) .def("GetRMSD",get_rmsd) .def("GetMinDistance",get_min_dist) - .def("GetODRLine",&geom::Vec3List::GetODRLine) + .def("GetODRPlane",get_odr_plane) + .def("GetODRLine",get_odr_line) + .def("GetODRLine",get_odr_line2) .def("GetAlphaHelixContent",get_alpha) ; def("CreateCoordFrame",CreateCoordFrame); diff --git a/modules/mol/base/src/coord_frame.cc b/modules/mol/base/src/coord_frame.cc index c6d13aa78a7ff1ba9b8a6d8920d00e6902cdb30b..5e2e7812b0f6f0bc55ed259ebcd737e331b4a32f 100644 --- a/modules/mol/base/src/coord_frame.cc +++ b/modules/mol/base/src/coord_frame.cc @@ -274,6 +274,13 @@ namespace ost { namespace mol { } return atoms_pos_list.GetODRLine(); } + + geom::Line3 CoordFrame::GetODRLine(const mol::EntityView& view1){ + //Returns the best fit line to atoms in the EntityView view1 + std::vector<unsigned long> indices; + GetIndices(view1,indices); + return this->GetODRLine(indices); + } geom::Plane CoordFrame::GetODRPlane(std::vector<unsigned long>& indices_ca){ //Returns the normal to the best fit plane to atoms with indices in indices_ca @@ -284,7 +291,14 @@ namespace ost { namespace mol { } return atoms_pos_list.GetODRPlane(); } - + + geom::Plane CoordFrame::GetODRPlane(const mol::EntityView& view1){ + //Returns the best fit plane to atoms in the EntityView view1 + std::vector<unsigned long> indices; + GetIndices(view1,indices); + return this->GetODRPlane(indices); + } + geom::Line3 CoordFrame::FitCylinder(std::vector<unsigned long>& indices_ca){ //Returns a line which is the axis of a fitted cylinder to the atoms with indices given in indices_ca //It is assumed that we fit an alpha-helix and that the CA atoms are oredered sequentially diff --git a/modules/mol/base/src/coord_frame.hh b/modules/mol/base/src/coord_frame.hh index 3c5b2b28040628c7cf0c83fc0e25da4d3d6de2c7..5458f4cef7a8816dd4d803f1b89c21cd1bef58d3 100644 --- a/modules/mol/base/src/coord_frame.hh +++ b/modules/mol/base/src/coord_frame.hh @@ -75,6 +75,8 @@ public: Real GetMinDistBetwCenterOfMassAndView(const mol::EntityView& view_cm, const mol::EntityView& view_atoms); geom::Line3 GetODRLine(std::vector<unsigned long>& indices_ca); geom::Plane GetODRPlane(std::vector<unsigned long>& indices_ca); + geom::Line3 GetODRLine(const mol::EntityView& view1); + geom::Plane GetODRPlane(const mol::EntityView& view1); geom::Line3 FitCylinder(std::vector<unsigned long>& indices_ca); Real GetAlphaHelixContent(std::vector<unsigned long>& indices_ca, std::vector<unsigned long>& indices_c, std::vector<unsigned long>& indices_o, std::vector<unsigned long>& indices_n);