Esempio n. 1
0
def chain_type_string(chain_sizes):
    listx = []
    for c in chain_sizes.split(';'):
        chid, length, selected, type = misc.parse_chains(c)
        if selected == "1":
            listx.append("%s:%s" % (chid, type))
    return ";".join(listx)
Esempio n. 2
0
def chain_type_string(chain_sizes):
    listx = []
    for c in chain_sizes.split(';'):
        chid, length, selected, type = misc.parse_chains(c)
        if selected == "1":
            listx.append("%s:%s" % (chid, type))
    return ";".join(listx)
Esempio n. 3
0
def get_job(mysql):
    """Remove the top job from the queue file and return it.
    """
    ## NOTE: This is the very first step in the entire webtlsmdrund.py process
    try:
        job_id = mysql.get_next_queued_job_id()
    except socket.error:
        log_write("[ERROR] unable to connect to MySQL")
        raise SystemExit

    if job_id == "":
        return None

    ## change state of the job and re-load to catch any updates which may
    ## have occurred
    if mysql.job_set_state(job_id, "running") == False:
        return None
    mysql.job_set_state(job_id, "running")

    jdict = mysql.job_get_dict(job_id)
    if jdict == None:
        return None

    ## Construct the run command for this job
    tlsmd = [conf.TLSMD_PROGRAM_PATH, "-b", "-rANALYSIS"]

    ## Job ID
    tlsmd.append("-j%s" % (job_id))

    ## override PDB ID
    tlsmd.append("-i%s" % (jdict["structure_id"]))

    ## Jmol/Histogram features
    if jdict["generate_jmol_view"] == True:
        tlsmd.append("--generate-jmol-viewer")
    if jdict["generate_jmol_animate"] == True:
        tlsmd.append("--generate-jmol-animate")
    if jdict["generate_histogram"] == True:
        tlsmd.append("--generate-histogram")

    ## plot style
    if jdict["plot_format"] == "SVG":
        tlsmd.append("-s")

    ## select TLS model
    tls_model = jdict["tls_model"]
    if tls_model == "ISOT":
        tlsmd.append("-mISOT")
    else:
        tlsmd.append("-mANISO")

    ## set maximum number of segments
    tlsmd.append("-n%s" % (jdict["nparts"]))

    ## select LSQ weighting
    #tlsmd.append("-w%s" % (jdict["weight"]))

    ## select chain IDs to analyze
    cids = []
    chains = jdict["chain_sizes"].rstrip(";")
    for c in chains.split(';'):
        chid, length, selected, type = misc.parse_chains(c)
        if selected == "1":
            cids.append(chid)
    tlsmd.append("-c%s" % (",".join(cids)))

    ## included atoms
    tlsmd.append("-a%s" % (jdict["include_atoms"]))

    ## input PDB file
    tlsmd.append(conf.PDB_FILENAME)

    jdict["tlsmd"] = tlsmd
    return jdict
Esempio n. 4
0
def get_job(mysql):
    """Remove the top job from the queue file and return it.
    """
    ## NOTE: This is the very first step in the entire webtlsmdrund.py process
    try:
        job_id = mysql.get_next_queued_job_id()
    except socket.error:
        log_write("[ERROR] unable to connect to MySQL")
        raise SystemExit

    if job_id == "":
        return None

    ## change state of the job and re-load to catch any updates which may
    ## have occurred
    if mysql.job_set_state(job_id, "running") == False:
        return None
    mysql.job_set_state(job_id, "running")

    jdict = mysql.job_get_dict(job_id)
    if jdict == None:
        return None

    ## Construct the run command for this job
    tlsmd = [conf.TLSMD_PROGRAM_PATH, "-b", "-rANALYSIS" ]

    ## Job ID
    tlsmd.append("-j%s" % (job_id))

    ## override PDB ID
    tlsmd.append("-i%s" % (jdict["structure_id"]))

    ## Jmol/Histogram features
    if jdict["generate_jmol_view"] == True:
        tlsmd.append("--generate-jmol-viewer")
    if jdict["generate_jmol_animate"] == True:
        tlsmd.append("--generate-jmol-animate")
    if jdict["generate_histogram"] == True:
        tlsmd.append("--generate-histogram")

    ## plot style
    if jdict["plot_format"] == "SVG":
        tlsmd.append("-s")

    ## select TLS model
    tls_model = jdict["tls_model"]
    if tls_model == "ISOT":
        tlsmd.append("-mISOT")
    else:
        tlsmd.append("-mANISO")

    ## set maximum number of segments
    tlsmd.append("-n%s" % (jdict["nparts"]))

    ## select LSQ weighting
    #tlsmd.append("-w%s" % (jdict["weight"]))

    ## select chain IDs to analyze
    cids = []
    chains = jdict["chain_sizes"].rstrip(";")
    for c in chains.split(';'):
        chid, length, selected, type = misc.parse_chains(c)
        if selected == "1":
            cids.append(chid)
    tlsmd.append("-c%s" % (",".join(cids)))

    ## included atoms
    tlsmd.append("-a%s" % (jdict["include_atoms"]))

    ## input PDB file
    tlsmd.append(conf.PDB_FILENAME)

    jdict["tlsmd"] = tlsmd
    return jdict