Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 3
0
 def run(self, argv):
     doc = inspect.getdoc(inspect.getmodule(self))
     opts = util.parse_docopt(doc, argv, False)
     task = opts['--task']
     image = opts['<image>']
     output = opts['--output']
     host_dst_dir = tmp.mkdtemp()
     volumes = self.prepare_volumes(opts, host_dst_dir)
     ctn.exit_if_no_image_available(image)
     ctnr = ctn.create(image, task, volumes)
     ctn.run(ctnr)
     self.after_run(output, host_dst_dir)
     return ctnr
Exemplo n.º 4
0
 def run(self, argv):
     doc = inspect.getdoc(inspect.getmodule(self))
     opts = util.parse_docopt(doc, argv, False)
     task        = opts['--task']
     image       = opts['<image>']
     output      = opts['--output']
     host_dst_dir = tmp.mkdtemp()
     volumes = self.prepare_volumes(opts, host_dst_dir)
     ctn.exit_if_no_image_available(image)
     ctnr = ctn.create(image, task, volumes)
     ctn.run(ctnr)
     self.after_run(output, host_dst_dir)
     return ctnr
Exemplo n.º 5
0
def test_create_container_with_volumes():
    container = ctn.create("bioboxes/velvet", "default", ["/host:/cont:ro"])
    attr = ctn.client().inspect_container(container)
    nose.assert_in("/host", attr["Volumes"])
    hlpr.remove_container(container)
Exemplo n.º 6
0
def test_create_container_with_no_volumes():
    container = ctn.create("bioboxes/velvet", "default")
    attr = ctn.client().inspect_container(container)
    nose.assert_equal(attr["Volumes"], {})
    hlpr.remove_container(container)
def test_create_container_with_volumes():
    container = ctn.create("bioboxes/velvet", "default", ["/host:/cont:ro"])
    attr = ctn.client().inspect_container(container)
    nose.assert_in("/host", attr["Volumes"])
    hlpr.remove_container(container)
def test_create_container_with_no_volumes():
    container = ctn.create("bioboxes/velvet", "default")
    attr = ctn.client().inspect_container(container)
    nose.assert_equal(attr["Volumes"], {})
    hlpr.remove_container(container)