def scaffold_hits(searches, fasta, max_hits):
<EOL>scaffolds = {}<EOL>for seq in parse_fasta(fasta):<EOL><INDENT>scaffold = seq[<NUM_LIT:0>].split()[<NUM_LIT:0>].split('<STR_LIT:>>', <NUM_LIT:1>)[<NUM_LIT:1>].rsplit('<STR_LIT:_>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>if scaffold not in scaffolds:<EOL><INDENT>scaffolds[scaffold] = <NUM_LIT:0><EOL><DEDENT>scaffolds[scaffold] += <NUM_LIT:1><EOL><DEDENT>s2rp = {s: {r[<NUM_LIT:0>]: []<EOL>for r in searches}<EOL>for s in scaffolds}<EOL>for search in searches:<EOL><INDENT>rp, blast = search<EOL>hits = [i for i in numblast(open(blast), max_hits, evalue_thresh, bit_thresh)]<EOL>for hit in hits:<EOL><INDENT>s = hit[<NUM_LIT:0>].split()[<NUM_LIT:0>].rsplit('<STR_LIT:_>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>hit[<NUM_LIT:10>], hit[<NUM_LIT:11>] = float(hit[<NUM_LIT:10>]), float(hit[<NUM_LIT:11>])<EOL>s2rp[s][rp].append(hit)<EOL><DEDENT><DEDENT>return scaffolds, s2rp<EOL>
get hits from each search against each RP
scaffolds[scaffold] = # ORfs
s2rp[scaffold] = {rp:[hits]}