diff --git a/aviary/modules/binning/scripts/das_tool.py b/aviary/modules/binning/scripts/das_tool.py index 1b4186a3..e8fabfe5 100644 --- a/aviary/modules/binning/scripts/das_tool.py +++ b/aviary/modules/binning/scripts/das_tool.py @@ -19,7 +19,8 @@ binners = [] for (binner, extension) in unrefined_binners_to_use: if binner not in snakemake.config['skip_binners']: - binners.append((f'{binner}_bins/', extension, f'data/{binner}_bins.tsv')) + extra = 'bins/' if binner == 'vamb' else '' + binners.append((f'{binner}_bins/'+extra, extension, f'data/{binner}_bins.tsv')) for (binner, extension) in refined_binners_to_use: if binner not in snakemake.config['skip_binners']: diff --git a/test/test_integration.py b/test/test_integration.py index fe17f77f..c3cb232b 100755 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -156,6 +156,42 @@ def test_short_read_recovery_fast(self): self.assertFalse(os.path.isfile(f"{output_dir}/aviary_out/data/final_contigs.fasta")) + def test_short_read_recovery_vamb(self): + output_dir = os.path.join("example", "test_short_read_recovery_vamb") + self.setup_output_dir(output_dir) + + # Create inflated assembly file + cmd = f"cat {data}/assembly.fasta > {output_dir}/assembly.fasta" + multiplier = 100 + for i in range(multiplier): + cmd += f" && awk '/^>/ {{print $0 \"{i}\"}} !/^>/ {{print $0}}' {data}/assembly.fasta >> {output_dir}/assembly.fasta" + + subprocess.run(cmd, shell=True, check=True) + + cmd = ( + f"aviary recover " + f"--assembly {output_dir}/assembly.fasta " + f"-o {output_dir}/aviary_out " + f"-1 {data}/wgsim.1.fq.gz " + f"-2 {data}/wgsim.2.fq.gz " + f"--binning-only " + f"--skip-binners rosella semibin metabat " + f"--skip-qc " + f"--refinery-max-iterations 0 " + f"--conda-prefix {path_to_conda} " + f"-n 32 -t 32 " + ) + subprocess.run(cmd, shell=True, check=True) + + bin_info_path = f"{output_dir}/aviary_out/bins/bin_info.tsv" + self.assertTrue(os.path.isfile(bin_info_path)) + with open(bin_info_path) as f: + num_lines = sum(1 for _ in f) + self.assertTrue(num_lines > 2) + + self.assertFalse(os.path.isfile(f"{output_dir}/aviary_out/data/final_contigs.fasta")) + + @unittest.skip("Skipping test due to queue submission") def test_short_read_recovery_queue_submission(self): output_dir = os.path.join("example", "test_short_read_recovery_queue_submission") self.setup_output_dir(output_dir)