Beispiel #1
0
def run(argv):
    opts = util.parse_docopt(__doc__, argv, False)
    image       = opts['<image>']
    fastq_file  = opts['--input']
    contig_file = opts['--output']
    task        = opts['--task']

    if not ctn.image_available(image):
        util.err_exit('unknown_image', {'image': image})

    cntr_src_dir = "/fastq"
    biobox_yaml = fle.generate([
        fle.fastq_arguments(cntr_src_dir, [fastq_file, "paired"])])

    host_src_dir = os.path.abspath(os.path.dirname(fastq_file))
    host_dst_dir = tmp.mkdtemp()

    mount_strings = [
        ctn.mount_string(host_src_dir, cntr_src_dir),
        ctn.biobox_file_mount_string(fle.create_biobox_directory(biobox_yaml)),
        ctn.output_directory_mount_string(host_dst_dir)]

    ctn.run(ctn.create(image, task, mount_strings))
    biobox_output = fle.parse(host_dst_dir)
    copy_contigs_file(host_dst_dir, biobox_output, contig_file)
Beispiel #2
0
def run(argv):
    opts = util.parse_docopt(__doc__, argv, False)
    image = opts['<image>']
    fastq_file = opts['--input']
    contig_file = opts['--output']
    task = opts['--task']

    if not ctn.image_available(image):
        util.err_exit('unknown_image', {'image': image})

    cntr_src_dir = "/fastq"
    biobox_yaml = fle.generate(
        [fle.fastq_arguments(cntr_src_dir, [fastq_file, "paired"])])

    host_src_dir = os.path.abspath(os.path.dirname(fastq_file))
    host_dst_dir = tmp.mkdtemp()

    mount_strings = [
        ctn.mount_string(host_src_dir, cntr_src_dir),
        ctn.biobox_file_mount_string(fle.create_biobox_directory(biobox_yaml)),
        ctn.output_directory_mount_string(host_dst_dir)
    ]

    ctn.run(ctn.create(image, task, mount_strings))
    biobox_output = fle.parse(host_dst_dir)
    copy_contigs_file(host_dst_dir, biobox_output, contig_file)
Beispiel #3
0
def run(argv):
    opts   = util.parse_docopt(__doc__, argv, False)
    biobox = opts['<biobox_type>']
    image  = opts['<image>']
    task   = opts['--task']

    from behave.__main__ import main as behave_main
    _, tmp_file = tempfile.mkstemp()
    cmd = "{file} --define IMAGE={image} --define TASK={task} --define TMPDIR={tmp_dir} --outfile {tmp_file} --no-summary --stop"
    args = {'file':     verification_file(biobox),
            'tmp_dir':  tmp_feature_dir(),
            'image':    image,
            'tmp_file': tmp_file,
            'task':     task}

    behave_main(cmd.format(**args))

    with open(tmp_file, 'r') as f:
        output = f.read()

    if "Assertion Failed" in output:
        util.err_exit('failed_verification', {'image': image, 'biobox': biobox.replace('_', ' ')})
Beispiel #4
0
def run(argv):
    opts = util.parse_docopt(__doc__, argv, True)
    util.select_module("biobox_type", opts["<biobox_type>"]).run(argv)
Beispiel #5
0
def run():
    args = input_args()
    opts = util.parse_docopt(__doc__, args, True)
    util.select_module("command", opts["<command>"]).run(args)
Beispiel #6
0
def run(argv):
    opts = util.parse_docopt(__doc__, argv, True)
    util.select_module("biobox_type", opts["<biobox_type>"]).run(argv)
Beispiel #7
0
def run():
    args = input_args()
    opts = util.parse_docopt(__doc__, args, True)
    util.select_module("command", opts["<command>"]).run(args)