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
9810a61e
Verified
Commit
9810a61e
authored
1 year ago
by
Xavier Robin
Committed by
Xavier Robin
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix deprecation warning about invalid escape sequence
parent
8892bb91
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/pymod/structure_analysis.py
+2
-2
2 additions, 2 deletions
modules/mol/alg/pymod/structure_analysis.py
modules/mol/alg/pymod/trajectory_analysis.py
+12
-12
12 additions, 12 deletions
modules/mol/alg/pymod/trajectory_analysis.py
with
14 additions
and
14 deletions
modules/mol/alg/pymod/structure_analysis.py
+
2
−
2
View file @
9810a61e
...
...
@@ -71,7 +71,7 @@ def GetMinDistBetwCenterOfMassAndView(sele1,sele2):
:type sele1: :class:`~ost.mol.EntityView`
:type sele2: :class:`~ost.mol.EntityView`
:return: distance (\ :class:`float`\ )
:return: distance (
\
\
:class:`float`
\
\
)
"""
if
not
sele1
.
IsValid
()
and
sele2
.
IsValid
():
print
(
'
invalid view
'
)
...
...
@@ -155,7 +155,7 @@ def CalculateHelixAxis(sele1):
def
CalculateDistanceDifferenceMatrix
(
sele1
,
sele2
):
"""
This function calculates the pairwise distance differences between two selections (\ :class:`~ost.mol.EntityView`\ ).
This function calculates the pairwise distance differences between two selections (
\
\
:class:`~ost.mol.EntityView`
\
\
).
The two selections 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)||
...
...
This diff is collapsed.
Click to expand it.
modules/mol/alg/pymod/trajectory_analysis.py
+
12
−
12
View file @
9810a61e
...
...
@@ -70,8 +70,8 @@ def RMSD_Matrix_From_Traj(t,sele,first=0,last=-1,align=True,align_sele=None):
:type first: :class:`int`
:type last: :class:`int`
:return: Returns a numpy N\ :subscript:`frames`\ xN\ :subscript:`frames` matrix,
where N\ :subscript:`frames` is the number of frames.
:return: Returns a numpy N
\
\
:subscript:`frames`
\
\
xN
\
\
:subscript:`frames` matrix,
where N
\
\
:subscript:`frames` is the number of frames.
"""
if
not
align_sele
:
align_sele
=
sele
try
:
...
...
@@ -98,8 +98,8 @@ def PairwiseDistancesFromTraj(t,sele,first=0,last=-1,seq_sep=1):
"""
This function calculates the distances between any pair of atoms in **sele**
with sequence separation larger than **seq_sep** from a trajectory **t**.
It return a matrix containing one line for each atom pair and N\ :subscript:`frames` columns, where
N\ :subscript:`frames` is the number of frames in the trajectory.
It return a matrix containing one line for each atom pair and N
\
\
:subscript:`frames` columns, where
N
\
\
:subscript:`frames` is the number of frames in the trajectory.
:param t: the trajectory
:param sele: the selection used to determine the atom pairs
...
...
@@ -112,7 +112,7 @@ def PairwiseDistancesFromTraj(t,sele,first=0,last=-1,seq_sep=1):
:type last: :class:`int`
:type seq_sep: :class:`int`
:return: a numpy N\ :subscript:`pairs`\ xN\ :subscript:`frames` matrix.
:return: a numpy N
\
\
:subscript:`pairs`
\
\
xN
\
\
:subscript:`frames` matrix.
"""
try
:
import
numpy
as
npy
...
...
@@ -139,10 +139,10 @@ def PairwiseDistancesFromTraj(t,sele,first=0,last=-1,seq_sep=1):
def
DistanceMatrixFromPairwiseDistances
(
distances
,
p
=
2
):
"""
This function calculates an distance matrix M(N\ :subscript:`frames`\ xN\ :subscript:`frames`\ ) from
the pairwise distances matrix D(N\ :subscript:`pairs`\ xN\ :subscript:`frames`\ ), where
N\ :subscript:`frames` is the number of frames in the trajectory
and N\ :subscript:`pairs` the number of atom pairs.
This function calculates an distance matrix M(N
\
\
:subscript:`frames`
\
\
xN
\
\
:subscript:`frames`
\
\
) from
the pairwise distances matrix D(N
\
\
:subscript:`pairs`
\
\
xN
\
\
:subscript:`frames`
\
\
), where
N
\
\
:subscript:`frames` is the number of frames in the trajectory
and N
\
\
:subscript:`pairs` the number of atom pairs.
M[i,j] is the distance between frame i and frame j
calculated as a p-norm of the differences in distances
from the two frames (distance-RMSD for p=2).
...
...
@@ -151,7 +151,7 @@ def DistanceMatrixFromPairwiseDistances(distances,p=2):
:py:func:`~mol.alg.trajectory_analysis.PairwiseDistancesFromTraj`
:param p: exponent used for the p-norm.
:return: a numpy N\ :subscript:`frames`\ xN\ :subscript:`frames` matrix, where N\ :subscript:`frames`
:return: a numpy N
\
\
:subscript:`frames`
\
\
xN
\
\
:subscript:`frames` matrix, where N
\
\
:subscript:`frames`
is the number of frames.
"""
try
:
...
...
@@ -196,7 +196,7 @@ def DistRMSDFromTraj(t,sele,ref_sele,radius=7.0,average=False,seq_sep=4,first=0,
:type last: :class:`int`
:type seq_sep: :class:`int`
:return: a numpy vecor dist_rmsd(N\ :subscript:`frames`).
:return: a numpy vecor dist_rmsd(N
\
\
:subscript:`frames`).
"""
if
not
sele
.
GetAtomCount
()
==
ref_sele
.
GetAtomCount
():
print
(
'
Not same number of atoms in the two views
'
)
...
...
@@ -243,7 +243,7 @@ def AverageDistanceMatrixFromTraj(t,sele,first=0,last=-1):
:type first: :class:`int`
:type last: :class:`int`
:return: a numpy N\ :subscript:`pairs`\ xN\ :subscript:`pairs` matrix, where N\ :subscript:`pairs`
:return: a numpy N
\
\
:subscript:`pairs`
\
\
xN
\
\
:subscript:`pairs` matrix, where N
\
\
:subscript:`pairs`
is the number of atom pairs in **sele**.
"""
try
:
...
...
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