Пример #1
0
def main():
    try:
        fetch_and_run_jobs_forever()
    except KeyboardInterrupt:
        sys.exit(1)
    except:
        email.SendTracebackEmail("webtlsmdrund.py exception")
        raise
Пример #2
0
def main():
    try:
        daemon_main()
    except KeyboardInterrupt:
        sys.stdout.write('interrupted, exiting...\n')
        raise SystemExit
    except:
        email.SendTracebackEmail("webtlsmdd.py exception")
        raise
Пример #3
0
def main():
    try:
        daemon_main()
    except:
        email.SendTracebackEmail("webtlsmdd.py exception")
        raise
Пример #4
0
def analysis_main(struct_path, opt_dict):
    """Runs the TLS analysis on a structure.
    """
    ## get source filename split up for use in
    ## constructing output file names
    struct_path = os.path.realpath(struct_path)

    directory, filename = os.path.split(struct_path)
    basename, ext = os.path.splitext(filename)

    ## set option vars and defaults
    chain_ids = opt_dict.get("-c")

    #conf.globalconf.recombination = opt_dict.has_key("-e")
    if opt_dict.has_key("-e"):
        conf.globalconf.recombination = True

    if opt_dict.has_key("-o"):
        try:
            nsmooth = int(opt_dict["-o"])
        except ValueError:
            print "[ERROR] -o argument must be an integer"
            usage()
        conf.globalconf.adp_smoothing = nsmooth

    if opt_dict.has_key("-u"):
        print opt_dict["-u"]
        try:
            min_subseg = int(opt_dict["-u"])
        except ValueError:
            print "[ERROR] -u argument must be an integer"
            usage()
        conf.globalconf.min_subsegment_size = min_subseg

    if opt_dict.has_key("-n"):
        try:
            num_segs = int(opt_dict["-n"])
        except ValueError:
            print "[ERROR] -n argument must be an integer"
            usage()
        conf.globalconf.nparts = num_segs

    if opt_dict.has_key("-t"):
        tpath, tchain_id = opt_dict["-t"].split(":")
        conf.globalconf.target_struct_path = tpath
        conf.globalconf.target_struct_chain_id = tchain_id

    if opt_dict.has_key("-v"):
        conf.globalconf.verbose = True

    if opt_dict.has_key("-s"):
        conf.globalconf.use_svg = True

    if opt_dict.has_key("-k"):
        conf.globalconf.skip_jmol = True

    if opt_dict.has_key("-x"):
        conf.globalconf.webtlsmdd = opt_dict["-x"]

    if opt_dict.has_key("-j"):
        conf.globalconf.job_id = opt_dict["-j"]

    if opt_dict.has_key("-i"):
        conf.globalconf.struct_id = opt_dict["-i"]

    ## set the TLS model to use
    if opt_dict.has_key("-m"):
        tls_model = opt_dict.get("-m").upper()
        if tls_model in ["ANISO", "ISOT", "NLANISO", "NLISOT"]:
            conf.globalconf.tls_model = tls_model
        else:
            print "[ERROR] Invalid TLS Model: %s" % (tls_model)
            usage()

    ## weighting scheme
    if opt_dict.has_key("-w"):
        val = opt_dict["-w"].upper()
        val = val.upper()
        if val == "IUISO":
            conf.globalconf.weight_model = val
        else:
            print "[ERROR] Invalid Weight Model: %s" % (val)
            usage()

    ## atoms to include
    if opt_dict.has_key("-a"):
        val = opt_dict["-a"].upper()
        if val not in ["ALL", "MAINCHAIN"]:
            usage()
        conf.globalconf.include_atoms = val

    if opt_dict.has_key("--skip-html"):
        conf.globalconf.skip_html = True

    if opt_dict.has_key("--generate-jmol-viewer"):
        conf.globalconf.generate_jmol_view = True

    if opt_dict.has_key("--generate-jmol-animate"):
        conf.globalconf.generate_jmol_animate = True

    if opt_dict.has_key("--generate-histogram"):
        conf.globalconf.generate_histogram = True

    if opt_dict.has_key("--user-comment="):
        conf.globalconf.user_comment = opt_dict["--user-comment="]

    if opt_dict.has_key("--help") or opt_dict.has_key("-h"):
        usage()

    try:
        tlsmd_analysis.TLSMD_Main(struct_file_path=struct_path,
                                  sel_chain_ids=chain_ids,
                                  html_report_dir=opt_dict.get("-r"))
    except:
        if opt_dict.has_key("-b"):
            email.SendTracebackEmail("tlsmd.py traceback")
        raise