@@ -334,6 +334,111 @@ def test_coassemble_query_input(self):
334334 with open (cluster_path ) as f :
335335 self .assertEqual (expected , f .read ())
336336
337+ def test_coassemble_query_input_taxa_of_interest (self ):
338+ with in_tempdir ():
339+ cmd = (
340+ f"ibis coassemble "
341+ f"--forward { SAMPLE_READS_FORWARD } "
342+ f"--reverse { SAMPLE_READS_REVERSE } "
343+ f"--genomes { GENOMES } "
344+ f"--genome-transcripts { GENOME_TRANSCRIPTS } "
345+ f"--sample-query { SAMPLE_QUERY } "
346+ f"--sample-singlem { SAMPLE_QUERY_SINGLEM } "
347+ f"--sample-read-size { SAMPLE_READ_SIZE } "
348+ f"--taxa-of-interest \" p__Actinobacteriota\" "
349+ f"--output test "
350+ f"--conda-prefix { path_to_conda } "
351+ f"--snakemake-args \" cluster_graph\" "
352+ )
353+ extern .run (cmd )
354+
355+ config_path = os .path .join ("test" , "config.yaml" )
356+ self .assertTrue (os .path .exists (config_path ))
357+
358+ binned_path = os .path .join ("test" , "coassemble" , "appraise" , "binned.otu_table.tsv" )
359+ self .assertTrue (os .path .exists (binned_path ))
360+ expected = "\n " .join (
361+ [
362+ "\t " .join (["gene" , "sample" , "sequence" , "num_hits" , "coverage" , "taxonomy" , "found_in" ]),
363+ ""
364+ ]
365+ )
366+ with open (binned_path ) as f :
367+ self .assertEqual (expected , f .read ())
368+
369+ unbinned_path = os .path .join ("test" , "coassemble" , "appraise" , "unbinned.otu_table.tsv" )
370+ self .assertTrue (os .path .exists (unbinned_path ))
371+ expected = "\n " .join (
372+ [
373+ "\t " .join ([
374+ "gene" ,
375+ "sample" ,
376+ "sequence" ,
377+ "num_hits" ,
378+ "coverage" ,
379+ "taxonomy" ,
380+ "found_in" ,
381+ ]),
382+ "\t " .join ([
383+ "S3.7.ribosomal_protein_S7" ,
384+ "sample_1" ,
385+ "TACCAGGTCCCGGTCGAGGTCCGTCCGATCCGCCAGACGACGCTCGCCCTGCGCTGGCTC" ,
386+ "5" ,
387+ "8.21" ,
388+ "Root; d__Bacteria; p__Actinobacteriota; c__Actinomycetia; o__Mycobacteriales; f__Mycobacteriaceae; g__Nocardia; s__Nocardia grenadensis" ,
389+ "" ,
390+ ]),
391+ "\t " .join ([
392+ "S3.7.ribosomal_protein_S7" ,
393+ "sample_1" ,
394+ "TATCAGGTGCCTATTGAGGTAAGACCTGAAAGAAGACAGACTTTAGCGCTTCGCTGGATA" ,
395+ "1" ,
396+ "1.64" ,
397+ "Root; d__Bacteria; p__Actinobacteriota; c__Actinomycetia; o__Mycobacteriales; f__Mycobacteriaceae; g__Nocardia; s__Nocardia grenadensis2" ,
398+ "" ,
399+ ]),
400+ "\t " .join ([
401+ "S3.7.ribosomal_protein_S7" ,
402+ "sample_1" ,
403+ "TATCAGGTGCCTATTGAGGTAAGACCTGAAAGAAGACAGACTTTAGCGCTTCGCTGGATC" ,
404+ "5" ,
405+ "8.21" ,
406+ "Root; d__Bacteria; p__Actinobacteriota; c__Actinomycetia; o__Mycobacteriales; f__Mycobacteriaceae; g__Nocardia; s__Nocardia grenadensis3" ,
407+ "" ,
408+ ]),
409+ "\t " .join ([
410+ "S3.7.ribosomal_protein_S7" ,
411+ "sample_2" ,
412+ "TACCAGGTCCCGGTCGAGGTCCGTCCGATCCGCCAGACGACGCTCGCCCTGCGCTGGCTC" ,
413+ "3" ,
414+ "4.92" ,
415+ "Root; d__Bacteria; p__Actinobacteriota; c__Actinomycetia; o__Mycobacteriales; f__Mycobacteriaceae; g__Nocardia; s__Nocardia grenadensis" ,
416+ "" ,
417+ ]),
418+ "\t " .join ([
419+ "S3.7.ribosomal_protein_S7" ,
420+ "sample_3" ,
421+ "TATCAGGTGCCTATTGAGGTAAGACCTGAAAGAAGACAGACTTTAGCGCTTCGCTGGATA" ,
422+ "6" ,
423+ "9.85" ,
424+ "Root; d__Bacteria; p__Actinobacteriota; c__Actinomycetia; o__Mycobacteriales; f__Mycobacteriaceae; g__Nocardia; s__Nocardia grenadensis2" ,
425+ "" ,
426+ ]),
427+ ""
428+ ]
429+ )
430+ with open (unbinned_path ) as f :
431+ self .assertEqual (expected , f .read ())
432+
433+ edges_path = os .path .join ("test" , "coassemble" , "target" , "targets.tsv" )
434+ self .assertTrue (os .path .exists (edges_path ))
435+
436+ edges_path = os .path .join ("test" , "coassemble" , "target" , "elusive_edges.tsv" )
437+ self .assertTrue (os .path .exists (edges_path ))
438+
439+ cluster_path = os .path .join ("test" , "coassemble" , "target" , "elusive_clusters.tsv" )
440+ self .assertTrue (os .path .exists (cluster_path ))
441+
337442 def test_coassemble_single_assembly (self ):
338443 with in_tempdir ():
339444 cmd = (
0 commit comments