def numDomtblout(domtblout, numHits, evalueT, bitT, sort):
if sort is True:<EOL><INDENT>for hit in numDomtblout_sort(domtblout, numHits, evalueT, bitT):<EOL><INDENT>yield hit<EOL><DEDENT>return<EOL><DEDENT>header = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>']<EOL>yield header<EOL>prev, hits = None, []<EOL>for line in domtblout:<EOL><INDENT>if line.startswith('<STR_LIT:#>'):<EOL><INDENT>continue<EOL><DEDENT>line = line.strip().split()<EOL>desc = '<STR_LIT:U+0020>'.join(line[<NUM_LIT>:])<EOL>line = line[<NUM_LIT:0>:<NUM_LIT>]<EOL>line.append(desc)<EOL>ID = line[<NUM_LIT:0>] + line[<NUM_LIT:9>]<EOL>line[<NUM_LIT:11>], line[<NUM_LIT>] = float(line[<NUM_LIT:11>]), float(line[<NUM_LIT>])<EOL>evalue, bitscore = line[<NUM_LIT:11>], line[<NUM_LIT>]<EOL>line[<NUM_LIT:11>], line[<NUM_LIT>] = evalue, bitscore<EOL>if ID != prev:<EOL><INDENT>if len(hits) > <NUM_LIT:0>:<EOL><INDENT>for hit in top_hits(hits, numHits, <NUM_LIT>, 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>, True):<EOL><INDENT>yield hit<EOL><DEDENT>
parse hmm domain table output
this version is faster but does not work unless the table is sorted