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 function error #43

Closed danicats closed 3 years ago

danicats commented 3 years ago

ERROR Reading file '/home/danicats/miniconda3/share/amrfinderplus/data/latest/database_format_version.txt' Cannot open file '/home/danicats/miniconda3/share/amrfinderplus/data/latest/database_format_version.txt' To download the latest version to the default directory run: amrfinder -u

HOSTNAME: smsh11dsu-srcf-d15-38.scg.stanford.edu SHELL: /bin/bash PWD: /labs/asbhatt/danicats/CRISPR Progam name: amrfinder Command line: amrfinder -u

evolarjun commented 3 years ago

I'm not sure if this will help, but can you try:

amrfinder --force_update
vbrover commented 3 years ago

What is the result of this command? ls -laF /home/danicats/miniconda3/share/amrfinderplus/data/latest/database_format_version.txt

Also please post the lines preceding the *** ERROR *** line.

danicats commented 3 years ago

Thanks for your help. When I try the force update I get this: $ amrfinder --force_update Running: amrfinder --force_update Software directory: '/home/danicats/miniconda3/bin/' Software version: 3.9.3 Running: /home/danicats/miniconda3/bin/amrfinder_update -d /home/danicats/miniconda3/share/amrfinderplus/data --force_update Looking up databases at https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/ '/home/danicats/miniconda3/share/amrfinderplus/data/2020-11-09.1/' already exists, overwriting what was there Downloading AMRFinder database version 2020-11-09.1 into '/home/danicats/miniconda3/share/amrfinderplus/data/2020-11-09.1/' Indexing

ERROR Command failed: '/home/danicats/miniconda3/bin/makeblastdb' -in /tmp/nqyyvY.db/AMRProt -dbtype prot -logfile /dev/null status = 65280

HOSTNAME: smsh11dsu-srcf-d15-37.scg.stanford.edu SHELL: /bin/bash PWD: /home/danicats/miniconda3/share/amrfinderplus/data/latest/2020-11-09.1 Progam name: amrfinder_update Command line: /home/danicats/miniconda3/bin/amrfinder_update -d /home/danicats/miniconda3/share/amrfinderplus/data --force_update

ERROR

HOSTNAME: smsh11dsu-srcf-d15-37.scg.stanford.edu SHELL: /bin/bash PWD: /home/danicats/miniconda3/share/amrfinderplus/data/latest/2020-11-09.1 Progam name: amrfinder Command line: amrfinder --force_update

When I try the ls -laF command as you typed it - it says there is no such file or directory, but if I add another directory to complete the path is says:

ls -laF /home/danicats/miniconda3/share/amrfinderplus/data/latest/2020-11-09.1/database_format_version.txt -rw-rw-r-- 1 danicats upg_danicats 6 Nov 13 16:01 /home/danicats/miniconda3/share/amrfinderplus/data/latest/2020-11-09.1/database_format_version.txt

vbrover commented 3 years ago

The failure of makeblastdb is an additional problem.

The latest must be a link. For example:

$ amrfinder -u
Running: amrfinder -u
Software directory: '/home/brovervv/code/amrfinder/'
Software version: 3.9.4
Running: /home/brovervv/code/amrfinder/amrfinder_update -d /home/brovervv/code/amrfinder/data
Looking up databases at https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/
Downloading AMRFinder database version 2020-11-09.1 into '/home/brovervv/code/amrfinder/data/2020-11-09.1/'
Indexing
Database directory: '/home/brovervv/code/amrfinder/data/2020-11-09.1'
Database version: 2020-11-09.1
$ ls -laF ~/code/amrfinder/data/
total 16
drwxr-xr-x 3 brovervv genomes 4096 Nov 16 16:29 ./
drwxr-xr-x 3 brovervv genomes 4096 Nov 16 16:29 ../
drwxr-xr-x 2 brovervv genomes 8192 Nov 16 16:29 2020-11-09.1/
lrwxrwxrwx 1 brovervv genomes   47 Nov 16 16:29 latest -> /home/brovervv/code/amrfinder/data/2020-11-09.1/

I recommend removing all AMRFinderPlus files and directories and a complete reinstalling of AMRFinderPlus.

evolarjun commented 3 years ago

Hi @danicats,

Sorry you're having this problem. It looks like there is a problem with the directory settings via the bioconda package, but I haven't been able to reproduce it so far. I'm not sure what happened, but Slava's suggestion may help. You can uninstall and reinstall via:

conda uninstall ncbi-amrfinderplus
rm -r /home/danicats/miniconda3/share/amrfinderplus
conda install ncbi-amrfinderplus
amrfinder --force_update

If that doesn't fix your problem then I am thinking this may have something to do with the conda environment. If you're still having issues could you try the following once you've reinstalled AMRFinderPlus and post the output:

echo 'CONDA_PREFIX=' $CONDA_PREFIX
echo 'PREFIX=' $PREFIX

Thanks, Arjun

danicats commented 3 years ago

Thanks so much for your help. I tried uninstalling and removing directories and then reinstalling again, and I'm still having the same issue.

Here are the outputs:

echo 'CONDA_PREFIX=' $CONDA_PREFIX CONDA_PREFIX= /home/danicats/miniconda3

echo 'PREFIX=' $PREFIX PREFIX=

evolarjun commented 3 years ago

Those values look like what I would expect.

I'm trying to figure out what's going on, but in the meantime it looks like you're doing this on linux, so you can try just downloading the binary and running that instead (conda will handle BLAST, HMMER, and the curl libraries). Installation instructions are at https://github.com/ncbi/amr/wiki/Install-with-binary#installing-amrfinderplus-itself.

Let us know how it goes and I will post here if I can reproduce your issue.

danicats commented 3 years ago

Thanks for the help! I figured out that it is a problem with running it on the compute cluster. If I run everything locally it works.

evolarjun commented 3 years ago

I'm glad you got it working. I'm not sure why it wasn't working on the compute cluster. It could be something about the environment on the cluster. If you're not already doing it maybe runningsource home/danicats/miniconda3/bin/activate; amrfinder -u before your commands would help. I'm glad you got it working, and let us know if you have any other issues.