Skip to content
Snippets Groups Projects
Commit f9499b92 authored by Niklaus Johner's avatar Niklaus Johner
Browse files

Added functions to get the best fit plane and line to a selection

at the CoordFrame level:
CoordFrame::GetODRLine(EntityView) and CoordFrame::GetODRPlane(EntityView)
parent 184b98cf
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,10 @@ Real (CoordFrame::*get_min_dist_cm_v)(const mol::EntityView& sele1, const mol::E ...@@ -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_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_min_dist)(const mol::EntityView& view1, const mol::EntityView& view2) = &CoordFrame::GetMinDistance;
Real (CoordFrame::*get_alpha)(const mol::EntityView& segment) = &CoordFrame::GetAlphaHelixContent; 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() void export_CoordFrame()
{ {
...@@ -53,7 +57,9 @@ void export_CoordFrame() ...@@ -53,7 +57,9 @@ void export_CoordFrame()
.def("GetMinDistBetwCenterOfMassAndView", get_min_dist_cm_v) .def("GetMinDistBetwCenterOfMassAndView", get_min_dist_cm_v)
.def("GetRMSD",get_rmsd) .def("GetRMSD",get_rmsd)
.def("GetMinDistance",get_min_dist) .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("GetAlphaHelixContent",get_alpha)
; ;
def("CreateCoordFrame",CreateCoordFrame); def("CreateCoordFrame",CreateCoordFrame);
......
...@@ -274,6 +274,13 @@ namespace ost { namespace mol { ...@@ -274,6 +274,13 @@ namespace ost { namespace mol {
} }
return atoms_pos_list.GetODRLine(); 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){ 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 //Returns the normal to the best fit plane to atoms with indices in indices_ca
...@@ -284,7 +291,14 @@ namespace ost { namespace mol { ...@@ -284,7 +291,14 @@ namespace ost { namespace mol {
} }
return atoms_pos_list.GetODRPlane(); 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){ 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 //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 //It is assumed that we fit an alpha-helix and that the CA atoms are oredered sequentially
......
...@@ -75,6 +75,8 @@ public: ...@@ -75,6 +75,8 @@ public:
Real GetMinDistBetwCenterOfMassAndView(const mol::EntityView& view_cm, const mol::EntityView& view_atoms); Real GetMinDistBetwCenterOfMassAndView(const mol::EntityView& view_cm, const mol::EntityView& view_atoms);
geom::Line3 GetODRLine(std::vector<unsigned long>& indices_ca); geom::Line3 GetODRLine(std::vector<unsigned long>& indices_ca);
geom::Plane GetODRPlane(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); geom::Line3 FitCylinder(std::vector<unsigned long>& indices_ca);
Real GetAlphaHelixContent(std::vector<unsigned long>& indices_ca, std::vector<unsigned long>& indices_c, 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); std::vector<unsigned long>& indices_o, std::vector<unsigned long>& indices_n);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment