def align2local(seq):
    """
    Returns list such that

    'ATG---CTG-CG' ==> [0,1,2,2,2,3,4,5,5,6,7]

    Used to go from align -> local space
    """
    i = -1
    lookup = []
    for c in seq:
        if c != "-":
            i += 1
        lookup.append(i)
    return lookup