def print_table(seqs, id2name, name):
itable = open('<STR_LIT>' % (name.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>]), '<STR_LIT:w>')<EOL>print('<STR_LIT:\t>'.join(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']), file=itable)<EOL>for seq, info in list(seqs.items()):<EOL><INDENT>gene, model, insertions = info<EOL>name = id2name[seq]<EOL>for i, ins in enumerate(insertions, <NUM_LIT:1>):<EOL><INDENT>gene_pos, model_pos, length, iseq,orfs, introns, orfs_b, introns_b, orf_annotations = ins<EOL>for orf in orfs:<EOL><INDENT>parts = orf[<NUM_LIT:0>].split()<EOL>annotation = orf_annotations[parts[<NUM_LIT:0>].split('<STR_LIT:>>')[<NUM_LIT:1>]]<EOL>orf[<NUM_LIT:0>] = '<STR_LIT>' % (parts[<NUM_LIT:0>], annotation, '<STR_LIT:U+0020>'.join(parts[<NUM_LIT:1>:]))<EOL><DEDENT>gene_pos = '<STR_LIT:->'.join([str(j) for j in gene_pos])<EOL>if orfs_b is True or introns_b is True:<EOL><INDENT>orfs_introns_b = True<EOL><DEDENT>else:<EOL><INDENT>orfs_introns_b = False<EOL><DEDENT>out = [name, gene, model, i, gene_pos, model_pos, length, orfs_b, introns_b, orfs_introns_b]<EOL>out.append('<STR_LIT:|>'.join(iseq))<EOL>out.append('<STR_LIT:|>'.join(['<STR_LIT:|>'.join(orf) for orf in orfs]))<EOL>out.append('<STR_LIT:|>'.join(['<STR_LIT:|>'.join(intron) for intron in introns]))<EOL>print('<STR_LIT:\t>'.join([str(i) for i in out]), file=itable)<EOL><DEDENT><DEDENT>itable.close()<EOL>
print table of results
# seqs[id] = [gene, model, [[i-gene_pos, i-model_pos, i-length, iseq, [orfs], [introns], orfs?, introns?], ...]]