From d2738667e2588a6f8146251958bcd59803facd01 Mon Sep 17 00:00:00 2001
From: Niklaus Johner <nij2003@med.cornell.edu>
Date: Fri, 18 May 2012 17:19:39 -0400
Subject: [PATCH] Added function to extract an alpha-helix axis from an
 EntityView in the python module structure_analysis.py

---
 modules/mol/alg/pymod/structure_analysis.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/modules/mol/alg/pymod/structure_analysis.py b/modules/mol/alg/pymod/structure_analysis.py
index 761a30807..7cbd0dd4b 100644
--- a/modules/mol/alg/pymod/structure_analysis.py
+++ b/modules/mol/alg/pymod/structure_analysis.py
@@ -113,3 +113,19 @@ def CalculateBestFitPlane(sele1):
   f=GetFrameFromEntity(eh)
   return f.GetODRPlane(sele1)
 
+def CalculateHelixAxis(sele1):
+  """
+  This function calculates the best fit cylinder to the CA atoms in sele1,
+  and returns its axis as a Line3.  residues should be ordered correctly
+  in the EntityView.
+  Input:
+    sele1 : EntityView
+  It returns a geom::Line3
+  """
+  if not sele1.IsValid():
+    print 'invalid view'
+    return
+  eh=sele1.GetHandle()
+  f=GetFrameFromEntity(eh)
+  return f.FitCylinder(sele1)
+
-- 
GitLab