def print_seqs(seqs, id2name, name):
orfs = open('<STR_LIT>' % (name.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>]), '<STR_LIT:w>')<EOL>introns = open('<STR_LIT>' % (name.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>]), '<STR_LIT:w>')<EOL>insertions = open('<STR_LIT>' % (name.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>]), '<STR_LIT:w>')<EOL>for seq in seqs:<EOL><INDENT>for i, ins in enumerate(seqs[seq][<NUM_LIT:2>], <NUM_LIT:1>):<EOL><INDENT>model_pos = ins[<NUM_LIT:1>]<EOL>if ins[<NUM_LIT:6>] is True: <EOL><INDENT>for orf in ins[<NUM_LIT:4>]:<EOL><INDENT>orf_info = orf[<NUM_LIT:0>].split('<STR_LIT:>>')[<NUM_LIT:1>].split()<EOL>id = orf_info[<NUM_LIT:0>].split('<STR_LIT:_>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>name = id2name[id]<EOL>annotation = orf_info[<NUM_LIT:1>]<EOL>strand = orf_info[<NUM_LIT:7>]<EOL>if strand == '<STR_LIT:1>':<EOL><INDENT>strand = '<STR_LIT:+>'<EOL><DEDENT>else:<EOL><INDENT>strand = '<STR_LIT:->'<EOL><DEDENT>start, stop = sorted([int(orf_info[<NUM_LIT:3>]), int(orf_info[<NUM_LIT:5>])])<EOL>header = '<STR_LIT>'% (name, i, annotation, strand, start, stop, model_pos)<EOL>print('<STR_LIT:\n>'.join([header, orf[<NUM_LIT:1>]]), file=orfs)<EOL><DEDENT><DEDENT>if ins[<NUM_LIT:7>] is True: <EOL><INDENT>for intron in ins[<NUM_LIT:5>]:<EOL><INDENT>id, type, strand, pos = intron[<NUM_LIT:0>].split('<STR_LIT:>>', <NUM_LIT:1>)[<NUM_LIT:1>].split()<EOL>name = id2name[id.split('<STR_LIT:_>')[<NUM_LIT:0>]]<EOL>header = '<STR_LIT>'% (name, i, type, strand, pos, model_pos)<EOL>print('<STR_LIT:\n>'.join([header, intron[<NUM_LIT:1>]]), file=introns)<EOL><DEDENT><DEDENT>insertion = ins[<NUM_LIT:3>]<EOL>id, info = insertion[<NUM_LIT:0>].split('<STR_LIT:>>')[<NUM_LIT:1>].split('<STR_LIT:U+0020>', <NUM_LIT:1>)<EOL>name = id2name[id.split('<STR_LIT:_>')[<NUM_LIT:0>]]<EOL>header = '<STR_LIT>' % (name, info)<EOL>print('<STR_LIT:\n>'.join([header, insertion[<NUM_LIT:1>]]), file=insertions)<EOL><DEDENT><DEDENT>insertions.close()        <EOL>orfs.close()<EOL>introns.close()<EOL>
print fasta of introns and ORFs
# seqs[id] = [gene, model, [[i-gene_pos, i-model_pos, i-length, iseq, [orfs], [introns], orfs?, introns?, [orf annotations]], ...]]