ncbi / amr

AMRFinderPlus - Identify AMR genes and point mutations, and virulence and stress resistance genes in assembled bacterial nucleotide and protein sequence.
https://www.ncbi.nlm.nih.gov/pathogens/antimicrobial-resistance/AMRFinder/
Other
264 stars 37 forks source link

amrfinder -u fails with error, recommends running amrfinder -u #19

Closed crashfrog closed 1 year ago

crashfrog commented 4 years ago

I have a conda environment with AMRFinder+ 3.2.3 but haven't been able to install the database:

$ amrfinder -u
Running amrfinder -u
WARNING: Updating database directory works only for databases with the default data directory format.
Please see https://github.com/ncbi/amr/wiki for details.
Current database directory is: "/Users/justin.payne/.miniconda3/envs/amrfinder/share/amrfinderplus/data"
New database directories will be created as subdirectories of "/Users/justin.payne/.miniconda3/envs/amrfinder/share/amrfinderplus/data"

*** ERROR ***
No valid AMRFinder database found.
To download the latest version to the default directory run amrfinder -u

HOSTNAME: CFM5081487.fda.gov
PWD: /Users/justin.payne/.miniconda3/envs/amrfinder/share/amrfinderplus/data
Progam name:  amrfinder
Command line: amrfinder -u
vbrover commented 4 years ago

This is s bug, we will fix it.

What is going on is that the directory /Users/justin.payne/.miniconda3/envs/amrfinder/share/amrfinderplus/data/ is expected to contain the subdirectory latest/.

You can always successfully update the database by running amrfinder_update -d <database directory>.

Or manually download the files from https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/latest/.

evolarjun commented 4 years ago

Hi Justin, Did the amrfinder_update command help?

We're not completely sure what went wrong with amrfinder -u and want to make sure we can reproduce.

Could you post (or email us) the results of ls -l /Users/justin.payne/.miniconda3/envs/amrfinder/share/amrfinderplus/data?

crashfrog commented 4 years ago

Did the amrfinder_update command help?

Looks like it did, yes. I was able to use it to download October's database. Thanks much!

Could you post (or email us) the results of ls -l /Users/justin.payne/.miniconda3/envs/amrfinder/share/amrfinderplus/data

The folder was empty.

evolarjun commented 4 years ago

Thanks!

evolarjun commented 4 years ago

We haven't been able to replicate this issue. We tried to improve the amrfinder update process slightly for the next release and added some documentation about using the amrfinder_update command that will be published with the upcoming AMRFinderPlus release. If this continues to be an issue please reopen this issue or create a new one and we'll try to figure it out.

cyanoluu commented 1 year ago

Dear all,

I would like to ask you for help. Nothing works, amrfinder -u neither manual database download. Manual database download allow download only html.index. Is it mine fault? I used commnad:

wget https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/latest/.

Otherwise, when I try to run amrfinder -u, I got this:

ERROR "amrfinder_update.cpp", line 188: pos2 != string::npos Stack: /home/sehnal/miniconda3/envs/amrfinder/bin/amrfinder_update(+0x1145a) [0x561d0554d45a] /home/sehnal/miniconda3/envs/amrfinder/bin/amrfinder_update(+0x24adc) [0x561d05560adc] /home/sehnal/miniconda3/envs/amrfinder/bin/amrfinder_update(+0x64f3) [0x561d055424f3] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7fd62abb6083] /home/sehnal/miniconda3/envs/amrfinder/bin/amrfinder_update(+0x6871) [0x561d05542871]

Thanks for any help. Ludek

vbrover commented 1 year ago

What is the version of amrfinder you are using? To get the version please run

amrfinder --version
cyanoluu commented 1 year ago

3.10.1

evolarjun commented 1 year ago

Hi Ludek,

I think I've seen something like this before for people using a fairly old version of AMRFinderPlus. Upgrading the version of the software you're using should fix it if I'm correct about the problem. See the upgrade documentation, but assuming you have a standard conda installation the following should update the software:

conda update -c bioconda -c conda-forge ncbi-amrfinderplus

If it's still not working the output of amrfinder --version and conda update -c bioconda -c conda-forge ncbi-amrfinderplus would be helpful.

Thanks, Arjun

cyanoluu commented 1 year ago

Hi Arjun,

as I wrote couple minutes ago, version is 3.10.1. I tried to update it but still the same version and the same problem.

(amrfinder) sehnal@ibminode05:~$ amrfinder --version 3.10.1 (amrfinder) sehnal@ibminode05:~$ conda update -c bioconda -c conda-forge ncbi-amrfinderplus Collecting package metadata (current_repodata.json): done Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): done Solving environment: done

Package Plan

environment location: /home/sehnal/miniconda3/envs/amrfinder

added / updated specs:

The following NEW packages will be INSTALLED:

gettext conda-forge/linux-64::gettext-0.21.1-h27087fc_0 libzlib conda-forge/linux-64::libzlib-1.2.13-h166bdaf_4 tk conda-forge/linux-64::tk-8.6.12-h27826a3_0

The following packages will be REMOVED:

perl-exporter-tiny-1.002001-pl526_0 perl-list-moreutils-xs-0.428-pl526_0 perl-types-serialiser-1.0-pl526_2 perl-xsloader-0.24-pl526_0

The following packages will be UPDATED:

bzip2 pkgs/main::bzip2-1.0.8-h7b6447c_0 --> conda-forge::bzip2-1.0.8-h7f98852_4 curl pkgs/main::curl-7.71.1-h8f29fe8_2 --> conda-forge::curl-7.71.1-he644dc0_3 libcurl pkgs/main::libcurl-7.71.1-h303737a_2 --> conda-forge::libcurl-7.71.1-hcdd3856_3 libgcc-ng pkgs/main::libgcc-ng-11.2.0-h1234567_1 --> conda-forge::libgcc-ng-12.2.0-h65d4601_19 libgomp pkgs/main::libgomp-11.2.0-h1234567_1 --> conda-forge::libgomp-12.2.0-h65d4601_19 libidn2 pkgs/main::libidn2-2.3.2-h7f8727e_0 --> conda-forge::libidn2-2.3.4-h166bdaf_0 libssh2 pkgs/main::libssh2-1.10.0-h8f2d780_0 --> conda-forge::libssh2-1.10.0-haa6b8db_3 libstdcxx-ng pkgs/main::libstdcxx-ng-11.2.0-h12345~ --> conda-forge::libstdcxx-ng-12.2.0-h46fd767_19 perl pkgs/main::perl-5.26.2-h14c3975_0 --> conda-forge::perl-5.26.2-h36c2ea0_1008 zlib pkgs/main::zlib-1.2.13-h5eee18b_0 --> conda-forge::zlib-1.2.13-h166bdaf_4

The following packages will be SUPERSEDED by a higher-priority channel:

_libgcc_mutex pkgs/main::_libgcc_mutex-0.1-main --> conda-forge::_libgcc_mutex-0.1-conda_forge _openmp_mutex pkgs/main::_openmp_mutex-5.1-1_gnu --> conda-forge::_openmp_mutex-4.5-2_gnu ca-certificates pkgs/main::ca-certificates-2023.01.10~ --> conda-forge::ca-certificates-2022.12.7-ha878542_0 krb5 pkgs/main::krb5-1.19.4-h568e23c_0 --> conda-forge::krb5-1.17.2-h926e7f8_0 libedit pkgs/main::libedit-3.1.20221030-h5eee~ --> conda-forge::libedit-3.1.20191231-he28a2e2_2 libunistring pkgs/main::libunistring-0.9.10-h27cfd~ --> conda-forge::libunistring-0.9.10-h7f98852_0 ncurses pkgs/main::ncurses-6.4-h6a678d5_0 --> conda-forge::ncurses-6.3-h27087fc_1 openssl pkgs/main::openssl-1.1.1t-h7f8727e_0 --> conda-forge::openssl-1.1.1t-h0b41bf4_0 pcre pkgs/main::pcre-8.45-h295c915_0 --> conda-forge::pcre-8.45-h9c3ff4c_0 wget pkgs/main::wget-1.21.3-h0b77cf5_0 --> conda-forge::wget-1.20.3-ha56f1ee_1

The following packages will be DOWNGRADED:

perl-json-xs 2.34-pl526h6bb024c_3 --> 2.34-pl526_1 perl-list-moreuti~ 0.428-pl526_1 --> 0.15-pl526_1

Proceed ([y]/n)? y

Downloading and Extracting Packages

Preparing transaction: done Verifying transaction: done Executing transaction: done (amrfinder) sehnal@ibminode05:~$ amrfinder --version 3.10.1

vbrover commented 1 year ago

The current version in github is 3.11.2.

evolarjun commented 1 year ago

So it looks like conda doesn't want to upgrade you to the latest version. Three possible solutions:

1. Try the --force-reinstall option to conda update

conda update --force-reinstall -c bioconda -c conda-forge ncbi-amrfinderplus

2. Create a new conda environment and install ncbi-amrfinderplus fresh

conda create -y -c bioconda -c conda-forge  -n amrfinder ncbi-amrfinderplus

Then you'd have to use conda activate amrfinder to get into that environment.

3. Install from binaries

This is generally quite simple, assuming you're using a linux machine. Especially since you already have the dependencies BLAST and HMMER installed through conda. See the instructions for installing the binaries.

Please let us know which, if any, of those options work for you so we can update the documentation for other people that are in a similar situation.

Thanks! Arjun

cyanoluu commented 1 year ago

I guess that two important things that I should write: I am trying to install it on server machine, and, of course, linux.

I was successful with installation, but I really don't understand why. First, when I installed amrfinder, I just copied command from installation guide:

conda create -y -c bioconda -c conda-forge -n amrfinder ncbi-amrfinderplus

It didn't work as we discussed, installed old version, no possible update. I tried to bypass that through mamba (that usually solve conflict of dependencies), it was also not possible. It identified some of lib dependencies as a problem that cannot be solve.

Now, I tried just shuffle command a bit, as I am used to:

conda create -n amrfinder -c conda-forge -c bioconda -y ncbi-amrfinderplus

And it works, version 3.11.2, amrfinder -u works as well. I did restart of the terminal also before, so it is not the reason as well.

Anyway, thank you very much for your fast help and tips.

evolarjun commented 1 year ago

@cyanoluu Thank you!

I just went googling and looking at the bioconda docs, and I think you are using the now-recommended order. (e.g., https://github.com/bioconda/bioconda-recipes/pull/10924). It looks like the change was made way back in 2018 and I totally missed it.

I hadn't realized that bioconda had changed the recommended channel order. I guess some old packages are sitting orphaned in bioconda after they've been "promoted" to conda-forge. We've had one or two other reports of bioconda issues that I couldn't reproduce, and I'm guessing the source of the problem is the same. I will run some tests and change the documentation. Thank you very much for bringing our attention to this. For some reason this issue hasn't bitten us in any of our testing, but I have a feeling it's hitting others.