From 52c38f16c1e933e765d7d8b1b953ea3cd3606fba Mon Sep 17 00:00:00 2001 From: Vyacheslav Brover Date: Sat, 14 Dec 2024 20:36:44 -0500 Subject: [PATCH] PD-5191 StxTyper ver. 1.0.30, stxtyper --threads --- amrfinder.cpp | 6 +++++- common.cpp | 4 +++- common.hpp | 17 ++++++++++++++--- stx | 2 +- version.txt | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/amrfinder.cpp b/amrfinder.cpp index 128346c..1aabbdd 100644 --- a/amrfinder.cpp +++ b/amrfinder.cpp @@ -33,6 +33,8 @@ * Dependencies: NCBI BLAST, HMMer, libcurl, gunzip (optional) * * Release changes: +* stxtyper --threads +* 4.0.7 12/12/2024 PD-5192 StxTyper ver. 1.0.30 * 4.0.6 12/09/2024 PD-5181 StxTyper ver. 1.0.28 * 4.0.5 11/13/2024 PD-5175 prohibit --database_version and -p or -n * 4.0.4 10/29/2024 colorizeDir() @@ -339,7 +341,7 @@ using namespace GFF_sp; const string dataVer_min ("2024-08-14.2"); // 3.12: "2023-12-15.2" // 3.11: "2021-02-18.1" -const string stxTyperVersion ("1.0.28"); +const string stxTyperVersion ("1.0.30"); @@ -1182,6 +1184,7 @@ struct ThisApplication final : ShellApplication { stderr. section ("Running stxtyper"); const Chronometer_OnePass_cerr cop ("stxtyper"); + ASSERT (threads_max >= 1); exec ( fullProg ("stxtyper") + " -n " + dna_flat + prependS (blast_bin, " --blast_bin ") @@ -1191,6 +1194,7 @@ struct ThisApplication final : ShellApplication + ifS (print_node, " --print_node") + " -q " // ifS (getVerbosity () == -1, " -q") + ifS (qc_on, " --debug") + + " --threads " + to_string (threads_max ) + " > " + logFName , logFName ); diff --git a/common.cpp b/common.cpp index b02fb32..304ca7c 100644 --- a/common.cpp +++ b/common.cpp @@ -297,7 +297,7 @@ string getStack () char** strings = backtrace_symbols (buffer, nptrs); if (strings /*&& ! which ("addr2line"). empty ()*/) { - FOR_REV_END (int, i, 1, nptrs) + FOR_START /*FOR_REV_END*/ (int, i, 1, nptrs) // From top to bottom of the stack s += string (strings [i]) + "\n"; s += "Use: addr2line -f -C -e " + programArgs [0] + " -a
"; //free (strings); @@ -1918,6 +1918,7 @@ void Root::saveFile (const string &fName) const +#if 0 void Root::trace (ostream& os, const string& title) const { @@ -1927,6 +1928,7 @@ void Root::trace (ostream& os, os << title << ": "; saveText (os); } +#endif diff --git a/common.hpp b/common.hpp index d03164d..603cd63 100644 --- a/common.hpp +++ b/common.hpp @@ -116,7 +116,7 @@ constexpr size_t no_index = numeric_limits::max (); static_assert ((size_t) 0 - 1 == no_index); constexpr double NaN = numeric_limits::quiet_NaN (); - + // Global variables @@ -165,6 +165,11 @@ void beep (); +template + inline bool isNan (T x) + { return x != x; } + + // Comparison templates template @@ -465,10 +470,14 @@ template typedef map KeyValue; inline string find (const KeyValue& kv, - const string& key) + const string& key, + bool force) { const auto& it = kv. find (key); if (it == kv. end ()) + { if (force) + return key; throw runtime_error ("Key \"" + key + "\" is not found"); + } return it->second; } @@ -2087,15 +2096,17 @@ struct Root saveText (oss); return oss. str (); } +#if 0 void trace (ostream& os, const string& title) const; +#endif virtual void saveXml (Xml::File& /*f*/) const { throwf ("Root::saveXml() is not implemented"); } virtual Json* toJson (JsonContainer* /*parent_arg*/, const string& /*name_arg*/) const { throwf ("Root::toJson() is not implemented"); } virtual bool empty () const - { return true; } + { throwf ("Root::empty() is not implemented"); } virtual void clear () { throwf ("Root::clear() is not implemented"); } // Postcondition: empty() diff --git a/stx b/stx index 1fd945e..fc3dab3 160000 --- a/stx +++ b/stx @@ -1 +1 @@ -Subproject commit 1fd945e52028234b8b2ba89475dbe62aac17167e +Subproject commit fc3dab30e1143cd8a7afc3a3664882a7bcaef786 diff --git a/version.txt b/version.txt index d13e837..43beb40 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -4.0.6 +4.0.7