Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tbgl
tools
mrdna
Commits
561b8d26
Commit
561b8d26
authored
Mar 05, 2020
by
cmaffeo2
Browse files
Made an option for specifying a frame range for readAvgArbdCoords
parent
45bbc767
Changes
1
Hide whitespace changes
Inline
Side-by-side
mrdna/arbdmodel/coords.py
View file @
561b8d26
...
...
@@ -163,17 +163,17 @@ def readArbdCoords(fname):
coords
.
append
([
float
(
x
)
for
x
in
line
.
split
()[
1
:]])
return
np
.
array
(
coords
)
def
readAvgArbdCoords
(
psf
,
pdb
,
dcd
,
rmsdThreshold
=
3.5
):
def
readAvgArbdCoords
(
psf
,
pdb
,
dcd
,
rmsdThreshold
=
3.5
,
first_frame
=
0
,
last_frame
=-
1
,
stride
=
1
):
import
MDAnalysis
as
mda
usel
=
mda
.
Universe
(
psf
,
dcd
)
sel
=
usel
.
select_atoms
(
"name D*"
)
# r0 = ref.xyz[0,ids,:]
ts
=
usel
.
trajectory
[
-
1
]
ts
=
usel
.
trajectory
[
last_frame
]
r0
=
sel
.
positions
pos
=
[]
for
t
in
range
(
ts
.
frame
-
1
,
-
1
,
-
1
):
for
t
in
range
(
ts
.
frame
-
1
,
first_frame
-
1
,
-
stride
):
usel
.
trajectory
[
t
]
R
,
comA
,
comB
=
minimizeRmsd
(
sel
.
positions
,
r0
)
r
=
np
.
array
(
[(
r
-
comA
).
dot
(
R
)
+
comB
for
r
in
sel
.
positions
]
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment