diff --git a/src/sourmash/command_compute.py b/src/sourmash/command_compute.py index 46c4f455f..aac66def1 100644 --- a/src/sourmash/command_compute.py +++ b/src/sourmash/command_compute.py @@ -204,6 +204,7 @@ def _compute_individual(args, signatures_factory): # make a new signature for each sequence? if args.singleton: + n_calculated = 0 for n, record in enumerate(screed_iter): sigs = signatures_factory() try: @@ -218,12 +219,13 @@ def _compute_individual(args, signatures_factory): error(str(exc)) sys.exit(-1) + n_calculated += len(sigs) set_sig_name(sigs, filename, name=record.name) save_sigs_to_location(sigs, save_sigs) notify( "calculated {} signatures for {} sequences in {}", - len(save_sigs), + n_calculated, n + 1, filename, ) diff --git a/tests/test_sourmash_sketch.py b/tests/test_sourmash_sketch.py index 5c06ace5f..87460dcbc 100644 --- a/tests/test_sourmash_sketch.py +++ b/tests/test_sourmash_sketch.py @@ -1393,6 +1393,7 @@ def test_do_sourmash_singleton_multiple_files_no_out_specified(runtmp): "saved 2 signature(s) to 'shewanella.faa.sig'. Note: signature license is CC0." in runtmp.last_result.err ) + assert "calculated 2 signatures for 2 sequences in" in runtmp.last_result.err sig1 = runtmp.output("ecoli.faa.sig") assert os.path.exists(sig1) @@ -1441,6 +1442,8 @@ def test_do_sourmash_singleton_multiple_files_output(runtmp): "saved 4 signature(s) to 'output.sig'. Note: signature license is CC0." in runtmp.last_result.err ) + assert "calculated 2 signatures for 2 sequences in" in runtmp.last_result.err + assert "calculated 4 signatures for 2 sequences in" not in runtmp.last_result.err sig1 = runtmp.output("output.sig") assert os.path.exists(sig1)