def best_model(seq2hmm):
for seq in seq2hmm:<EOL><INDENT>best = []<EOL>for model in seq2hmm[seq]:<EOL><INDENT>best.append([model, sorted([i[-<NUM_LIT:1>] for i in seq2hmm[seq][model]], reverse = True)[<NUM_LIT:0>]])<EOL><DEDENT>best_model = sorted(best, key = itemgetter(<NUM_LIT:1>), reverse = True)[<NUM_LIT:0>][<NUM_LIT:0>]<EOL>seq2hmm[seq] = [best_model] + [seq2hmm[seq][best_model]]<EOL><DEDENT>return seq2hmm<EOL>
determine the best model: archaea, bacteria, eukarya (best score)