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
64462997
Commit
64462997
authored
4 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
Fixed ENM so it produces bonds across intrahelical connections
parent
8fc5e3da
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mrdna/model/CanonicalNucleotideAtoms.py
+10
-5
10 additions, 5 deletions
mrdna/model/CanonicalNucleotideAtoms.py
mrdna/segmentmodel.py
+30
-0
30 additions, 0 deletions
mrdna/segmentmodel.py
with
40 additions
and
5 deletions
mrdna/model/CanonicalNucleotideAtoms.py
+
10
−
5
View file @
64462997
...
...
@@ -39,10 +39,7 @@ class Nucleotide(Group):
return
self
.
get_intrahelical_nucleotide
(
-
1
)
def
get_intrahelical_nucleotide
(
self
,
offset
=
1
):
"""
Returns nucleotide in same strand-side of helix with some offset along 5
'
-to-3
'
TODO: Does not yet cross intrahelical connections
"""
"""
Returns nucleotide in same strand-side of helix with some offset along 5
'
-to-3
'
"""
strand_piece
=
self
.
parent
is_fwd
=
strand_piece
.
is_fwd
...
...
@@ -53,9 +50,17 @@ class Nucleotide(Group):
else
:
nt_idx
=
hi
-
strand_piece
.
children
.
index
(
self
)
-
offset
seg
=
strand_piece
.
segment
if
nt_idx
<
0
or
nt_idx
>=
seg
.
num_nt
:
return
None
"""
Cross intrahelical connections if possible
"""
ret
=
seg
.
_ntpos_to_seg_and_ntpos
(
nt_idx
,
is_fwd
)
if
ret
is
None
:
ret
=
seg
.
_ntpos_to_seg_and_ntpos
(
nt_idx
,
is_fwd
)
return
None
else
:
seg
,
nt_idx
,
is_fwd
=
ret
return
seg
.
_get_atomic_nucleotide
(
nt_idx
,
is_fwd
)
else
:
return
seg
.
_get_atomic_nucleotide
(
nt_idx
,
is_fwd
)
...
...
This diff is collapsed.
Click to expand it.
mrdna/segmentmodel.py
+
30
−
0
View file @
64462997
...
...
@@ -718,6 +718,36 @@ class Segment(ConnectableElement, Group):
return
orientation
def
_ntpos_to_seg_and_ntpos
(
self
,
nt_pos
,
is_fwd
=
True
,
visited_segs
=
tuple
()):
"""
Cross intrahelical to obtain a tuple of the segment nucleotide position
"""
"""
TODO: This function could perhaps replace parts of SegmentParticle.get_contour_position
"""
if
nt_pos
>=
0
and
nt_pos
<
self
.
num_nt
:
return
(
self
,
nt_pos
,
is_fwd
)
else
:
c
,
A
,
B
=
self
.
get_contour_sorted_connections_and_locations
(
type_
=
'
intrahelical
'
)[
0
if
nt_pos
<
0
else
-
1
]
## Special logic for circular segments
assert
(
A
.
container
==
self
)
if
A
.
container
==
B
.
container
:
if
(
nt_pos
<
0
and
A
.
address
>
B
.
address
)
or
(
nt_pos
>=
self
.
num_nt
and
A
.
address
<
B
.
address
):
A
,
B
=
(
B
,
A
)
other_seg
=
B
.
container
if
A
.
address
==
(
0
if
nt_pos
<
0
else
1
)
and
other_seg
not
in
visited_segs
:
## Cross the crossover
other_pos
=
(
nt_pos
-
self
.
num_nt
)
if
nt_pos
>=
self
.
num_nt
else
-
nt_pos
-
1
if
B
.
address
>
0.5
:
other_pos
=
(
other_seg
.
num_nt
-
1
)
-
other_pos
other_fwd
=
not
is_fwd
if
A
.
address
==
B
.
address
else
is_fwd
return
other_seg
.
_ntpos_to_seg_and_ntpos
(
other_pos
,
other_fwd
,
list
(
visited_segs
)
+
[
self
])
else
:
## Could not find a path to nt_pos
return
None
assert
(
False
)
def
get_contour_sorted_connections_and_locations
(
self
,
type_
):
sort_fn
=
lambda
c
:
c
[
1
].
address
cl
=
self
.
get_connections_and_locations
(
type_
)
...
...
This diff is collapsed.
Click to expand it.
cmaffeo2
@cmaffeo2
mentioned in commit
d27cbd81
·
4 years ago
mentioned in commit
d27cbd81
mentioned in commit d27cbd81a070c18c0dbfaf59dbda6fd3e0ff765b
Toggle commit list
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