Commit 97f92674 authored by cmaffeo2's avatar cmaffeo2
Browse files

Added convenience function to Segments and SegmentModel to select blunt DNA ends

parent 64462997
......@@ -909,6 +909,17 @@ class Segment(ConnectableElement, Group):
## TODO? ensure that data is consistent before _build_model calls
return sorted(self.get_locations("5prime"),key=lambda x: x.address)
def get_blunt_DNA_ends(self):
if isinstance(self, SingleStrandedSegment): return []
ret = []
cl = self.get_connections_and_locations("intrahelical")
if not any([c[1].address == 0 for c in cl]):
if not any([c[1].address == 1 for c in cl]):
# return [c for c in cl if c[1].address == 0 or c[1].address == 1]
return ret
def iterate_connections_and_locations(self, reverse=False):
## connections to other segments
cl = self.get_contour_sorted_connections_and_locations()
......@@ -2270,6 +2281,9 @@ class SegmentModel(ArbdModel):
def get_blunt_DNA_ends(self):
return sum([s.get_blunt_DNA_ends for s in self.segments],[])
def convert_crossovers_at_ends_beyond_cutoff_to_intrahelical(self,cutoff):
if cutoff < 0:
raise ValueError("Cutoff should be positive!")
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