From 149f21ac1eef6ebefa6554695b3f7bc4c314de14 Mon Sep 17 00:00:00 2001 From: Brian Ondov Date: Wed, 3 Feb 2021 17:00:33 -0500 Subject: [PATCH] ktClassifyBLAST optimization --- KronaTools/lib/KronaTools.pm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/KronaTools/lib/KronaTools.pm b/KronaTools/lib/KronaTools.pm index dcc3176..7aa9665 100644 --- a/KronaTools/lib/KronaTools.pm +++ b/KronaTools/lib/KronaTools.pm @@ -1011,19 +1011,6 @@ sub classifyBlast last; # EOF } - my $acc = getAccFromSeqID($hitID); - my $newTaxID = getTaxIDFromAcc($acc); - - if - ( - ! defined $acc || - ! $options{'includeUnk'} && (! $newTaxID || ! taxIDExists($newTaxID)) - ) - { - $lastQueryID = $queryID; - next; - } - if # this is a 'best' hit if... ( $ties == 0 || # first hit @@ -1031,6 +1018,19 @@ sub classifyBlast $options{'factor'} && $eVal <= $options{'factor'} * $topEVal # within e-val factor ) { + my $acc = getAccFromSeqID($hitID); + my $newTaxID = getTaxIDFromAcc($acc); + + if + ( + ! defined $acc || + ! $options{'includeUnk'} && (! $newTaxID || ! taxIDExists($newTaxID)) + ) + { + $lastQueryID = $queryID; + next; + } + if ( $ties == 0 ) { $topScore = $bitScore;