Skip to content

Commit

Permalink
Merge pull request #227 from rhysnewell/fix-vamb-dastool
Browse files Browse the repository at this point in the history
Fix vamb being excluded from dastool
  • Loading branch information
AroneyS authored Nov 19, 2024
2 parents a2269e0 + 4787d7d commit f4d51a2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aviary/modules/binning/scripts/das_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down
36 changes: 36 additions & 0 deletions test/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f4d51a2

Please sign in to comment.