Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mrdna
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
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
tbgl
tools
mrdna
Commits
e09f423a
Commit
e09f423a
authored
6 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
fixup: Updated method of adding atomistic DNA nucleotides, including orientation
parent
39425b0c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CanonicalNucleotideAtoms.py
+3
-2
3 additions, 2 deletions
CanonicalNucleotideAtoms.py
segmentmodel.py
+7
-2
7 additions, 2 deletions
segmentmodel.py
with
10 additions
and
4 deletions
CanonicalNucleotideAtoms.py
+
3
−
2
View file @
e09f423a
...
@@ -59,8 +59,9 @@ class Nucleotide(Group):
...
@@ -59,8 +59,9 @@ class Nucleotide(Group):
return
seg
.
_get_atomic_nucleotide
(
nt_idx
,
is_fwd
)
return
seg
.
_get_atomic_nucleotide
(
nt_idx
,
is_fwd
)
class
CanonicalNucleotideFactory
(
Group
):
class
CanonicalNucleotideFactory
(
Group
):
# DefaultOrientation = rotationAboutAxis([0,0,1], 180)
DefaultOrientation
=
rotationAboutAxis
([
0
,
0
,
1
],
180
).
dot
(
DefaultOrientation
=
rotationAboutAxis
([
1
,
0
,
0
],
180
)
rotationAboutAxis
([
1
,
0
,
0
],
180
))
def
__init__
(
self
,
prefix
,
seq
):
def
__init__
(
self
,
prefix
,
seq
):
self
.
sequence
=
seq
# TODO: used?
self
.
sequence
=
seq
# TODO: used?
self
.
resname
=
resnames
[
seq
]
self
.
resname
=
resnames
[
seq
]
...
...
This diff is collapsed.
Click to expand it.
segmentmodel.py
+
7
−
2
View file @
e09f423a
...
@@ -408,24 +408,29 @@ class Segment(ConnectableElement, Group):
...
@@ -408,24 +408,29 @@ class Segment(ConnectableElement, Group):
def
contour_to_orientation
(
self
,
s
):
def
contour_to_orientation
(
self
,
s
):
assert
(
isinstance
(
s
,
float
)
or
isinstance
(
s
,
int
)
or
len
(
s
)
==
1
)
# TODO make vectorized version
assert
(
isinstance
(
s
,
float
)
or
isinstance
(
s
,
int
)
or
len
(
s
)
==
1
)
# TODO make vectorized version
orientation
=
None
orientation
=
None
if
self
.
quaternion_spline_params
is
None
:
if
self
.
quaternion_spline_params
is
None
:
axis
=
self
.
contour_to_tangent
(
s
)
axis
=
self
.
contour_to_tangent
(
s
)
axis
=
axis
/
np
.
linalg
.
norm
(
axis
)
axis
=
axis
/
np
.
linalg
.
norm
(
axis
)
rotAxis
=
np
.
cross
(
axis
,
np
.
array
((
0
,
0
,
1
)))
rotAxis
=
np
.
cross
(
axis
,
np
.
array
((
0
,
0
,
1
)))
rotAxisL
=
np
.
linalg
.
norm
(
rotAxis
)
rotAxisL
=
np
.
linalg
.
norm
(
rotAxis
)
theta
=
np
.
arcsin
(
rotAxisL
)
if
rotAxisL
>
0.001
:
if
rotAxisL
>
0.001
:
theta
=
np
.
arcsin
(
rotAxisL
)
orientation0
=
rotationAboutAxis
(
rotAxis
/
rotAxisL
,
theta
*
180
/
np
.
pi
,
normalizeAxis
=
False
)
orientation0
=
rotationAboutAxis
(
rotAxis
/
rotAxisL
,
theta
*
180
/
np
.
pi
,
normalizeAxis
=
False
)
else
:
else
:
orientation0
=
np
.
eye
(
3
)
if
axis
.
dot
(
np
.
array
((
0
,
0
,
1
)))
>
0
:
orientation0
=
np
.
eye
(
3
)
else
:
orientation0
=
rotationAboutAxis
(
np
.
array
((
1
,
0
,
0
)),
180
,
normalizeAxis
=
False
)
orientation
=
rotationAboutAxis
(
axis
,
self
.
twist_per_nt
*
self
.
contour_to_nt_pos
(
s
),
normalizeAxis
=
False
)
orientation
=
rotationAboutAxis
(
axis
,
self
.
twist_per_nt
*
self
.
contour_to_nt_pos
(
s
),
normalizeAxis
=
False
)
orientation
=
orientation
.
dot
(
orientation0
)
orientation
=
orientation
.
dot
(
orientation0
)
else
:
else
:
q
=
interpolate
.
splev
(
s
,
self
.
quaternion_spline_params
)
q
=
interpolate
.
splev
(
s
,
self
.
quaternion_spline_params
)
if
len
(
q
)
>
1
:
q
=
np
.
array
(
q
).
T
# TODO: is this needed?
if
len
(
q
)
>
1
:
q
=
np
.
array
(
q
).
T
# TODO: is this needed?
orientation
=
quaternion_to_matrix
(
q
)
orientation
=
quaternion_to_matrix
(
q
)
return
orientation
return
orientation
def
get_contour_sorted_connections_and_locations
(
self
,
type_
):
def
get_contour_sorted_connections_and_locations
(
self
,
type_
):
...
...
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