diff --git a/dnarbd/segmentmodel.py b/dnarbd/segmentmodel.py index 6dbe41714a6237616ed72270af946945e44a5f19..fa053566e48655fdc075dc72deb94373ecd9bfe2 100644 --- a/dnarbd/segmentmodel.py +++ b/dnarbd/segmentmodel.py @@ -206,19 +206,22 @@ class SegmentParticle(PointParticle): def get_intrahelical_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: if b.get_contour_position(self.parent) > self.contour_position: return b def get_intrahelical_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: if b.get_contour_position(self.parent) < self.contour_position: return b def _neighbor_should_be_added(self,b): + if type(self.parent) != type(b.parent): + return True + c1 = self.contour_position c2 = b.get_contour_position(self.parent) if c2 < c1: @@ -241,8 +244,8 @@ class SegmentParticle(PointParticle): add1 = self._neighbor_should_be_added(b) add2 = b._neighbor_should_be_added(self) if add1 and add2: - assert(len(b.intrahelical_neighbors) <= 1) - assert(len(self.intrahelical_neighbors) <= 1) + # assert(len(b.intrahelical_neighbors) <= 1) + # assert(len(self.intrahelical_neighbors) <= 1) self.intrahelical_neighbors.append(b) b.intrahelical_neighbors.append(self)