scripts/view/job_dequeuer.py
def job_dequeue_from_file(fam_pend_jobs, out_dir):
    """
    Calls family_view_process based on a list of family job_uuid pairs as
    listed in fam_jobs file

    fam_pend_jobs: A list of all pending rfam jobs obtained from
                   _post_process table export (rfam_acc\tuuid)
    out_dir: Path to output directory where .err and .out will be generated
             upon lsf job completion (to be used for debugging purposes)
    """

    # output file listing all lsf job ids per family accession. To be used as
    # a post-processing step to update rfam_live _post_process table
    fp_out = open(os.path.join(out_dir, "famview_job_ids.txt"), 'w')
    jobs_fp = open(fam_pend_jobs, 'r')

    # create script output directory
    os.mkdir(os.path.join(out_dir, "scripts"))

    # Submit all pending jobs to the cluster
    for job in jobs_fp:

        job = job.strip().split('\t')

        print "job: ", job

        # generate .sh file in FAM_VIEW_DIR on lsf have the outdir specified
        # through command line

        filepath = lsf_script_generator(str(job[0]), str(job[1]), out_dir)

        # if(not os.path.exists(os.path.join(out_dir,str(job[0])))):
        # os.mkdir(os.path.join(out_dir,str(job[0])))

        bsub_cmd = "bsub < %s" % (filepath)

        # submit job and retrieve job_id from shell
        proc = subprocess.Popen(
            bsub_cmd, shell=True, stdout=subprocess.PIPE)

        # get job_id from shell
        job_str = proc.communicate()[0].strip()
        job_id = job_str[5:12]

        # update file
        fp_out.write("%s\t%s\t%s\t%s\n" % (
            str(job[0]), str(job[1]), str(job_id), str(time.strftime('%Y-%m-%d %H:%M:%S'))))

    fp_out.close()

    Calls family_view_process based on a list of family job_uuid pairs as
    listed in fam_jobs file

    fam_pend_jobs: A list of all pending rfam jobs obtained from
                   _post_process table export (rfam_acc\tuuid)
    out_dir: Path to output directory where .err and .out will be generated
             upon lsf job completion (to be used for debugging purposes)
    
Calls family_view_process based on a list of family job_uuid pairs as
listed in fam_jobs file

A list of all pending rfam jobs obtained from
_post_process table export (rfam_acc\tuuid)
out_dir: Path to output directory where .err and .out will be generated
upon lsf job completion (to be used for debugging purposes)
Calls family_view_process based on a list of family job_uuid pairs as listed in fam_jobs file A list of all pending rfam jobs obtained from _post_process table export ( rfam_acc \ tuuid ) out_dir : Path to output directory where . err and . out will be generated upon lsf job completion ( to be used for debugging purposes )
def job_dequeue_from_file(fam_pend_jobs, out_dir):
    fp_out = open(os.path.join(out_dir, "famview_job_ids.txt"), 'w')
    jobs_fp = open(fam_pend_jobs, 'r')
    os.mkdir(os.path.join(out_dir, "scripts"))
    for job in jobs_fp:
        job = job.strip().split('\t')
        print "job: ", job
        filepath = lsf_script_generator(str(job[0]), str(job[1]), out_dir)
        bsub_cmd = "bsub < %s" % (filepath)
        proc = subprocess.Popen(
            bsub_cmd, shell=True, stdout=subprocess.PIPE)
        job_str = proc.communicate()[0].strip()
        job_id = job_str[5:12]
        fp_out.write("%s\t%s\t%s\t%s\n" % (
            str(job[0]), str(job[1]), str(job_id), str(time.strftime('%Y-%m-%d %H:%M:%S'))))
    fp_out.close()
def job_dequeue_from_file ( fam_pend_jobs , out_dir ) : fp_out = open ( os . path . join ( out_dir , "famview_job_ids.txt" ) , 'w' ) jobs_fp = open ( fam_pend_jobs , 'r' ) os . mkdir ( os . path . join ( out_dir , "scripts" ) ) for job in jobs_fp : job = job . strip ( ) . split ( '\t' ) print "job: " , job filepath = lsf_script_generator ( str ( job [ 0 ] ) , str ( job [ 1 ] ) , out_dir ) bsub_cmd = "bsub < %s" % ( filepath ) proc = subprocess . Popen ( bsub_cmd , shell = True , stdout = subprocess . PIPE ) job_str = proc . communicate ( ) [ 0 ] . strip ( ) job_id = job_str [ 5 : 12 ] fp_out . write ( "%s\t%s\t%s\t%s\n" % ( str ( job [ 0 ] ) , str ( job [ 1 ] ) , str ( job_id ) , str ( time . strftime ( '%Y-%m-%d %H:%M:%S' ) ) ) ) fp_out . close ( )
Calls family_view_process based on a list of family job_uuid pairs as
listed in fam_jobs file
Calls family_view_process based on a list of family job_uuid pairs as listed in fam_jobs file
"""
    Calls family_view_process based on a list of family job_uuid pairs as
    listed in fam_jobs file

    fam_pend_jobs: A list of all pending rfam jobs obtained from
                   _post_process table export (rfam_acc\tuuid)
    out_dir: Path to output directory where .err and .out will be generated
             upon lsf job completion (to be used for debugging purposes)
    """ # output file listing all lsf job ids per family accession. To be used as # a post-processing step to update rfam_live _post_process table # create script output directory # Submit all pending jobs to the cluster # generate .sh file in FAM_VIEW_DIR on lsf have the outdir specified # through command line # if(not os.path.exists(os.path.join(out_dir,str(job[0])))): # os.mkdir(os.path.join(out_dir,str(job[0]))) # submit job and retrieve job_id from shell # get job_id from shell # update file
fam_pend_jobs
out_dir