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
0d3cc3e8
Commit
0d3cc3e8
authored
Jun 13, 2018
by
cmaffeo2
Browse files
Too many beads were being placed in a given contour length
parent
7e1b4ef0
Changes
1
Hide whitespace changes
Inline
Side-by-side
segmentmodel.py
View file @
0d3cc3e8
...
...
@@ -859,11 +859,11 @@ class Segment(ConnectableElement, Group):
if
len
(
existing_beads
)
==
0
or
existing_beads
[
0
].
get_nt_position
(
self
)
>
0.5
:
# if len(existing_beads) > 0:
# assert(existing_beads[0].get_nt_position(self) >= 0.5)
b
=
self
.
_generate_one_bead
(
0
,
0
)
b
=
self
.
_generate_one_bead
(
self
.
nt_pos_to_contour
(
0
)
,
0
)
existing_beads
=
[
b
]
+
existing_beads
if
existing_beads
[
-
1
].
get_nt_position
(
self
)
-
(
self
.
num_nts
-
1
)
<
-
0.5
:
b
=
self
.
_generate_one_bead
(
1
,
0
)
b
=
self
.
_generate_one_bead
(
self
.
nt_pos_to_contour
(
self
.
num_nts
-
1
)
,
0
)
existing_beads
.
append
(
b
)
assert
(
len
(
existing_beads
)
>
1
)
...
...
@@ -1028,7 +1028,8 @@ class DoubleStrandedSegment(Segment):
else
:
end2
.
container
.
_connect
(
end1
.
container
,
Connection
(
end2
,
end1
,
type_
=
type_
),
in_3prime_direction
=
True
)
def
_get_num_beads
(
self
,
contour
,
max_basepairs_per_bead
,
max_nucleotides_per_bead
):
return
int
(
contour
*
self
.
num_nts
//
max_basepairs_per_bead
)
# return int(contour*self.num_nts // max_basepairs_per_bead)
return
int
(
contour
*
(
self
.
num_nts
**
2
/
(
self
.
num_nts
+
1
))
//
max_basepairs_per_bead
)
def
_generate_one_bead
(
self
,
contour_position
,
nts
):
pos
=
self
.
contour_to_position
(
contour_position
)
...
...
@@ -1146,7 +1147,8 @@ class SingleStrandedSegment(Segment):
other
.
_connect
(
self
,
Connection
(
other_loc
,
loc
,
type_
=
"sscrossover"
),
in_3prime_direction
=
True
)
def
_get_num_beads
(
self
,
contour
,
max_basepairs_per_bead
,
max_nucleotides_per_bead
):
return
int
(
contour
*
self
.
num_nts
//
max_nucleotides_per_bead
)
return
int
(
contour
*
(
self
.
num_nts
**
2
/
(
self
.
num_nts
+
1
))
//
max_basepairs_per_bead
)
# return int(contour*self.num_nts // max_nucleotides_per_bead)
def
_generate_one_bead
(
self
,
contour_position
,
nts
):
pos
=
self
.
contour_to_position
(
contour_position
)
...
...
Write
Preview
Supports
Markdown
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