utils/genome_search_utils.py
def extract_job_stats(lsf_output_file):
    """
    Loops over the out_dir which contains all .out LSF job files, parses the files and returns job
    details such as, start and end dates, max required memory etc.

    out_dir: A directory where job .out files have been stored
    """

    gen_exec_stats = {}

    # open lsf output file and read contents
    fp = open(os.path.join(input, file), 'r')
    content = fp.readlines()
    fp.close()

    # get reference proteome id
    upid = file.partition('.')[0]
    stats = {}

    for line in content:
        if line.find("Started") != -1:
            line = line.strip().split(' ')
            stats["start_date"] = ' '.join(line[2:])

        elif line.find("Results") != -1:
            line = line.strip().split(' ')
            stats["end_date"] = ' '.join(line[3:])

        elif line.find("CPU time") != -1:
            line = line.strip().split(' ')
            stats["cpu_time"] = float(line[17])  # /60.0

        elif line.find("Max Memory") != -1:
            line = line.strip().split(' ')
            stats["mem"] = line[15]

        elif line.find("Max Processes") != -1:
            line = line.strip().split(' ')
            stats["max_proc"] = line[len(line) - 1]

        elif line.find("Max Threads") != -1:
            line = line.strip().split(' ')
            stats["max_threads"] = line[len(line) - 1]

    gen_exec_stats[upid] = stats

    return gen_exec_stats

    Loops over the out_dir which contains all .out LSF job files, parses the files and returns job
    details such as, start and end dates, max required memory etc.

    out_dir: A directory where job .out files have been stored
    
Loops over the out_dir which contains all .out LSF job files, parses the files and returns job
details such as, start and end dates, max required memory etc.

A directory where job .out files have been stored
Loops over the out_dir which contains all . out LSF job files parses the files and returns job details such as start and end dates max required memory etc . A directory where job . out files have been stored
def extract_job_stats(lsf_output_file):
    gen_exec_stats = {}
    fp = open(os.path.join(input, file), 'r')
    content = fp.readlines()
    fp.close()
    upid = file.partition('.')[0]
    stats = {}
    for line in content:
        if line.find("Started") != -1:
            line = line.strip().split(' ')
            stats["start_date"] = ' '.join(line[2:])
        elif line.find("Results") != -1:
            line = line.strip().split(' ')
            stats["end_date"] = ' '.join(line[3:])
        elif line.find("CPU time") != -1:
            line = line.strip().split(' ')
            stats["cpu_time"] = float(line[17])  
        elif line.find("Max Memory") != -1:
            line = line.strip().split(' ')
            stats["mem"] = line[15]
        elif line.find("Max Processes") != -1:
            line = line.strip().split(' ')
            stats["max_proc"] = line[len(line) - 1]
        elif line.find("Max Threads") != -1:
            line = line.strip().split(' ')
            stats["max_threads"] = line[len(line) - 1]
    gen_exec_stats[upid] = stats
    return gen_exec_stats
def extract_job_stats ( lsf_output_file ) : gen_exec_stats = { } fp = open ( os . path . join ( input , file ) , 'r' ) content = fp . readlines ( ) fp . close ( ) upid = file . partition ( '.' ) [ 0 ] stats = { } for line in content : if line . find ( "Started" ) != - 1 : line = line . strip ( ) . split ( ' ' ) stats [ "start_date" ] = ' ' . join ( line [ 2 : ] ) elif line . find ( "Results" ) != - 1 : line = line . strip ( ) . split ( ' ' ) stats [ "end_date" ] = ' ' . join ( line [ 3 : ] ) elif line . find ( "CPU time" ) != - 1 : line = line . strip ( ) . split ( ' ' ) stats [ "cpu_time" ] = float ( line [ 17 ] ) elif line . find ( "Max Memory" ) != - 1 : line = line . strip ( ) . split ( ' ' ) stats [ "mem" ] = line [ 15 ] elif line . find ( "Max Processes" ) != - 1 : line = line . strip ( ) . split ( ' ' ) stats [ "max_proc" ] = line [ len ( line ) - 1 ] elif line . find ( "Max Threads" ) != - 1 : line = line . strip ( ) . split ( ' ' ) stats [ "max_threads" ] = line [ len ( line ) - 1 ] gen_exec_stats [ upid ] = stats return gen_exec_stats
Loops over the out_dir which contains all .out LSF job files, parses the files and returns job
details such as, start and end dates, max required memory etc.
Loops over the out_dir which contains all . out LSF job files parses the files and returns job details such as start and end dates max required memory etc .
"""
    Loops over the out_dir which contains all .out LSF job files, parses the files and returns job
    details such as, start and end dates, max required memory etc.

    out_dir: A directory where job .out files have been stored
    """ # open lsf output file and read contents # get reference proteome id # /60.0
lsf_output_file