Exemplo n.º 1
0
def test_append_dep_resolver():
    cmd = "python -m MICGENT.cwl_runner add-dep-resolver --pkg-name ngs-mstb --conda-env ariba --mode w my_dep_resolver.yaml"
    check_call(shlex.split(cmd))
    cmd = "python -m MICGENT.cwl_runner add-dep-resolver --pkg-name ngs-mstb-py2 --conda-env ariba my_dep_resolver.yaml"
    check_call(shlex.split(cmd))
    assert os.path.isfile("my_dep_resolver.yaml")
    assert os.path.isfile("deps/ngs-mstb-py2/1.0/env.sh")
    assert helpers.grep(r"ariba", "deps/ngs-mstb-py2/1.0/env.sh")
    ## previous env is still there?
    assert os.path.isfile("deps/ngs-mstb/1.0/env.sh")
    assert helpers.grep(r"ariba", "deps/ngs-mstb/1.0/env.sh")
Exemplo n.º 2
0
def resumable(options):
    "Check to see if ddrescue log files exist and they indicate a resumable state."
    imgfile = helpers.image(options)
    ddrlog = imgfile + ddrescue.ddrlog_suffix
    btracelog = imgfile + btrace.BtraceParser.ddrlog_suffix
    usedlog = imgfile + getused.MapExtents.ddrlog_suffix
    if os.path.isfile(ddrlog) and os.stat(ddrlog).st_size > 0:
        if (os.path.isfile(usedlog) and helpers.grep(usedlog, 'ddrescue_used')
                and helpers.grep(usedlog, getused.MapExtents.logmagic)):
            return 'data'
        elif (os.path.isfile(btracelog)
              and helpers.grep(btracelog, 'ddrescue_used')
              and helpers.grep(btracelog, btrace.BtraceParser.logmagic)):
            return 'meta'
        else:
            raise Exception(
                'Non-resumable state. Use {} in ddrescue directly or remove it.'
                .format(ddrlog))
    else:
        return None
Exemplo n.º 3
0
def resumable(options):
    "Check to see if ddrescue log files exist and they indicate a resumable state."
    imgfile = helpers.image(options)
    ddrlog = imgfile + ddrescue.ddrlog_suffix
    btracelog = imgfile + btrace.BtraceParser.ddrlog_suffix
    usedlog = imgfile + getused.MapExtents.ddrlog_suffix
    if os.path.isfile(ddrlog) and os.stat(ddrlog).st_size > 0:
        if (os.path.isfile(usedlog) and
                helpers.grep(usedlog, 'ddrescue_used') and
                helpers.grep(usedlog, getused.MapExtents.logmagic)):
            return 'data'
        elif (os.path.isfile(btracelog) and
                helpers.grep(btracelog, 'ddrescue_used') and
                helpers.grep(btracelog, btrace.BtraceParser.logmagic)):
            return 'meta'
        else:
            raise Exception('Non-resumable state. Use {} in ddrescue directly or remove it.'
                                .format(ddrlog))
    else:
        return None
Exemplo n.º 4
0
def check_multiqc_cwl_tool_output(mqc_html):
    assert not helpers.grep(r"No sample data available to build a report",mqc_html), "Multiqc failed"
Exemplo n.º 5
0
def test_run_toil():
    check_call("cp {}/* ./".format(test_data_cwl_toil), shell=True)
    cmd = "python -m MICGENT.cwl_runner run-toil --logLevel DEBUG --runner-use-conda --runner-conda-env toil sorttool.cwl revsort-job.json"
    check_call(shlex.split(cmd))
    assert os.path.isfile("out/output.txt")
    assert helpers.grep(r"whenever it is a damp", "out/output.txt")
Exemplo n.º 6
0
def test_init_dep_resolver():
    cmd = "python -m MICGENT.cwl_runner add-dep-resolver --pkg-name ngs-mstb --conda-env ariba --mode w my_dep_resolver.yaml"
    check_call(shlex.split(cmd))
    assert os.path.isfile("my_dep_resolver.yaml")
    assert os.path.isfile("deps/ngs-mstb/1.0/env.sh")
    assert helpers.grep(r"ariba", "deps/ngs-mstb/1.0/env.sh")