def parse_insertion(insertion, gff):
offset = insertion['<STR_LIT>']<EOL>for ins in parse_fasta(insertion['<STR_LIT>'].split('<STR_LIT:|>')):<EOL><INDENT>strand = insertion['<STR_LIT>']<EOL>ID = ins[<NUM_LIT:0>].split('<STR_LIT:>>')[<NUM_LIT:1>].split()[<NUM_LIT:0>]<EOL>Start, End = [int(i) for i in ins[<NUM_LIT:0>].split('<STR_LIT>', <NUM_LIT:1>)[<NUM_LIT:1>].split()[<NUM_LIT:0>].split('<STR_LIT:->')]<EOL>Start, End = abs(Start + offset), abs(End + offset)<EOL>if strand == '<STR_LIT:->':<EOL><INDENT>Start, End = End, Start<EOL><DEDENT>gff['<STR_LIT>'].append(insertion['<STR_LIT>'])<EOL>gff['<STR_LIT:source>'].append(insertion['<STR_LIT:source>'])<EOL>gff['<STR_LIT>'].append('<STR_LIT>')<EOL>gff['<STR_LIT:start>'].append(Start)<EOL>gff['<STR_LIT:end>'].append(End)<EOL>gff['<STR_LIT>'].append('<STR_LIT:.>')<EOL>gff['<STR_LIT>'].append(strand) <EOL>gff['<STR_LIT>'].append('<STR_LIT:.>')<EOL>gff['<STR_LIT>'].append('<STR_LIT>' % (ID))<EOL><DEDENT>return gff<EOL>
parse insertion to gff format