Skip to content
Snippets Groups Projects
Commit a9358ea9 authored by cmaffeo2's avatar cmaffeo2
Browse files

Fixed error in list reader that would create intrahelical connections between...

Fixed error in list reader that would create intrahelical connections between double- and single-stranded segments; now using sscrossover connections
parent 10bf2a60
No related branches found
No related tags found
No related merge requests found
1.0a.dev180
1.0a.dev187
......@@ -332,7 +332,7 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
_has_bp = (bps >= 0)
_has_stack = (stack >= 0)
_stack_has_basepair = (bps[stack] >= 0) * _has_stack
stack = np.where( (stack[bps[stack]] == bps) * _has_bp * _has_stack * _has_bp,
stack = np.where( (stack[bps[stack]] == bps) * _has_bp * _has_stack * _stack_has_basepair,
stack, -np.ones(len(stack),dtype=int) )
five_prime = _three_prime_list_to_five_prime(three_prime)
......@@ -421,7 +421,7 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
is_terminal1 = (nt1,f1) in ((0,0),(seg1.num_nt-1,1))
is_terminal2 = (nt2,f2) in ((0,1),(seg2.num_nt-1,0))
# devlogger.info(seg1,seg2, r1, r2, is_terminal1, is_terminal2)
# devlogger.info(f'{(hmap[r1],hmap[r2], r1, r2, is_terminal1, is_terminal2)}')
if is_terminal1 or is_terminal2:
""" Ensure that we don't have three-way dsDNA junctions """
if is_terminal1 and (bps[r1] >= 0) and (five_prime[bps[r1]] >= 0) and (three_prime[r1] >= 0):
......@@ -437,7 +437,8 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
if is_terminal1 and is_terminal2 and (r1 not in explicitly_unstacked) and (r2 not in explicitly_unstacked):
end1 = seg1.end3 if f1 else seg1.start3
end2 = seg2.start5 if f2 else seg2.end5
seg1._connect_ends( end1, end2, type_='intrahelical')
_type = 'intrahelical' if type(seg1) == type(seg2) else 'sscrossover'
seg1._connect_ends( end1, end2, type_=_type)
else:
seg1.add_crossover(nt1,seg2,nt2,[f1,f2],type_="terminal_crossover")
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment