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
97f92674
Commit
97f92674
authored
Dec 03, 2020
by
cmaffeo2
Browse files
Added convenience function to Segments and SegmentModel to select blunt DNA ends
parent
64462997
Changes
1
Hide whitespace changes
Inline
Side-by-side
mrdna/segmentmodel.py
View file @
97f92674
...
...
@@ -909,6 +909,17 @@ class Segment(ConnectableElement, Group):
## TODO? ensure that data is consistent before _build_model calls
return
sorted
(
self
.
get_locations
(
"5prime"
),
key
=
lambda
x
:
x
.
address
)
def
get_blunt_DNA_ends
(
self
):
if
isinstance
(
self
,
SingleStrandedSegment
):
return
[]
ret
=
[]
cl
=
self
.
get_connections_and_locations
(
"intrahelical"
)
if
not
any
([
c
[
1
].
address
==
0
for
c
in
cl
]):
ret
.
append
((
self
.
start5
,
self
.
start3
,
-
1
))
if
not
any
([
c
[
1
].
address
==
1
for
c
in
cl
]):
ret
.
append
((
self
.
end5
,
self
.
end3
,
1
))
# return [c for c in cl if c[1].address == 0 or c[1].address == 1]
return
ret
def
iterate_connections_and_locations
(
self
,
reverse
=
False
):
## connections to other segments
cl
=
self
.
get_contour_sorted_connections_and_locations
()
...
...
@@ -2270,6 +2281,9 @@ class SegmentModel(ArbdModel):
else
:
seg2
.
connect_start3
(
seg1
.
end5
)
def
get_blunt_DNA_ends
(
self
):
return
sum
([
s
.
get_blunt_DNA_ends
for
s
in
self
.
segments
],[])
def
convert_crossovers_at_ends_beyond_cutoff_to_intrahelical
(
self
,
cutoff
):
if
cutoff
<
0
:
raise
ValueError
(
"Cutoff should be positive!"
)
...
...
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