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
8d210e3b
Commit
8d210e3b
authored
Sep 04, 2018
by
cmaffeo2
Browse files
Fixed a bug in the function that locates where a bead is within the contour of a non-parent segment
parent
1e2394ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnarbd/segmentmodel.py
View file @
8d210e3b
...
...
@@ -279,23 +279,25 @@ class SegmentParticle(PointParticle):
assert
(
sign
in
(
1
,
-
1
)
)
if
distance
<
cutoff
:
# TODO: check if this does anything
cutoff
=
distance
return
[[
distance
,
contour_in_seg
+
sign
*
seg
.
nt_pos_to_contour
(
distance
)]]
return
[[
distance
,
contour_in_seg
+
sign
*
seg
.
nt_pos_to_contour
(
distance
)]]
,
[(
seg
,
contour_in_seg
,
distance
)]
if
distance
>
cutoff
:
return
None
return
None
,
None
ret_list
=
[]
hist_list
=
[]
## Find intrahelical locations in seg that we might pass through
for
c
,
A
,
B
in
seg
.
get_connections_and_locations
(
"intrahelical"
):
if
B
.
container
in
visited_segs
:
continue
dx
=
seg
.
contour_to_nt_pos
(
np
.
abs
(
A
.
address
-
contour_in_seg
),
round_nt
=
False
)
results
=
descend_search_tree
(
B
.
container
,
B
.
address
,
dx
=
seg
.
contour_to_nt_pos
(
A
.
address
,
round_nt
=
False
)
-
seg
.
contour_to_nt_pos
(
contour_in_seg
,
round_nt
=
False
)
dx
=
np
.
abs
(
dx
)
results
,
history
=
descend_search_tree
(
B
.
container
,
B
.
address
,
distance
+
dx
,
visited_segs
+
[
seg
]
)
if
results
is
not
None
:
ret_list
.
extend
(
results
)
return
ret_list
hist_list
.
extend
(
history
)
return
ret_list
,
hist_list
results
=
descend_search_tree
(
self
.
parent
,
self
.
contour_position
)
results
,
history
=
descend_search_tree
(
self
.
parent
,
self
.
contour_position
)
if
results
is
None
or
len
(
results
)
==
0
:
raise
Exception
(
"Could not find location in segment"
)
# TODO better error
return
sorted
(
results
,
key
=
lambda
x
:
x
[
0
])[
0
][
1
]
...
...
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