Skip to content

Commit

Permalink
rename num_binned/assembled/not_found to coverage_binned/assembled/no…
Browse files Browse the repository at this point in the history
…t_found
  • Loading branch information
AroneyS authored and wwood committed Dec 17, 2024
1 parent a8b1dbd commit 9e7a861
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions singlem/appraiser.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ def print_appraisal(self, appraisal,
'''print the Appraisal object overview to STDOUT'''

headers = ['sample', 'domain']
if doing_binning: headers.append('num_binned')
if doing_assembly: headers.append('num_assembled')
headers.append('num_not_found')
if doing_binning: headers.append('coverage_binned')
if doing_assembly: headers.append('coverage_assembled')
headers.append('coverage_not_found')
if doing_binning: headers.append('percent_binned')
if doing_assembly: headers.append('percent_assembled')
output_io.write("\t".join(headers)+"\n")
Expand Down
8 changes: 4 additions & 4 deletions test/test_appraise.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def test_print_appraisal(self):

to_print = StringIO()
appraiser.print_appraisal(app, packages, True, to_print)
self.assertEqual("sample\tdomain\tnum_binned\tnum_not_found\tpercent_binned\nminimal\td__Archaea\t0\t0\t0.0\nminimal\td__Bacteria\t4\t0\t100.0\nanother\td__Archaea\t0\t0\t0.0\nanother\td__Bacteria\t0\t2\t0.0\ntotal\td__Archaea\t0\t0\t0.0\naverage\td__Archaea\t0.0\t0.0\tnan\ntotal\td__Bacteria\t4\t2\t66.7\naverage\td__Bacteria\t2.0\t1.0\t50.0\n", to_print.getvalue())
self.assertEqual("sample\tdomain\tcoverage_binned\tcoverage_not_found\tpercent_binned\nminimal\td__Archaea\t0\t0\t0.0\nminimal\td__Bacteria\t4\t0\t100.0\nanother\td__Archaea\t0\t0\t0.0\nanother\td__Bacteria\t0\t2\t0.0\ntotal\td__Archaea\t0\t0\t0.0\naverage\td__Archaea\t0.0\t0.0\tnan\ntotal\td__Bacteria\t4\t2\t66.7\naverage\td__Bacteria\t2.0\t1.0\t50.0\n", to_print.getvalue())

to_print = StringIO()
found_otu_table_io = StringIO()
Expand Down Expand Up @@ -431,7 +431,7 @@ def test_print_assembly_appraise(self):

to_print = StringIO()
appraiser.print_appraisal(app, packages, True, to_print, doing_assembly=True)
self.assertEqual("sample\tdomain\tnum_binned\tnum_assembled\tnum_not_found\tpercent_binned\tpercent_assembled\nminimal\td__Archaea\t0\t0\t0\t0.0\t0.0\nminimal\td__Bacteria\t0\t4\t0\t0.0\t100.0\nanother\td__Archaea\t0\t0\t0\t0.0\t0.0\nanother\td__Bacteria\t0\t0\t2\t0.0\t0.0\ntotal\td__Archaea\t0\t0\t0\t0.0\t0.0\naverage\td__Archaea\t0.0\t0.0\t0.0\tnan\tnan\ntotal\td__Bacteria\t0\t4\t2\t0.0\t66.7\naverage\td__Bacteria\t0.0\t2.0\t1.0\t0.0\t50.0\n", to_print.getvalue())
self.assertEqual("sample\tdomain\tcoverage_binned\tcoverage_assembled\tcoverage_not_found\tpercent_binned\tpercent_assembled\nminimal\td__Archaea\t0\t0\t0\t0.0\t0.0\nminimal\td__Bacteria\t0\t4\t0\t0.0\t100.0\nanother\td__Archaea\t0\t0\t0\t0.0\t0.0\nanother\td__Bacteria\t0\t0\t2\t0.0\t0.0\ntotal\td__Archaea\t0\t0\t0\t0.0\t0.0\naverage\td__Archaea\t0.0\t0.0\t0.0\tnan\tnan\ntotal\td__Bacteria\t0\t4\t2\t0.0\t66.7\naverage\td__Bacteria\t0.0\t2.0\t1.0\t0.0\t50.0\n", to_print.getvalue())

to_print = StringIO()
found_otu_table_io = StringIO()
Expand Down Expand Up @@ -517,7 +517,7 @@ def test_print_assembly_appraise_all_binned(self):

to_print = StringIO()
appraiser.print_appraisal(app, packages, True, to_print, doing_assembly=True)
self.assertEqual("sample\tdomain\tnum_binned\tnum_assembled\tnum_not_found\tpercent_binned\tpercent_assembled\nminimal\td__Archaea\t0\t0\t0\t0.0\t0.0\nminimal\td__Bacteria\t4\t4\t0\t100.0\t100.0\nanother\td__Archaea\t0\t0\t0\t0.0\t0.0\nanother\td__Bacteria\t0\t0\t2\t0.0\t0.0\ntotal\td__Archaea\t0\t0\t0\t0.0\t0.0\naverage\td__Archaea\t0.0\t0.0\t0.0\tnan\tnan\ntotal\td__Bacteria\t4\t4\t2\t66.7\t66.7\naverage\td__Bacteria\t2.0\t2.0\t1.0\t50.0\t50.0\n", to_print.getvalue())
self.assertEqual("sample\tdomain\tcoverage_binned\tcoverage_assembled\tcoverage_not_found\tpercent_binned\tpercent_assembled\nminimal\td__Archaea\t0\t0\t0\t0.0\t0.0\nminimal\td__Bacteria\t4\t4\t0\t100.0\t100.0\nanother\td__Archaea\t0\t0\t0\t0.0\t0.0\nanother\td__Bacteria\t0\t0\t2\t0.0\t0.0\ntotal\td__Archaea\t0\t0\t0\t0.0\t0.0\naverage\td__Archaea\t0.0\t0.0\t0.0\tnan\tnan\ntotal\td__Bacteria\t4\t4\t2\t66.7\t66.7\naverage\td__Bacteria\t2.0\t2.0\t1.0\t50.0\t50.0\n", to_print.getvalue())

# Check that unbinned is the same as assembled OTUs when no binning is done
to_print = StringIO()
Expand Down Expand Up @@ -1211,7 +1211,7 @@ def test_appraise_default_cutoff(self):
cmd = f'{path_to_script} appraise --metagenome-otu-table {f.name} --genome-otu-table {g.name} --imperfect --metapackage {smpkg}'

expected_header = "# Appraised using max divergence 2 (97% ANI)\n"
expected = """sample domain num_binned num_not_found percent_binned
expected = """sample domain coverage_binned coverage_not_found percent_binned
minimal d__Archaea 0 0 0.0
minimal d__Bacteria 9 4 69.2
total d__Archaea 0 0 0.0
Expand Down

0 comments on commit 9e7a861

Please sign in to comment.