scripts/processing/threshold_selector.py
def extract_scores_dict_from_outlist_file(scores_file):
    """
    Parses the outlist or species file produced by rfsearch
    and returns all bit_scores above the REVERSED cutoff

    scores_file: The path to rfsearch outlist or species file

    return: A list of all bit scores above REVERSED
    """

    scores = {'SEED': [], 'FULL': [], 'OTHER': [], "REV": -1}
    
    outlist_fp = open(scores_file, 'r')

    for line in outlist_fp:
        if line[0] != '#':
            line = [x for x in line.strip().split(' ') if x!='']
            scores[line[2]].append(float(line[0]))
        else:
            # if we reached REVERSED line, we treat everything as TNs
            # break and return
            if line.find("BEST REVERSED") != -1:
                br_evalue = line.strip().split(' ')[-2]
                scores["REV"] = br_evalue
            break

    outlist_fp.close()

    return scores

    Parses the outlist or species file produced by rfsearch
    and returns all bit_scores above the REVERSED cutoff

    scores_file: The path to rfsearch outlist or species file

    return: A list of all bit scores above REVERSED
    
Parses the outlist or species file produced by rfsearch
and returns all bit_scores above the REVERSED cutoff

The path to rfsearch outlist or species file

A list of all bit scores above REVERSED
Parses the outlist or species file produced by rfsearch and returns all bit_scores above the REVERSED cutoff The path to rfsearch outlist or species file A list of all bit scores above REVERSED
def extract_scores_dict_from_outlist_file(scores_file):
    scores = {'SEED': [], 'FULL': [], 'OTHER': [], "REV": -1}
    outlist_fp = open(scores_file, 'r')
    for line in outlist_fp:
        if line[0] != '#':
            line = [x for x in line.strip().split(' ') if x!='']
            scores[line[2]].append(float(line[0]))
        else:
            if line.find("BEST REVERSED") != -1:
                br_evalue = line.strip().split(' ')[-2]
                scores["REV"] = br_evalue
            break
    outlist_fp.close()
    return scores
def extract_scores_dict_from_outlist_file ( scores_file ) : scores = { 'SEED' : [ ] , 'FULL' : [ ] , 'OTHER' : [ ] , "REV" : - 1 } outlist_fp = open ( scores_file , 'r' ) for line in outlist_fp : if line [ 0 ] != '#' : line = [ x for x in line . strip ( ) . split ( ' ' ) if x != '' ] scores [ line [ 2 ] ] . append ( float ( line [ 0 ] ) ) else : if line . find ( "BEST REVERSED" ) != - 1 : br_evalue = line . strip ( ) . split ( ' ' ) [ - 2 ] scores [ "REV" ] = br_evalue break outlist_fp . close ( ) return scores
Parses the outlist or species file produced by rfsearch
and returns all bit_scores above the REVERSED cutoff
Parses the outlist or species file produced by rfsearch and returns all bit_scores above the REVERSED cutoff
"""
    Parses the outlist or species file produced by rfsearch
    and returns all bit_scores above the REVERSED cutoff

    scores_file: The path to rfsearch outlist or species file

    return: A list of all bit scores above REVERSED
    """ # if we reached REVERSED line, we treat everything as TNs # break and return
scores_file