diff --git a/sourmash_lib/lca/command_gather.py b/sourmash_lib/lca/command_gather.py index a1030475b6..8235cf05e5 100644 --- a/sourmash_lib/lca/command_gather.py +++ b/sourmash_lib/lca/command_gather.py @@ -38,7 +38,8 @@ def format_lineage(lineage_tup): name = d['strain'] elif 'species' in present: species = d['species'] - if species.startswith(genus + ' '): + if species.startswith(genus + ' ') or \ + species.startswith(genus + '_'): name = species else: name = '{} {}'.format(genus, species) diff --git a/tests/test_lca.py b/tests/test_lca.py index e72b73d06a..c2c67f3322 100644 --- a/tests/test_lca.py +++ b/tests/test_lca.py @@ -808,7 +808,7 @@ def test_single_gather(): print(out) print(err) - assert '2.0 Mbp 100.0% 100.0% Alteromonas Alteromonas_macleodii' in out + assert '2.0 Mbp 100.0% 100.0% Alteromonas_macleodii' in out assert 'Query is completely assigned.'