From 0a7ff4a97aa1d538a878f3a339d8959e634c61ef Mon Sep 17 00:00:00 2001 From: dparks1134 Date: Thu, 23 Nov 2023 06:17:40 +1000 Subject: [PATCH] fix(Issue561): resolved issue with Unclassified assignments breaking gtdb_to_ncbi_majority_vote.py script --- scripts/gtdb_to_ncbi_majority_vote.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/gtdb_to_ncbi_majority_vote.py b/scripts/gtdb_to_ncbi_majority_vote.py index 27e805e..eb18511 100755 --- a/scripts/gtdb_to_ncbi_majority_vote.py +++ b/scripts/gtdb_to_ncbi_majority_vote.py @@ -515,9 +515,11 @@ def ncbi_majority_vote(self, remaining_gids = set(gtdbtk_assignments) - processed_gids for gid in remaining_gids: gtdb_taxa = gtdbtk_assignments[gid] - - gtdb_sp_rid = gtdb_sp_to_rid[gtdb_taxa[SPECIES_IDX]] - ncbi_mv = ncbi_sp_classification[gtdb_sp_rid] + if gtdb_taxa[0].startswith('Unclassified'): + ncbi_mv = gtdb_taxa + else: + gtdb_sp_rid = gtdb_sp_to_rid[gtdb_taxa[SPECIES_IDX]] + ncbi_mv = ncbi_sp_classification[gtdb_sp_rid] fout.write('{}\t{}\t{}\n'.format( gid,