def six_frame(genome, table, minimum = <NUM_LIT:10>):
for seq in parse_fasta(genome):<EOL><INDENT>dna = Seq(seq[<NUM_LIT:1>].upper().replace('<STR_LIT>', '<STR_LIT:T>'), IUPAC.ambiguous_dna)<EOL>counter = <NUM_LIT:0><EOL>for sequence in ['<STR_LIT:f>', dna], ['<STR_LIT>', dna.reverse_complement()]:<EOL><INDENT>direction, sequence = sequence<EOL>for frame in range(<NUM_LIT:0>, <NUM_LIT:3>):<EOL><INDENT>for prot insequence[frame:].translate(table = table, to_stop = False).split('<STR_LIT:*>'):<EOL><INDENT>if len(prot) < minimum:<EOL><INDENT>continue<EOL><DEDENT>counter += <NUM_LIT:1><EOL>header = '<STR_LIT>' %(seq[<NUM_LIT:0>].split()[<NUM_LIT:0>], counter, table, frame+<NUM_LIT:1>,direction, '<STR_LIT:U+0020>'.join(seq[<NUM_LIT:0>].split()[<NUM_LIT:1>:]))<EOL>yield [header, prot]<EOL><DEDENT><DEDENT><DEDENT><DEDENT>
translate each sequence into six reading frames