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)
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)
def test_generate_biobox_file(): args = [{"fastq" : [{"id" : "i" , "value" : "v", "type": "t"}]}] output = bbf.generate(args) expected = """\ arguments: - fastq: - id: i type: t value: v version: 0.9.0 """ nt.assert_equal(expected, output)
def test_generate_biobox_file(): args = [{"fastq": [{"id": "i", "value": "v", "type": "t"}]}] output = bbf.generate(args) expected = """\ arguments: - fastq: - id: i type: t value: v version: 0.9.0 """ nt.assert_equal(expected, output)
def prepare_volumes(self, opts, host_dst_dir): fastq_file = opts['--input'] cntr_fastq_file = "/fastq/input.fq.gz" fastq_values = [(cntr_fastq_file, "paired")] yaml_data = [fle.fastq_arguments(fastq_values)] biobox_yaml = fle.generate(yaml_data) host_src_dir = os.path.abspath(fastq_file) volumes = [ ctn.volume_string(host_src_dir, cntr_fastq_file), ctn.biobox_file_volume_string(fle.create_biobox_directory(biobox_yaml)), ctn.output_directory_volume_string(host_dst_dir)] return volumes
def prepare_volumes(self, opts, host_dst_dir): fastq_file = opts['--input'] cntr_fastq_file = "/fastq/input.fq.gz" fastq_values = [(cntr_fastq_file, "paired")] yaml_data = [fle.fastq_arguments(fastq_values)] biobox_yaml = fle.generate(yaml_data) host_src_dir = os.path.abspath(fastq_file) volumes = [ ctn.volume_string(host_src_dir, cntr_fastq_file), ctn.biobox_file_volume_string( fle.create_biobox_directory(biobox_yaml)), ctn.output_directory_volume_string(host_dst_dir) ] return volumes
def prepare_volumes(self, opts, host_dst_dir): fasta_file = opts["--input-fasta"] ref_dir = opts["--input-ref"] host_src_fasta_file = os.path.abspath(fasta_file) host_src_ref_dir = os.path.abspath(ref_dir) cntr_src_fasta = "/fasta/input.fa" fasta_values = [(cntr_src_fasta, "contig")] fasta_yaml_values = fle.fasta_arguments(fasta_values) cntr_src_ref_dir = "/ref" ref_dir_yaml_values = fle.reference_argument(ref_dir) biobox_yaml = fle.generate([fasta_yaml_values, ref_dir_yaml_values]) volume_strings = [ ctn.volume_string(host_src_fasta_file, cntr_src_fasta), ctn.volume_string(host_src_ref_dir, cntr_src_ref_dir), ctn.biobox_file_volume_string(fle.create_biobox_directory(biobox_yaml)), ctn.output_directory_volume_string(host_dst_dir), ] return volume_strings
def prepare_volumes(self, opts, host_dst_dir): fasta_file = opts['--input-fasta'] ref_dir = opts['--input-ref'] host_src_fasta_file = os.path.abspath(fasta_file) host_src_ref_dir = os.path.abspath(ref_dir) cntr_src_fasta = "/fasta/input.fa" fasta_values = [(cntr_src_fasta, "contig")] fasta_yaml_values = fle.fasta_arguments(fasta_values) cntr_src_ref_dir = "/ref" ref_dir_yaml_values = fle.reference_argument(ref_dir) biobox_yaml = fle.generate([fasta_yaml_values, ref_dir_yaml_values]) volume_strings = [ ctn.volume_string(host_src_fasta_file, cntr_src_fasta), ctn.volume_string(host_src_ref_dir, cntr_src_ref_dir), ctn.biobox_file_volume_string( fle.create_biobox_directory(biobox_yaml)), ctn.output_directory_volume_string(host_dst_dir) ] return volume_strings