def _filter_seqs(fn):
out_file = op.splitext(fn)[<NUM_LIT:0>] + "<STR_LIT>"<EOL>idx = <NUM_LIT:0><EOL>if not file_exists(out_file):<EOL><INDENT>with open(out_file, '<STR_LIT:w>') as out_handle:<EOL><INDENT>with open(fn) as in_handle:<EOL><INDENT>for line in in_handle:<EOL><INDENT>if line.startswith("<STR_LIT:@>") or line.startswith("<STR_LIT:>>"):<EOL><INDENT>fixed_name = _make_unique(line.strip(), idx)<EOL>seq = in_handle.next().strip()<EOL>counts = _get_freq(fixed_name)<EOL>if len(seq) < <NUM_LIT> and (counts > <NUM_LIT:1> or counts == <NUM_LIT:0>):<EOL><INDENT>idx += <NUM_LIT:1><EOL>print(fixed_name, file=out_handle, end="<STR_LIT:\n>")<EOL>print(seq, file=out_handle, end="<STR_LIT:\n>")<EOL><DEDENT>if line.startswith("<STR_LIT:@>"):<EOL><INDENT>in_handle.next()<EOL>in_handle.next()<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return out_file<EOL>
Convert names of sequences to unique ids