def numBlast(blast, numHits, evalueT = False, bitT = False, sort = False):
if sort is True:<EOL><INDENT>for hit in numBlast_sort(blast, numHits, evalueT, bitT):<EOL><INDENT>yield hit<EOL><DEDENT>return<EOL><DEDENT>header = ['<STR_LIT>', '<STR_LIT:target>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>yield header<EOL>prev, hits = None, []<EOL>for line in blast:<EOL><INDENT>line = line.strip().split('<STR_LIT:\t>')<EOL>ID = line[<NUM_LIT:0>]<EOL>line[<NUM_LIT:10>], line[<NUM_LIT:11>] = float(line[<NUM_LIT:10>]), float(line[<NUM_LIT:11>])<EOL>evalue, bit = line[<NUM_LIT:10>], line[<NUM_LIT:11>]<EOL>if ID != prev:<EOL><INDENT>if len(hits) > <NUM_LIT:0>:<EOL><INDENT>for hit in top_hits(hits, numHits, <NUM_LIT:11>, True):<EOL><INDENT>yield hit<EOL><DEDENT><DEDENT>hits = []<EOL><DEDENT>if evalueT == False and bitT == False:<EOL><INDENT>hits.append(line)<EOL><DEDENT>elif evalue <= evalueT and bitT == False:<EOL><INDENT>hits.append(line)<EOL><DEDENT>elif evalue <= evalueT and bit >= bitT:<EOL><INDENT>hits.append(line)<EOL><DEDENT>elif evalueT == False and bit >= bitT:<EOL><INDENT>hits.append(line)<EOL><DEDENT>prev = ID<EOL><DEDENT>for hit in top_hits(hits, numHits, <NUM_LIT:11>, True):<EOL><INDENT>yield hit<EOL><DEDENT>
parse b6 output