ribolands/utils.py
def make_loop_index(ss):
    """Returns a list of loop indices to see where new base-pairs can be formed.
    """
    loop, stack = [], []
    nl, L = 0, 0
    for i, char in enumerate(ss):
        if char == '(':
            nl += 1
            L = nl
            stack.append(i)
        loop.append(L)
        if char == ')':
            _ = stack.pop()
            try:
                L = loop[stack[-1]]
            except IndexError:
                L = 0
    return loop
Returns a list of loop indices to see where new base-pairs can be formed.
    
Returns a list of loop indices to see where new base-pairs can be formed.
Returns a list of loop indices to see where new base - pairs can be formed .
def make_loop_index(ss):
    loop, stack = [], []
    nl, L = 0, 0
    for i, char in enumerate(ss):
        if char == '(':
            nl += 1
            L = nl
            stack.append(i)
        loop.append(L)
        if char == ')':
            _ = stack.pop()
            try:
                L = loop[stack[-1]]
            except IndexError:
                L = 0
    return loop
def make_loop_index ( ss ) : loop , stack = [ ] , [ ] nl , L = 0 , 0 for i , char in enumerate ( ss ) : if char == '(' : nl += 1 L = nl stack . append ( i ) loop . append ( L ) if char == ')' : _ = stack . pop ( ) try : L = loop [ stack [ - 1 ] ] except IndexError : L = 0 return loop
Returns a list of loop indices to see where new base-pairs can be formed.
Returns a list of loop indices to see where new base - pairs can be formed .
"""Returns a list of loop indices to see where new base-pairs can be formed.
    """
ss