def _clean_hits(reads):
new_reads = defaultdict(realign)<EOL>for r in reads:<EOL><INDENT>world = {}<EOL>sc = <NUM_LIT:0><EOL>for p in reads[r].precursors:<EOL><INDENT>world[p] = reads[r].precursors[p].get_score(len(reads[r].sequence))<EOL>if sc < world[p]:<EOL><INDENT>sc = world[p]<EOL><DEDENT><DEDENT>new_reads[r] = reads[r]<EOL>for p in world:<EOL><INDENT>logger.debug("<STR_LIT>" % (r, p, world[p]))<EOL>if sc != world[p]:<EOL><INDENT>logger.debug("<STR_LIT>" % (r, p, world[p]))<EOL>new_reads[r].remove_precursor(p)<EOL><DEDENT><DEDENT><DEDENT>return new_reads<EOL>
Select only best matches