def get_selected_runs(sub, ref):
    """
    Returns the positions in ref, which are covered by the subsequence sub.
    Returns None if sub is not a subsequence of ref
    """
    indices = []
    sub_pos = 0
    for ref_pos in range(len(ref)):
        if sub_pos >= len(sub):
            break
        if ref[ref_pos] == sub[sub_pos]:
            indices.append(ref_pos)
            sub_pos += 1
    if sub_pos < len(sub):
        return None
    else:
        return indices