def runfn(fn_name, queue, wrap_args, parallel, run_args):
    testing = True
    run_id = uuid.uuid4()
    work_dir = os.getcwd()
    script_file = "bcbio-%s-%s-run.sh" % (fn_name, run_id)
    arg_file = "bcbio-%s-%s-args.json" % (fn_name, run_id)
    parallel_file = "bcbio-%s-%s-parallel.json" % (fn_name, run_id)
    tarball = "bcbio-%s-%s.tar.gz" % (fn_name, run_id)
    out_file = "%s-out%s" % os.path.splitext(arg_file)
    run_args = pack.send_run(run_args, parallel["pack"])
    with utils.chdir(work_dir):
        with open(arg_file, "w") as out_handle:
            yaml.safe_dump(run_args, out_handle, default_flow_style=False, allow_unicode=False)
        with open(parallel_file, "w") as out_handle:
            yaml.safe_dump(parallel, out_handle, default_flow_style=False, allow_unicode=False)
        with open(script_file, "w") as out_handle:
            out_handle.write(_bootstrap_sh.format(fn_name=fn_name, arg_file=os.path.basename(arg_file),
                                                  parallel_file=os.path.basename(parallel_file)))
        if testing:
            _test_clusterk(fn_name, parallel_file, arg_file)
        else:
            do.run(["tar", "-czvpf", tarball, script_file, arg_file, parallel_file],
                   "Prepare submission tarball")
            cmd = ["ksub.py", "-q", queue["queue"], "-e", str(int(float(queue["mem"]) * 1024)),
                   "-c", str(queue["cores_per_job"]), "-u", os.path.abspath(tarball),
                   os.path.basename(script_file)]
            for tag in ["fnname=%s" % fn_name]:
                cmd += ["--tag", tag]
            do.run(cmd, "Submit to clusterk")
        with open(reconstitute.get_output(out_file, parallel["pack"])) as in_handle:
            out = yaml.safe_load(in_handle)
        for f in [script_file, parallel_file, arg_file, tarball, out_file]:
            if os.path.exists(f):
                os.remove(f)
    return out
Run external function submitting to existing queue.
dataset/ETHPy150Open chapmanb/bcbio-nextgen-vm/bcbiovm/clusterk/clusterktasks.py/runfn