diff --git a/mrdna/segmentmodel.py b/mrdna/segmentmodel.py index 36fa2c7324fa6771c32bffd0917e2e29d2f09dc6..80436df0192b94cff995566b429bcc8da72be6bf 100644 --- a/mrdna/segmentmodel.py +++ b/mrdna/segmentmodel.py @@ -1175,10 +1175,8 @@ class SingleStrandedSegment(Segment): def add_crossover(self, nt, other, other_nt, strands_fwd=(True,False), nt_on_5prime=True, type_='sscrossover'): """ Add a crossover between two helices """ - ## Validate other, nt, other_nt - ## TODO - - ## TODO: fix direction + ## TODO Validate other, nt, other_nt + if nt in (0,1,self.num_nt) and other_nt in (0,1,other.num_nt): if nt_on_5prime == True: other_end = other.start5 if strands_fwd[1] else other.end5 @@ -1193,7 +1191,7 @@ class SingleStrandedSegment(Segment): # ## Ensure connections occur at ends, otherwise the structure doesn't make sense # # assert(np.isclose(c1,0) or np.isclose(c1,1)) # assert(np.isclose(nt,0) or np.isclose(nt,self.num_nt-1)) - if nt == 0 and (nt_on_5prime or self.num_nt > 1): + if nt == 0 and (self.num_nt > 1 or not nt_on_5prime): c1 = 0 elif nt == self.num_nt-1: c1 = 1