def insertions_from_masked(seq):
insertions = []<EOL>prev = True<EOL>for i, base in enumerate(seq):<EOL><INDENT>if base.isupper() and prev is True:<EOL><INDENT>insertions.append([])<EOL>prev = False<EOL><DEDENT>elif base.islower():<EOL><INDENT>insertions[-<NUM_LIT:1>].append(i)<EOL>prev = True<EOL><DEDENT><DEDENT>return [[min(i), max(i)] for i in insertions if i != []]<EOL>
get coordinates of insertions from insertion-masked sequence