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

Segmentmodel_from_lists will now guess stacks based on connectivity if not supplied

parent 4526e407
......@@ -261,7 +261,18 @@ def model_from_basepair_stack_3prime(coordinate, basepair, stack, three_prime,
raise ValueError("The 'orientation' array is not properly formatted")
if stack is None:
stack = find_stacks(coordinate, orientation)
if orientation is not None:
stack = find_stacks(coordinate, orientation)
else:
## Guess stacking based on 3' connectivity
stack = np.array(three_prime,dtype=np.int) # Assume nts on 3' ends are stacked
_stack_below = _three_prime_list_to_five_prime(stack)
_has_bp = (basepair >= 0)
_nostack = np.where( (stack == -1)*_has_bp )[0]
_has_stack_below = _stack_below[basepair[_nostack]] >= 0
_nostack2 = _nostack[_has_stack_below]
stack[_nostack2] = basepair[_stack_below[basepair[_nostack2]]]
else:
try:
stack = np.array(stack,dtype=np.int)
......
Markdown is supported
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