def seq_info(names, id2names, insertions, sequences):
seqs = {} <EOL>for name in names:<EOL><INDENT>id = id2names[name]<EOL>gene = name.split('<STR_LIT>', <NUM_LIT:1>)[<NUM_LIT:0>].rsplit('<STR_LIT:U+0020>', <NUM_LIT:1>)[<NUM_LIT:1>]<EOL>model = name.split('<STR_LIT>', <NUM_LIT:1>)[<NUM_LIT:1>].split('<STR_LIT:=>', <NUM_LIT:1>)[<NUM_LIT:1>].split()[<NUM_LIT:0>]<EOL>i_gene_pos = insertions[id] <EOL>i_model_pos = name.split('<STR_LIT>', <NUM_LIT:1>)[<NUM_LIT:1>].split('<STR_LIT>')[<NUM_LIT:1>].split()[<NUM_LIT:0>].split('<STR_LIT:;>') <EOL>i_info = []<EOL>for i, ins in enumerate(i_gene_pos):<EOL><INDENT>model_pos = i_model_pos[i].split('<STR_LIT:->')[<NUM_LIT:1>].split('<STR_LIT:(>')[<NUM_LIT:0>]<EOL>length = i_model_pos[i].split('<STR_LIT:(>')[<NUM_LIT:1>].split('<STR_LIT:)>')[<NUM_LIT:0>]<EOL>iheader = '<STR_LIT>'% (id, (i + <NUM_LIT:1>), (i + <NUM_LIT:1>), ins[<NUM_LIT:0>], ins[<NUM_LIT:1>], model_pos)<EOL>iseq = sequences[id][<NUM_LIT:1>][ins[<NUM_LIT:0>]:(ins[<NUM_LIT:1>] + <NUM_LIT:1>)]<EOL>iseq = [iheader, iseq]<EOL>info = [ins, model_pos, length, iseq, [], []]<EOL>i_info.append(info)<EOL><DEDENT>seqs[id] = [gene, model, i_info]<EOL><DEDENT>return seqs<EOL>
get insertion information from header