From 556b37e1eebcb3400ad7b61e3be3a4b84ee50b06 Mon Sep 17 00:00:00 2001 From: Chris Maffeo <cmaffeo2@illinois.edu> Date: Tue, 18 Sep 2018 16:39:44 -0500 Subject: [PATCH] Improved strand routing algorithm when a 5prime or 3prime location has a connection --- mrdna/segmentmodel.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mrdna/segmentmodel.py b/mrdna/segmentmodel.py index 650e5a5..24633ae 100644 --- a/mrdna/segmentmodel.py +++ b/mrdna/segmentmodel.py @@ -696,7 +696,7 @@ class Segment(ConnectableElement, Group): if l.is_3prime_side_of_connection: continue ## Stop if we found the 3prime end - if l.on_fwd_strand == is_fwd and l.type_ == "3prime": + if l.on_fwd_strand == is_fwd and l.type_ == "3prime" and l.connection is None: # print(" found end at",l) return pos, None, None, None, None @@ -2429,18 +2429,23 @@ class SegmentModel(ArbdModel): break except: print("Unexpected error:", sys.exc_info()[0]) + # import pdb + # pdb.set_trace() + # seg.get_strand_segment(pos, is_fwd, move_at_least) + # strand.add_dna(seg, pos, end_pos, is_fwd) raise if next_seg is None: break else: seg,pos,is_fwd = (next_seg, next_pos, next_dir) + strand.history = list(history) return history strand_counter = 0 history = [] for seg in self.segments: - locs = seg.get_5prime_locations() + locs = filter(lambda l: l.connection is None, seg.get_5prime_locations()) if locs is None: continue # for pos, is_fwd in locs: for l in locs: -- GitLab