Beispiel #1
0
def main(opt):
    logging.getLogger().setLevel(logging.DEBUG if opt.v else logging.INFO)

    base_dict = dict(lazy_wl=opt.lazy_wl,
                     sada=opt.sada,
                     load_cst=opt.load_cst,
                     space_usage=True,
                     time_usage=True,
                     answer=False,
                     runs_progress=opt.runs_progress,
                     ms_progress=opt.ms_progress)
    for i, pref in enumerate(opt.prefixes):
        bpath = os.path.join(opt.base_dir, pref)
        command = MsInterface.command_from_dict(
            dict(s_path=bpath + ".s", t_path=bpath + ".t", **base_dict))

        for j in range(opt.repeat):
            with open(opt.output, 'a') as fd:
                res = get_output(command)
                if i + j == 0:
                    fd.write(res[0] + ",label,b_path\n")
                for line in res[1:]:
                    fd.write(
                        line.replace(" ", "") + ("," + opt.label) +
                        ("," + os.path.basename(bpath)) + "\n")
Beispiel #2
0
def main(opt):
    logging.getLogger().setLevel(logging.DEBUG if opt.v else logging.INFO)

    base_dict = dict(lazy_wl=False,
                     rank_fail=True,
                     use_maxrep=opt.use_maxrep,
                     load_maxrep=opt.load_maxrep,
                     load_cst=opt.load_cst,
                     space_usage=True,
                     time_usage=True,
                     answer=False)
    for i, pref in enumerate(opt.prefixes):
        ispec = MsInput.basedir_form(opt.base_dir, pref)
        command = MsInterface.command_from_dict(
            dict(s_path=ispec.s_path, t_path=ispec.t_path, **base_dict))

        for j in range(opt.repeat):
            with open(opt.output, 'a') as fd:
                res = get_output(command)
                if i + j == 0:
                    fd.write(res[0] + ",label,b_path\n")
                for line in res[1:]:
                    fd.write(
                        line.replace(" ", "") + ("," + opt.label) +
                        ("," + pref) + "\n")
Beispiel #3
0
def fast(opt, ms_input):
    params = dict(lazy_wl=opt.lazy_wl,
                  rank_fail=opt.rank_fail,
                  lca_parents=opt.lca_parents,
                  use_maxrep=opt.use_maxrep,
                  nthreads=opt.nthreads,
                  answer=True,
                  s_path=ms_input.s_path,
                  t_path=ms_input.t_path)
    return MsInterface.command_from_dict(params)
Beispiel #4
0
def main(opt):
    logging.getLogger().setLevel(logging.DEBUG if opt.v else logging.INFO)
    if opt.output != '/dev/stdout' and os.path.exists(opt.output):
        LG.error("output file (%s) exsts. Exiting ...", opt.output)
        return 1
    command = MsInterface.command_from_dict(vars(opt))

    pref = os.path.basename(opt.s_path).replace(".s", "")
    header_suff = ",".join(['label', opt.repeat_colname, 'b_path'])
    for j in range(opt.repeat):
        with open(opt.output, 'a') as fd:
            res = get_output(command)
            if j == 0:
                fd.write(res[0] + "," + header_suff + "\n")
            for line in res[1:]:
                fd.write(line.replace(" ", "") +
                         ("," + opt.label) +
                         ("," + str(j + 1)) +
                         ("," + pref) + "\n")