def find_orfs(fa, seqs):
faa = '<STR_LIT>' % (fa)<EOL>fna = '<STR_LIT>' % (fa)<EOL>gbk = '<STR_LIT>' % (fa)<EOL>if os.path.exists(faa) is False:<EOL><INDENT>p = subprocess.Popen('<STR_LIT>'% (fa, faa, fna, gbk), shell = True)<EOL>p.communicate()<EOL><DEDENT>for orf in parse_fasta(faa):<EOL><INDENT>if orf[<NUM_LIT:0>] == []:<EOL><INDENT>continue<EOL><DEDENT>id = orf[<NUM_LIT:0>].split('<STR_LIT:>>')[<NUM_LIT:1>].split('<STR_LIT:_>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>pos = sorted([int(i) for i in orf[<NUM_LIT:0>].split()[<NUM_LIT:2>:<NUM_LIT:5>] if i != '<STR_LIT:#>'])<EOL>if id not in seqs:<EOL><INDENT>continue<EOL><DEDENT>for i, ins in enumerate(seqs[id][<NUM_LIT:2>]):<EOL><INDENT>if check_overlap(pos, ins, <NUM_LIT>) is True:<EOL><INDENT>seqs[id][<NUM_LIT:2>][i][<NUM_LIT:4>].append(orf)<EOL><DEDENT><DEDENT><DEDENT>return seqs, faa<EOL>
find orfs and see if they overlap with insertions
# seqs[id] = [gene, model, [[i-gene_pos, i-model_pos, i-length, iseq, [orfs], [introns]], ...]]