Commit 1e2394ef authored by cmaffeo2's avatar cmaffeo2
Browse files

Added support for having multiple intrahelical connections from a single...

Added support for having multiple intrahelical connections from a single "location" in a segment; allows two ssDNA strands to emerge from the ends of a dsDNA segment
parent b631e30f
...@@ -206,19 +206,22 @@ class SegmentParticle(PointParticle): ...@@ -206,19 +206,22 @@ class SegmentParticle(PointParticle):
def get_intrahelical_above(self): def get_intrahelical_above(self):
""" Returns bead directly above self """ """ Returns bead directly above self """
assert( len(self.intrahelical_neighbors) <= 2 ) # assert( len(self.intrahelical_neighbors) <= 2 )
for b in self.intrahelical_neighbors: for b in self.intrahelical_neighbors:
if b.get_contour_position(self.parent) > self.contour_position: if b.get_contour_position(self.parent) > self.contour_position:
return b return b
def get_intrahelical_below(self): def get_intrahelical_below(self):
""" Returns bead directly below self """ """ Returns bead directly below self """
assert( len(self.intrahelical_neighbors) <= 2 ) # assert( len(self.intrahelical_neighbors) <= 2 )
for b in self.intrahelical_neighbors: for b in self.intrahelical_neighbors:
if b.get_contour_position(self.parent) < self.contour_position: if b.get_contour_position(self.parent) < self.contour_position:
return b return b
def _neighbor_should_be_added(self,b): def _neighbor_should_be_added(self,b):
if type(self.parent) != type(b.parent):
return True
c1 = self.contour_position c1 = self.contour_position
c2 = b.get_contour_position(self.parent) c2 = b.get_contour_position(self.parent)
if c2 < c1: if c2 < c1:
...@@ -241,8 +244,8 @@ class SegmentParticle(PointParticle): ...@@ -241,8 +244,8 @@ class SegmentParticle(PointParticle):
add1 = self._neighbor_should_be_added(b) add1 = self._neighbor_should_be_added(b)
add2 = b._neighbor_should_be_added(self) add2 = b._neighbor_should_be_added(self)
if add1 and add2: if add1 and add2:
assert(len(b.intrahelical_neighbors) <= 1) # assert(len(b.intrahelical_neighbors) <= 1)
assert(len(self.intrahelical_neighbors) <= 1) # assert(len(self.intrahelical_neighbors) <= 1)
self.intrahelical_neighbors.append(b) self.intrahelical_neighbors.append(b)
b.intrahelical_neighbors.append(self) b.intrahelical_neighbors.append(self)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment