Skip to content

Commit 81f509d

Browse files
committed
Bug fix release 4.2.5
Addresses issue #174
2 parents 017cdac + 170fc9a commit 81f509d

14 files changed

Lines changed: 454 additions & 21 deletions

.github/workflows/binary.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: 30
1415
steps:
1516
- uses: actions/checkout@v4
1617
- name: prerequisites

.github/workflows/ccpp.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
linux_x86:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 30
1213
steps:
1314
- uses: actions/checkout@v4
1415
- name: prerequisites
@@ -35,6 +36,7 @@ jobs:
3536
path: amrfinder_binaries_v*.tar.gz
3637
linux-arm64:
3738
runs-on: ubuntu-24.04-arm
39+
timeout-minutes: 30
3840
steps:
3941
- uses: actions/checkout@v4
4042
- name: prerequisites

.github/workflows/conda.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
conda_linux_x86_64:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 30
1213
steps:
1314
- name: When was this run
1415
run: date
@@ -51,6 +52,7 @@ jobs:
5152
bash ./test_amrfinder.sh -p
5253
conda_linux_aarch64:
5354
runs-on: ubuntu-24.04-arm
55+
timeout-minutes: 30
5456
steps:
5557
- uses: conda-incubator/setup-miniconda@v3
5658
with:

.github/workflows/dockerhub.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ on:
1010
jobs:
1111

1212
test_dockerhub:
13-
1413
runs-on: ubuntu-latest
15-
14+
timeout-minutes: 30
1615
steps:
1716
- uses: actions/checkout@v4
1817
- name: Test docker

.github/workflows/mac_ccpp.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
macos_arm:
1111
runs-on: macos-latest
12+
timeout-minutes: 30
1213
steps:
1314
- uses: actions/checkout@v4
1415
- name: submodule checkout
@@ -41,6 +42,7 @@ jobs:
4142
path: amrfinder_binaries_macos_aarch64_v*.tar.gz
4243
macos_x86_64:
4344
runs-on: macos-13
45+
timeout-minutes: 30
4446
steps:
4547
- uses: actions/checkout@v4
4648
- name: submodule checkout

.github/workflows/mac_conda.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
conda_macos_aarch64:
1010
runs-on: macos-latest
11+
timeout-minutes: 30
1112
steps:
1213
- name: Install conda because built-in conda is borked
1314
run: |
@@ -57,6 +58,7 @@ jobs:
5758
bash ./test_amrfinder.sh -p
5859
conda_macos_x86_64:
5960
runs-on: macos-13
61+
timeout-minutes: 30
6062
steps:
6163
- name: Install conda because built-in conda is borked
6264
run: |

amrfinder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* Dependencies: NCBI BLAST, HMMer, libcurl, gunzip (optional)
3434
*
3535
* Release changes:
36+
* 4.2.5 12/05/2025 PD-5507 add AMRProt-susceptible.fa to amrfinder_update.cpp
3637
* 4.2.4 12/02/2025 PD-5495 If set use CURL_CA_BUNDLE environment variable for certificate authorities
3738
* 4.2.3 10/16/2025 PD-5469 QC_ASSERT error messages of amrfinder_update.cpp are made human readable
3839
* 4.2.2 09/25/2025 PD-5395 cirA_A169AERSPHNFPKATer becomes cirA_A169insTer10, ompK35_N...Y82del becomes ompK35_N82_Y310del

amrfinder_update.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838

3939

4040
// PAR
41+
#undef TEST_UPDATE
4142
#define HTTPS 1 // 0: FTP
42-
//#define TEST_UPDATE
4343

4444

4545

@@ -58,13 +58,15 @@ namespace
5858
{
5959

6060

61+
// URL
6162
#ifdef TEST_UPDATE
6263
#define URL "https://ftp.ncbi.nlm.nih.gov/pathogen/Technical/AMRFinder_technical/test_database/"
6364
#else
65+
#define URL_SUF "://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/"
6466
#if HTTPS
65-
#define URL "https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/"
67+
#define URL "https" URL_SUF
6668
#else
67-
#define URL "ftp://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/"
69+
#define URL "ftp" URL_SUF
6870
#endif
6971
#endif
7072

@@ -343,6 +345,7 @@ Requirement: the database directory contains subdirectories named by database ve
343345
fetchAMRFile (curl, urlDir, latestDir, "AMRProt.fa");
344346
fetchAMRFile (curl, urlDir, latestDir, "AMRProt-mutation.tsv");
345347
fetchAMRFile (curl, urlDir, latestDir, "AMRProt-suppress.tsv");
348+
fetchAMRFile (curl, urlDir, latestDir, "AMRProt-susceptible.fa");
346349
fetchAMRFile (curl, urlDir, latestDir, "AMRProt-susceptible.tsv");
347350
fetchAMRFile (curl, urlDir, latestDir, "AMR_CDS.fa");
348351
fetchAMRFile (curl, urlDir, latestDir, "database_format_version.txt"); // PD-3051

common.hpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ template <typename T /*:number*/>
206206
inline bool between (T x, T low, T high)
207207
{ return x >= low && x < high; }
208208

209-
template <typename T/*:number*/>
209+
template <typename T /*:number*/>
210210
inline bool betweenEqual (T x, T low, T high)
211211
{ return x >= low && x <= high; }
212212

@@ -2536,6 +2536,19 @@ template <typename T>
25362536
toDelete--;
25372537
}
25382538
}
2539+
Vector<T> subvec (size_t from,
2540+
size_t count = no_index) const
2541+
{ Vector<T> res;
2542+
if (from >= P::size ())
2543+
return res;
2544+
size_t size = P::size () - from;
2545+
if (count != no_index)
2546+
minimize (size, count);
2547+
res. reserve (size);
2548+
for (size_t i = 0; i < size; i++)
2549+
res << (*this) [from + i];
2550+
return res;
2551+
}
25392552

25402553
void sort ()
25412554
{ if (ascending == etrue)
@@ -2686,8 +2699,7 @@ template <typename T>
26862699
}
26872700
template <typename U /* : T */>
26882701
void setMinus (const Vector<U> &other)
2689-
{ filterIndex ([&] (size_t i) { return other. containsFast ((*this) [i]); }); }
2690-
2702+
{ filterIndex ([&] (size_t i) { return other. containsFast ((*this) [i]); }); }
26912703
size_t findDuplicate (bool checkSortedP = true) const
26922704
{ if (P::size () <= 1)
26932705
return no_index;
@@ -3079,6 +3091,10 @@ template <typename T /* : Root */>
30793091

30803092

30813093

3094+
enum SetOperation {soIntersect, soUnion, soMinus};
3095+
3096+
3097+
30823098
template <typename T>
30833099
struct Set : set<T>
30843100
{

curl_easy.hpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,13 @@ struct Curl
6767

6868
Curl ()
6969
: eh (curl_easy_init ())
70-
{
71-
if (! eh)
72-
throw runtime_error ("Cannot initialize curl_easy");
73-
74-
// Check environment variable CURL_CA_BUNDLE for CA path
75-
// PD-5495 / https://github.com/ncbi/amr/issues/170
76-
const char *env_ca_bundle = getenv("CURL_CA_BUNDLE");
77-
if (env_ca_bundle) {
78-
// Override the libcurl system-wide default
79-
curl_easy_setopt(eh, CURLOPT_CAINFO, env_ca_bundle);
80-
}
70+
{ if (! eh)
71+
throw runtime_error ("Cannot initialize curl_easy");
72+
// Override the libcurl system-wide default
73+
// PD-5495 / https://github.com/ncbi/amr/issues/170
74+
if (const char *env_ca_bundle = getenv ("CURL_CA_BUNDLE"))
75+
curl_easy_setopt (eh, CURLOPT_CAINFO, env_ca_bundle);
8176
}
82-
8377
~Curl ()
8478
{ curl_easy_cleanup (eh); }
8579

0 commit comments

Comments
 (0)