From ab26d959c62bd384123c5e40f1714688e5bcd421 Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Sat, 24 Feb 2018 13:30:40 -0800 Subject: [PATCH] add query name to CSV output of sbt categorize --- sourmash_lib/commands.py | 3 ++- tests/test_sourmash.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sourmash_lib/commands.py b/sourmash_lib/commands.py index 34b7e3a605..1aa60d0b66 100644 --- a/sourmash_lib/commands.py +++ b/sourmash_lib/commands.py @@ -872,7 +872,8 @@ def categorize(args): if args.csv: w = csv.writer(args.csv) - w.writerow([queryfile, best_hit_query_name, best_hit_sim]) + w.writerow([queryfile, query.name(), best_hit_query_name, + best_hit_sim]) if loader.skipped_ignore: notify('skipped/ignore: {}', loader.skipped_ignore) diff --git a/tests/test_sourmash.py b/tests/test_sourmash.py index b54c48ce40..ba84512379 100644 --- a/tests/test_sourmash.py +++ b/tests/test_sourmash.py @@ -2873,7 +2873,7 @@ def test_sbt_categorize(): assert 'for s10+s11, found: 0.50 genome-s10.fa.gz' in err out_csv = open(os.path.join(location, 'out.csv')).read() - assert './4.sig,genome-s10.fa.gz,0.50' in out_csv + assert './4.sig,s10+s11,genome-s10.fa.gz,0.50' in out_csv def test_sbt_categorize_already_done():