Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
846569b3
Commit
846569b3
authored
10 years ago
by
BIOPZ-Johner Niklaus
Browse files
Options
Downloads
Patches
Plain Diff
Added documentation for mol.alg.structure_analysis
parent
94fdba12
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/mol/alg/doc/molalg.rst
+4
-0
4 additions, 0 deletions
modules/mol/alg/doc/molalg.rst
modules/mol/alg/pymod/structure_analysis.py
+67
-37
67 additions, 37 deletions
modules/mol/alg/pymod/structure_analysis.py
with
71 additions
and
37 deletions
modules/mol/alg/doc/molalg.rst
+
4
−
0
View file @
846569b3
...
...
@@ -873,5 +873,9 @@ used to skip frames in the analysis.
.. automodule:: ost.mol.alg.trajectory_analysis
:members:
:mod:`mol.alg.structure_analysis <ost.mol.alg.trajectory_analysis>` -- Functions to analyze structures
=============================================================================================================
.. automodule:: ost.mol.alg.structure_analysis
:members:
This diff is collapsed.
Click to expand it.
modules/mol/alg/pymod/structure_analysis.py
+
67
−
37
View file @
846569b3
"""
Some functions for analyzing tr
ajectori
es
Some functions for analyzing
s
tr
uctur
es
Author: Niklaus Johner
Author: Niklaus Johner
(Niklaus.Johner@unibas.ch)
"""
import
os
import
ost
def
GetFrameFromEntity
(
eh
):
"""
This function returns a CoordFrame from an EntityHandle
Input:
eh : EntityHandle
:param eh:
:type eh: :class:`~ost.mol.EntityHandle`
:return: :class:`ost.mol.CoordFrame`
"""
return
ost
.
mol
.
CreateCoordFrame
(
eh
.
GetAtomPosList
(
ordered_by_index
=
True
))
def
GetDistanceBetwCenterOfMass
(
sele1
,
sele2
):
"""
This function calculates the distance between the centers of mass
of sele1 and sele2, two selections from the same Entity.
Input:
sele1 : EntityView
sele2 : EntityView
of **sele1** and **sele2**, two selections from the same Entity.
:param sele1:
:param sele2:
:type sele1: :class:`~ost.mol.EntityView`
:type sele2: :class:`~ost.mol.EntityView`
:return: :class:`float`
"""
if
not
sele1
.
IsValid
()
and
sele2
.
IsValid
():
print
'
invalid view
'
...
...
@@ -36,10 +42,14 @@ def GetDistanceBetwCenterOfMass(sele1,sele2):
def
GetMinDistanceBetweenViews
(
sele1
,
sele2
):
"""
This function calculates the minimal distance between
sele1 and sele2, two selections from the same Entity.
Input:
sele1 : EntityView
sele2 : EntityView
**sele1** and **sele2**, two selections from the same Entity.
:param sele1:
:param sele2:
:type sele1: :class:`~ost.mol.EntityView`
:type sele2: :class:`~ost.mol.EntityView`
:return: :class:`float`
"""
if
not
sele1
.
IsValid
()
and
sele2
.
IsValid
():
print
'
invalid view
'
...
...
@@ -53,11 +63,15 @@ def GetMinDistanceBetweenViews(sele1,sele2):
def
GetMinDistBetwCenterOfMassAndView
(
sele1
,
sele2
):
"""
This function calculates the minimal distance between sele2 and
the center of mass of sele1, two selections from the same Entity.
Input:
sele1 : EntityView from which the center of mass is taken
sele2 : EntityView
This function calculates the minimal distance between **sele2** and
the center of mass of **sele1**, two selections from the same Entity.
:param sele1: The selection from which the center of mass is taken
:param sele2:
:type sele1: :class:`~ost.mol.EntityView`
:type sele2: :class:`~ost.mol.EntityView`
:return: distance (\ :class:`float`\ )
"""
if
not
sele1
.
IsValid
()
and
sele2
.
IsValid
():
print
'
invalid view
'
...
...
@@ -74,8 +88,11 @@ def GetAlphaHelixContent(sele1):
"""
This function calculates the content of alpha helix in a view.
All residues in the view have to ordered and adjacent (no gaps allowed)
Input:
sele1 : EntityView
:param sele1:
:type sele1: :class:`~ost.mol.EntityView`
:return: :class:`float`
"""
if
not
sele1
.
IsValid
():
print
'
invalid view
'
...
...
@@ -87,10 +104,12 @@ def GetAlphaHelixContent(sele1):
def
CalculateBestFitLine
(
sele1
):
"""
This function calculates the best fit line to the atoms in sele1.
Input:
sele1 : EntityView
It returns a geom::Line3
This function calculates the best fit line to the atoms in **sele1**.
:param sele1:
:type sele1: :class:`~ost.mol.EntityView`
:return: :class:`~ost.geom.Line3`
"""
if
not
sele1
.
IsValid
():
print
'
invalid view
'
...
...
@@ -101,10 +120,12 @@ def CalculateBestFitLine(sele1):
def
CalculateBestFitPlane
(
sele1
):
"""
This function calculates the best fit plane to the atoms in sele1.
Input:
sele1 : EntityView
It returns a geom::Plane
This function calculates the best fit plane to the atoms in **sele1**.
:param sele1:
:type sele1: :class:`~ost.mol.EntityView`
:return: :class:`~ost.geom.Plane`
"""
if
not
sele1
.
IsValid
():
print
'
invalid view
'
...
...
@@ -115,12 +136,14 @@ def CalculateBestFitPlane(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
This function calculates the best fit cylinder to the CA atoms in **sele1**,
and returns its axis. Residues should be ordered correctly
in **sele1**.
:param sele1:
:type sele1: :class:`~ost.mol.EntityView`
:return: :class:`~ost.geom.Line3`
"""
if
not
sele1
.
IsValid
():
print
'
invalid view
'
...
...
@@ -132,10 +155,17 @@ def CalculateHelixAxis(sele1):
def
CalculateDistanceDifferenceMatrix
(
sele1
,
sele2
):
"""
This function calculates the pairwise distance differences between two EntityView
s
.
The two
EntityView
s should have the same number of atoms
This function calculates the pairwise distance differences between two
selections (\ :class:`~ost.mol.
EntityView
`\ )
.
The two
selection
s should have the same number of atoms
It returns an NxN DistanceDifferenceMatrix M (where N is the number of atoms in sele1)
where M[i,j]=(sele2.atoms[i].pos-sele2.atoms[j].pos)-(sele1.atoms[i].pos-sele1.atoms[j].pos)
where M[i,j]=||(sele2.atoms[i].pos-sele2.atoms[j].pos)||-||(sele1.atoms[i].pos-sele1.atoms[j].pos)||
:param sele1:
:param sele2:
:type sele1: :class:`~ost.mol.EntityView`
:type sele2: :class:`~ost.mol.EntityView`
:return: NxN numpy matrix
"""
try
:
import
numpy
as
npy
except
ImportError
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment