Skip to content

Commit

Permalink
PD-4923 Verify the version of StxTyper when AMRFinderPlus is run
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyacheslav Brover committed Mar 8, 2024
1 parent 78517c4 commit e30a513
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
16 changes: 15 additions & 1 deletion amrfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* Dependencies: NCBI BLAST, HMMer, gunzip (optional)
*
* Release changes:
* 3.12.16 03/08/2024 PD-4923 verify the version of stxtyper
* 3.12.15 03/05/2024 PD-4918 stxtyper ver. 1.0.14: --print_node
* stxtyper -q
* 3.12.14 03/05/2024 PD-4910 -n <nucl> --plus -O Escherichia: stxtyper 1.0.13 is invoked, STX* classes are suppressed in amr_report.cpp
Expand Down Expand Up @@ -849,6 +850,20 @@ struct ThisApplication : ShellApplication


const bool blastn = ! emptyArg (dna) && ! organism1. empty () && fileExists (db + "/AMR_DNA-" + organism1);
const bool stxTyper = blastn && organism1 == "Escherichia" && add_plus;


if (stxTyper)
{
const string verFName (tmp + "/stxtyper-ver");
exec (fullProg ("stxtyper") + " -v > " + verFName, logFName);
LineInput f (verFName);
if (! f. nextLine ())
throw runtime_error ("Cannot get the version of StxTyper");
const string stxTyperVersion ("1.0.14"); // PAR
if (f. line != stxTyperVersion)
throw runtime_error ("AMRFinder invokes StxTyper version " + f. line + ". Expected StxTyper version is " + stxTyperVersion);
}


// Create files for amr_report
Expand Down Expand Up @@ -1118,7 +1133,6 @@ struct ThisApplication : ShellApplication
}


const bool stxTyper = blastn && organism1 == "Escherichia" && add_plus;
if (stxTyper)
{
stderr. section ("Running stxtyper");
Expand Down
11 changes: 11 additions & 0 deletions common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2355,6 +2355,17 @@ template <typename T>
{ if (P::empty ())
return no_index;
checkSorted ();
if (P::size () < 8) // PAR
{
for (size_t i = 0; i < P::size (); i++)
{
if (value == (*this) [i])
return i;
if (value < (*this) [i])
return exact ? no_index : i;
}
return no_index;
}
size_t lo = 0; // vec.at(lo) <= value
size_t hi = P::size () - 1;
// lo <= hi
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.15
3.12.16

0 comments on commit e30a513

Please sign in to comment.