def ribosomal(scaffolds, DBdir, min_hits, evalue_thresh, bit_thresh,method = '<STR_LIT>', threads = <NUM_LIT:6>,max_hits = <NUM_LIT:1>, max_hits_rp = <NUM_LIT:1>, max_errors = <NUM_LIT>):
<EOL>rps, rp_db = find_databases(DBdir)<EOL>searches = [[rp, search(scaffolds, rp_db[rp], method = method, threads = str(threads), max_hits = <NUM_LIT:10>)]<EOL>for rp in rp_db]<EOL>scaffolds, scaffold2rp = scaffold_hits(searches, scaffolds, max_hits)<EOL>print('<STR_LIT>' % ('<STR_LIT:\t>'.join(rps)))<EOL>for scaffold, block infind_ribosomal(rps, scaffolds, scaffold2rp, min_hits, max_hits_rp, max_errors):<EOL><INDENT>id_rps = []<EOL>for rp in rps:<EOL><INDENT>if rp in block:<EOL><INDENT>id_rps.append(block[rp][<NUM_LIT:0>].split()[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>id_rps.append('<STR_LIT:->')<EOL><DEDENT><DEDENT>print('<STR_LIT>' % (scaffold, '<STR_LIT:\t>'.join(id_rps)))<EOL><DEDENT>
find ribosomal proteins
max_hits = maximum number of blast hits to consider for an orf
              if 1, only consider best blast hit for each ORF
max_hits_rp = maximum number of hits to consider per ribosomal protein per scaffold
                 if 1, only consider best RP match to contig
max_errors = maximum number of errors when looking for block of proteins (e.g. out of order or gap)