utils/infernal_utils.py
def generate_bed_detail_file_with_ss(inf_output_file, dest_dir, ss_notation="wuss"):
    """
    Parses Infernal's detailed output and generates a bed file in detailed format
    with the last column containing the secondary structure string in the specified
    notation.

    inf_output_file: Infernal's output file (-o option)
    dest_dir: The path to the output directory
    ss_notation: A string indicating the the notation in which to output the
    secondary structure string (wuss or dbn)

    return: Void
    """

    scores = infernal_output_parser(inf_output_file, ss_notation=ss_notation)

    filename = os.path.basename(inf_output_file).partition('.')[0]
    fp_out = open(os.path.join(dest_dir, filename + '.bed'), 'w')

    for score in scores:
        # write output to file
        if score["strand"] == '+':
            fp_out.write(
                "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (score["rfamseq_acc"], score["start"], score["end"],
                                                      score["rna_type"], score["bit_score"], score["strand"],
                                                      score["e_value"], score["sec_struct"]))
        else:
            fp_out.write(
                "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (score["rfamseq_acc"], score["end"], score["start"],
                                                      score["rna_type"], score["bit_score"], score["strand"],
                                                      score["e_value"], score["sec_struct"]))
    fp_out.close()

    Parses Infernal's detailed output and generates a bed file in detailed format
    with the last column containing the secondary structure string in the specified
    notation.

    inf_output_file: Infernal's output file (-o option)
    dest_dir: The path to the output directory
    ss_notation: A string indicating the the notation in which to output the
    secondary structure string (wuss or dbn)

    return: Void
    
Parses Infernal's detailed output and generates a bed file in detailed format
with the last column containing the secondary structure string in the specified
notation.

Infernal's output file (-o option)
dest_dir: The path to the output directory
ss_notation: A string indicating the the notation in which to output the
secondary structure string (wuss or dbn)

Void
Parses Infernal ' s detailed output and generates a bed file in detailed format with the last column containing the secondary structure string in the specified notation . Infernal ' s output file ( - o option ) dest_dir : The path to the output directory ss_notation : A string indicating the the notation in which to output the secondary structure string ( wuss or dbn ) Void
def generate_bed_detail_file_with_ss(inf_output_file, dest_dir, ss_notation="wuss"):
    scores = infernal_output_parser(inf_output_file, ss_notation=ss_notation)
    filename = os.path.basename(inf_output_file).partition('.')[0]
    fp_out = open(os.path.join(dest_dir, filename + '.bed'), 'w')
    for score in scores:
        if score["strand"] == '+':
            fp_out.write(
                "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (score["rfamseq_acc"], score["start"], score["end"],
                                                      score["rna_type"], score["bit_score"], score["strand"],
                                                      score["e_value"], score["sec_struct"]))
        else:
            fp_out.write(
                "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % (score["rfamseq_acc"], score["end"], score["start"],
                                                      score["rna_type"], score["bit_score"], score["strand"],
                                                      score["e_value"], score["sec_struct"]))
    fp_out.close()
def generate_bed_detail_file_with_ss ( inf_output_file , dest_dir , ss_notation = "wuss" ) : scores = infernal_output_parser ( inf_output_file , ss_notation = ss_notation ) filename = os . path . basename ( inf_output_file ) . partition ( '.' ) [ 0 ] fp_out = open ( os . path . join ( dest_dir , filename + '.bed' ) , 'w' ) for score in scores : if score [ "strand" ] == '+' : fp_out . write ( "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ( score [ "rfamseq_acc" ] , score [ "start" ] , score [ "end" ] , score [ "rna_type" ] , score [ "bit_score" ] , score [ "strand" ] , score [ "e_value" ] , score [ "sec_struct" ] ) ) else : fp_out . write ( "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ( score [ "rfamseq_acc" ] , score [ "end" ] , score [ "start" ] , score [ "rna_type" ] , score [ "bit_score" ] , score [ "strand" ] , score [ "e_value" ] , score [ "sec_struct" ] ) ) fp_out . close ( )
Parses Infernal's detailed output and generates a bed file in detailed format
with the last column containing the secondary structure string in the specified
notation.
Parses Infernal ' s detailed output and generates a bed file in detailed format with the last column containing the secondary structure string in the specified notation .
"""
    Parses Infernal's detailed output and generates a bed file in detailed format
    with the last column containing the secondary structure string in the specified
    notation.

    inf_output_file: Infernal's output file (-o option)
    dest_dir: The path to the output directory
    ss_notation: A string indicating the the notation in which to output the
    secondary structure string (wuss or dbn)

    return: Void
    """ # write output to file
inf_output_file
dest_dir
ss_notation