arpcard / rgi

Resistance Gene Identifier (RGI). Software to predict resistomes from protein or nucleotide data, including metagenomics data, based on homology and SNP models.
Other
330 stars 78 forks source link

[BUG] unable to load any databases, local or system #143

Closed ewissel closed 3 years ago

ewissel commented 3 years ago

Describe the bug I am trying to install the databases and load them as described in the tutorial. Here is what I am trying to run. It seems that no data can be loaded with RGI, rending the tool not functional. If anyone has encountered this problem or knows a work around, please let me know! This will be my final attempt with RGI unless there is input from a maintainer.

Input

## this is water the wget/tar commands from tutorial, all three of these commands fail
 rgi load --card_json ./card.json --local 
 rgi load --card_json ./card.json 
 rgi wildcard_annotation -i wildcard --card_json ./card.json  > wildcard_annotation.log 2>&1 

Error log

rgi load: error: unrecognized arguments: --card_json ./card.json

RGI version This is using the RGI conda install, v4.0.3.

System info run on linux server (Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64)

fmaguire commented 3 years ago

Hi,

It looks like your version of RGI is from Apr 2018. Unfortunately, the features you are trying to use (e.g., wildcard/rgi-bwt) didn't exist 3 years ago and the the documentation and the command line flags have been changed since then.

However, if you update to 5.1.1 (the current version of RGI in bioconda v5.1.1) the instructions should work as expected.

It is frustrating but occasionally conda fails (upstream of RGI due to index issues) and installs weirdly old versions of tools. Try and ensure conda itself is updated and that channels are added in the correct order. Then conda create -n rgi rgi=5.1.1 should work!

If conda is still causing issues I find mamba a lot less liable to this issue, so you can try using that instead of conda to do the install.

Alternatively, a docker container is provided that has RGI pre-installed.

I suspect this may have been the same issue you had in #130

ewissel commented 3 years ago

I'm having the same issue with the docker image of rgi v.5.1.1.

Here is the set up:

docker pull finlaymaguire/rgi:latest 
docker run -v $PWD:/data finlaymaguire/rgi rgi -h 
docker run -v $PWD:/data finlaymaguire/rgi rgi load --card_json ./card.json --local 
wget -O wildcard_data.tar.bz2 https://card.mcmaster.ca/latest/variants mkdir -p wildcard  
tar -xjf wildcard_data.tar.bz2 -C wildcard gunzip wildcard/*.gz 

docker run -v $PWD:/data finlaymaguire/rgi rgi wildcard_annotation -i wildcard --version 3.0.1 --card_json ./card.json  > wildcard_annotation.log 2>&1 

docker run -v $PWD:/data finlaymaguire/rg rgi load --wildcard_annotation wildcard_database_v3.0.1.fasta \ --wildcard_index /wildcard/index-for-model-sequences.txt \ --card_annotation card_database_v3.1.1.fasta --local 

docker run -v $PWD:/data finlaymaguire/rgi rgi card_annotation -i /card.json > card_annotation.log 2>&1 rgi load -i /card.json --card_annotation card_database_v3.1.1.fasta 

docker run -v $PWD:/data finlaymaguire/rgi rgi load --wildcard_annotation wildcard_database_v3.0.1.fasta \ --wildcard_index wildcard/index-for-model-sequences.txt \ --card_annotation card_database_v3.1.1.fasta 

The error I'm getting is the same as before:

ERROR conda.cli.main_run:execute(32): Subprocess for 'conda run ['rgi', 'load', '--wildcard_annotation', 'wildcard_database_v3.0.1.fasta', ' --wildcard_index', 'wildcard/index-for-model-sequences.txt', ' --card_annotation', 'card_database_v3.1.1.fasta']' command failed. (See above for error) usage: rgi load [-h] [-i CARD_JSON] [--card_annotation CARD_ANNOTATION] [--wildcard_annotation WILDCARD_ANNOTATION] [--wildcard_index WILDCARD_INDEX] [--wildcard_version WILDCARD_VERSION] [--baits_annotation BAITS_ANNOTATION] [--baits_index BAITS_INDEX] [--kmer_database KMER_DATABASE] [--amr_kmers AMR_KMERS] [--kmer_size KMER_SIZE] [--local] [--debug] rgi load: error: unrecognized arguments: --wildcard_index wildcard/index-for-model-sequences.txt --card_annotation card_database_v3.1.1.fasta

I'm not sure why it is throwing conda in the error because I'm explicitly calling docker. This is v.5.1.1 so I'm not sure why this error is still present. Any ideas?

fmaguire commented 3 years ago

There are a few issues here, but to make things easy I've just updated the container to the latest database releases so if you re-run docker pull finlaymaguire/rgi:latest you should get a container that has all the databases pre-installed at the latest version.

Check this has worked correctly by running: docker run finlaymaguire/rgi rgi database --all --version

and you should see: card_canonical: 3.1.1 | card_variants: 3.0.8 | kmer_sizes: 61

Now you can run go ahead and run your analyses without having to reload the databases.