Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to Skip the AMR detection step #268

Open
abelTan131 opened this issue Jan 17, 2024 · 11 comments
Open

Option to Skip the AMR detection step #268

abelTan131 opened this issue Jan 17, 2024 · 11 comments
Labels
enhancement New feature or request

Comments

@abelTan131
Copy link

Is your feature request related to an existing issue or bug?
Briefly reference any existing issues this is related to.

I run my file and got:
Traceback (most recent call last):
File "/opt/conda/bin/bakta", line 8, in
sys.exit(main())
File "/opt/conda/lib/python3.8/site-packages/bakta/main.py", line 275, in main
expert_amr_found = exp_amr.search(cdss, cds_aa_path)
File "/opt/conda/lib/python3.8/site-packages/bakta/expert/amrfinder.py", line 47, in search
raise Exception(f"amrfinder error! error code: {proc.returncode}. Please, try 'amrfinder_update --force_update --database {amrfinderplus_db_path}' to update AMRFinderPlus's internal database.")
Exception: amrfinder error! error code: 1. Please, try 'amrfinder_update --force_update --database /tllhome/abel/bakta/db-light/amrfinderplus-db' to update AMRFinderPlus's internal database.

Is your new feature related to a general problem?
Please provide us with a concise description of what the problem is:

  • what happened which was not expected
  • what did not happen which was expected
  • what would you like to happen or see in the output
    I dont want the AMR genes, I just want the gene annotation. Can we skip it?

Describe the solution you'd like
A clear and concise description of what you want to happen.
Option to skip the AMR detection step, so I dont get this error.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or information about your feature request here.

@abelTan131 abelTan131 added the enhancement New feature or request label Jan 17, 2024
@gracehm
Copy link

gracehm commented Jan 18, 2024

Hi, I just wanted to add that we are also facing the same issue, only as of yesterday. We haven't been able to solve it yet, but I wanted to add in case it is a potential update issue.

@oschwengers
Copy link
Owner

Hi @abelTan131 , @gracehm ,
thanks for reporting. We also see these issues with the AMRFinderPlus update from time to time. However, I'm still puzzled what causes these effects. I have updated the DB download routine and relaxed file permissions which are set during the download/update. Maybe this helps a bit here. This is active in the new v1.9.2 patch release. I also published a huge database update this week v5.1. You might want to try this one.

FYI: the amrfinder_update --force_update --database <path-to-bakta-db>/amrfinderplus-db/ command as suggested by the Bakta error output did the job in my cases.

@aldertzomer
Copy link

Same problem here. Will try the update. Does it have to do with this amrfinderplus issue: ncbi/amr#89 ?

@oschwengers
Copy link
Owner

Hi @aldertzomer, sorry for the late reply. No, the issue you've referenced is quite old and is already fixed IMHO. So, I don't think that this error is related to that issue. I rather see this caused by the new AMRFinderPlus DB version which is not compatible with former versions. Hence, an update of Bakta with the newest AMRFinderPlus version and an DB update should solve this.

@DanielleMStevens
Copy link

I was having the same issue. My fix was updating both Bakta (v1.9.3) and AMRFinderPlus with both:

amrfinder_update --force_update --database <path-to-bakta-db>/amrfinderplus-db/
amrfinder --force_update

Though the first few tries didn't work until I updated the read/write/execute permissions of the amrfinderplus-db directory. Can't say if its the same issue but may be something to check.

@sariamead
Copy link

I am having the same issue. I've reinstalled Bakta via conda (v1.8.1) and tried the force update for AMRFinderPlus. Bakta seems to work fine until reaching the AMR detection step and then throws the following error:
Exception: amrfinder error! error code: 1. Please, try 'amrfinder_update --force_update --database db_path to update AMRFinderPlus's internal databases

@oschwengers
Copy link
Owner

Could you please try to update Bakta and AMRFInderPlus to the latest versions and then re-install the Bakta db?

It is certainly related to different Software/Database version dependencies of AMRFinderPlus.

A successful quick test:

$ mamba create -p ./conda-env --quiet --yes bakta=1.9.4
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done

$ mamba activate ./conda-env/
(/home/oliver/tmp/bakta-test/conda-env) $ bakta_db download --type light
Bakta software version: 1.9.4
Required database schema version: 5
Selected DB type: light
Fetch DB versions...
	... compatible DB versions: 2
Download database: v5.1, type=light, 2024-01-19, DOI: 10.5281/zenodo.10522951, URL: https://zenodo.org/record/10522951/files/db-light.tar.gz...
|████████████████████████████████████████| 1.48G/1.48G [100%] in 40.7s (36.46M/s) 
	... done
Check MD5 sum...
	...database file OK: 31b3fbdceace50930f8607f8d664d3f4
Extract DB tarball: file=<...>/db-light.tar.gz, output=<...>bakta-test
Successfully downloaded Bakta database!
	version: 5.1
	Type: light
	DOI: 10.5281/zenodo.10522951
	path: <...>db-light
Update AMRFinderPlus database...
	... done
Run Bakta using '--db <...>db-light' or set a BAKTA_DB environment variable: 'export BAKTA_DB=<...>/db-light'

$ bakta --db db-light/ --output test ~/software/bakta/bakta/test/data/NC_002127.1.fna
parse genome sequences...
...
start annotation...
...
predict & annotate CDSs...
	predicted: 3 
	discarded spurious: 0
	revised translational exceptions: 0
	detected IPSs: 0
	found PSCCs: 3
	lookup annotations...
	conduct expert systems...
		amrfinder: 0
		protein sequences: 2
	combine annotations and mark hypotheticals...
	revise special cases...
extract sORF...
	potential: 52
	discarded due to overlaps: 36
	discarded spurious: 0
	detected IPSs: 0
	found PSCCs: 0
	lookup annotations...
	filter and combine annotations...
	filtered sORFs: 0
...
Annotation successfully finished in 0:15 [mm:ss].

@StickHu
Copy link

StickHu commented Aug 27, 2024

Same problem here. I've using the command line 'amrfinder_update --force_update --database /data/workdir/huwa/annotation/bakta_annotation/db/amrfinderplus-db'

But it failed with that

*** ERROR ***
CURL: Cannot read
from https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/
code=6
error: Could not resolve host: ftp.ncbi.nlm.nih.gov
version: 8.8.0

HOSTNAME: localhost
SHELL: /bin/bash
PWD: /data/workdir/huwa/annotation/bakta_annotation/db
PATH: /data/workdir/huwa/software/miniconda3/envs/bakta/bin:/data/workdir/huwa/software/miniconda3/condabin:/home/huwa/.local/bin:/home/huwa/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/data/workdir/huwa/software/miniconda3/bin:/data/workdir/huwa/software/miniconda3/bin
Progam name: amrfinder_update
Command line: amrfinder_update --force_update --database /data/workdir/huwa/annotation/bakta_annotation/db/amrfinderplus-db`

Could you please give me some advice on it? Thanks

@oschwengers
Copy link
Owner

Hi @StickHu ,
this seems to be a generic issue on your site. Looks like your machine cannot access the NCBI FTP server at all. Could you ask a local admin to help out?

@zexlibioinfo
Copy link

Hi @oschwengers,

I get a same update error on amrfinderplus database. I have tried to either reinstall bakta, or force update database, or directly download latest database from the amrfinderplus GitHub page but unfortunately can't resolve the issue. It is worthy to mention that I get a new error message running with debug mode: Protein sequences looks like a nucleotide sequences.

Here is the command I used:

bakta --db <path/to/bakta_db> --output ./bakta_test --prefix test --threads 32 --debug ./nucleotide/NZ_AAKL01000181.1.fna

Attach the test sequence:

>NZ_AAKL01000181.1
ACCTCCTCNNAAACATTAACTAACATCTCATATTTANTGNAANTTTNNGGNTTTTTTCCC
GATTTATGNTAGCCAAGAATCCTTTATATCCTTTCAGCATTAATATCAATATTCCAAAAT
GGTCCTCTTCATTCTCCAAGCCCCGNANNTCNNNTTCNNCNNNCNNNCCCCCCTTTTTTG
TCTCTTCNNCNTCCCNNTCTTTTTTCTCCCCTTNTACTAGACAGNGTNNNNNCNNNNNNN
CCTCCCTTCTTTCGTCTTTCCTCTTTTCTCCTTCCTNTCCCCCTTTTCTGGGGGGGGAAG
CGCGGCTCCTTTTTTCCCCCCCTCTTCCCCCTNCCCGTTCTCTTCCTGTGCTCCTTCCTC
CCTCCCTTTTCCCCCTGCCCTCGCCTTTCCGGCCTCCTCCCCTCCCCGTGTCCGCTCCCT
TTCCTCCCGCAACCGGCTTTCTCGCTCCCCTCTCCTCCCTCTCCCCTTCCCCCCCTCCTC
TTTGCTTGTCTCTCTCCCTCCTCCTCCCCTCTCTCCCCCCCCTCTTTCCTCTTTCTCCTT
TTTTCTCTCCTCCCTTCTCCCCCTCCCCCCTTTTGTGGTGGGGGGGGGGGGAAACCCCCC
CTTTTTTTTTTTTTTCCCCCCCCCCCCCCCNNNNNNNNNNNNNNNCNNCTTTTTAAAAAA
AAAAAAAAGAGGGGGGGTCTTCTCTTATCCTCCTCCACACACTATACTAAAAACATCAAC
AATATACAATAAATAAATCCATCCAAACAACATCACTACTTATAATAAACTACTAATTCT
AACAACCCCCACAACAACCACACACACACCCTACTAAACTCATAACTACCACACAATACT
CATACACTCTCACCATAAGAACAATAACTCAAATACTACATAAAAAAACAAACATATCCA
TCACTACAACTAATAACACCACACTAAAATATACATAACACCAATCAAAAATACCCACCC
TAATTCTAATACCCCACAAATAACTACTATTTACCAAACCCAACAACCAAAAATACCCAT
ATATTCTAAAAACTTCATACCCAACTAAACTAATCACAAACAAACAATCACACACAACCA
ACACTATCCAACCATCATTTTCCCACCCATATTAACTACTCCATCAAACATAAATACACT
AACACACAATCTCCCATCAACACCACATCCTTCACACAAACAAATCACAAAACTTAACCA
ACTCAAATATCAATTACAACTTCTACCATTATATTCATACACCAAATAACATCTCAACAT
CCATATCTCTCCTATCTAACTATCACATAAAAATAATTCAAATAAAAATATAAACCAAAT
ACTTCCAATTCTCCTCCCTACACCCATCCACTACCTATACCATCAATATCACACTCATAT
TAAAACACAAAACTCCATAACACACCACTCATATAATATTCAAATCTAAAACATTCTTCT
CATAAACAACCAACACAATCCACTAATAATAAACAATCTACTCACAAATTCTACCATCAT
ACCAATACATTACCCTTATACTACCCACTATTTCAAAACCTCTATCCCTAACTACCATAC
TTACTCATATCTCCATACCATCCCTTCACAATTNACATACCAACTATACACACATCTATC
ACATTATTACAATACCACAAATCAACACAATCACACCAATTGTCTCATAACTACACCACC
TTTAACATATTCTACAGATCATTCACATA

@ppflrs
Copy link

ppflrs commented Oct 1, 2024

Thanks @oschwengers for your work in bakta! Is there any chance to get the option to skip AMR detection added in future releases?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants