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

ncbi_acc_download.errors.DownloadError: Download failed with return code: 400 #11

Closed
shimingtan opened this issue Jun 10, 2019 · 3 comments

Comments

@shimingtan
Copy link

Hello there,

I came to an error when I was trying to download the Genbank file with an accession ID.

(tsm-py3) tanshiming@S620100019205:~/databases/mam_genes/combined-mam/fna$ ncbi-acc-download -m nucleotide AAL09996
Failed to download file with id AAL09996 from NCBI
Traceback (most recent call last):
  File "/home/tanshiming/anaconda3/envs/tsm-py3/bin/ncbi-acc-download", line 10, in <module>
    sys.exit(main())
  File "/home/tanshiming/anaconda3/envs/tsm-py3/lib/python3.6/site-packages/ncbi_acc_download/__main__.py", line 54, in main
    download_to_file(dl_id, config, filename, append)
  File "/home/tanshiming/anaconda3/envs/tsm-py3/lib/python3.6/site-packages/ncbi_acc_download/core.py", line 110, in download_to_file
    r = get_stream(url, params)
  File "/home/tanshiming/anaconda3/envs/tsm-py3/lib/python3.6/site-packages/ncbi_acc_download/download.py", line 90, in get_stream
    raise DownloadError("Download failed with return code: {}".format(r.status_code))
ncbi_acc_download.errors.DownloadError: Download failed with return code: 400

Could you please advice? Appreciate your input!

@kblin
Copy link
Owner

kblin commented Jun 11, 2019

Hi. I think the issue is that AAL09996 seems to be a protein record and you're requesting a nucleotide entry. This causes the Entrez server to return the error code 400.

I think I need to make the error message more clear for this, sorry about that.

@kblin
Copy link
Owner

kblin commented Jun 11, 2019

Just to follow up ncbi-acc-download -m protein AAL09996 works just fine and grabs the protein FASTA file for AAL09996.

@kblin
Copy link
Owner

kblin commented Jun 13, 2019

I just realised this is a duplicate #1 for the "enhancement" part. I'll just go ahead and close the issue, but feel free to ask again if you still have questions.

@kblin kblin closed this as completed Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants