Skip to main content

Download genome files from NCBI by accession.

Project description

# NCBI accession download script

A partner script to the popular [ncbi-genome-download](https://github.com/kblin/ncbi-genome-download) script, ncbi-acc-download allows you to download sequences from GenBank/RefSeq by accession through the NCBI [ENTREZ API](https://www.ncbi.nlm.nih.gov/books/NBK184582/).

## Installation

` pip install ncbi-acc-download `

Alternatively, clone this repository from GitHub, then run (in a python virtual environment) ` pip install . ` If this fails on older versions of Python, try updating your pip tool first: ` pip install --upgrade pip ` and then rerun the ncbi-acc-download install.

ncbi-acc-download is only developed and tested on Python releases still under active support by the Python project. At the moment, this means versions 2.7, 3.4, 3.5, 3.6 and 3.7. Specifically, no attempt at testing under Python versions older than 2.7 or 3.4 is being made.

If your system is stuck on an older version of Python, consider using a tool like [Homebrew](http://brew.sh) or [Linuxbrew](http://linuxbrew.sh) to obtain a more up-to-date version.

## Usage

To download a nucleotide record AB_12345 in GenBank format, run ` ncbi-acc-download AB_12345 `

To download a nucleotide record AB_12345 in FASTA format, run ` ncbi-acc-download --format fasta AB_12345 `

To download a protein record WP_12345 in FASTA format, run ` ncbi-acc-download --molecule protein WP_12345 `

To just generate a list of download URLs to run the actual download elsewhere, run ` ncbi-acc-download --url AB_12345 `

If you want to concatenate multiple sequences into a single file, run ` ncbi-acc-download --out two_genomes.gbk AB_12345 AB_23456 `

You can use this with /dev/stdout as the filename to print the downloaded data to standard output instead of writing to a file if you want to chain ncbi-acc-download with other command line tools, like so: ` ncbi-genome-download --out /dev/stdout --format fasta AB_12345 AB_23456 | gzip > two_genomes.fa.gz `

If you want to download all records covered by a WGS master record instead of the master record itself, run ` ncbi-acc-download --recursive NZ_EXMP01000000 `

You can get more detailed information on the download progress by using the –verbose or -v flag.

To get an overview of all options, run ` ncbi-acc-download --help `

## License All code is available under the Apache License version 2, see the [LICENSE](LICENSE) file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ncbi-acc-download-0.2.4.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

ncbi_acc_download-0.2.4-py2.py3-none-any.whl (13.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file ncbi-acc-download-0.2.4.tar.gz.

File metadata

  • Download URL: ncbi-acc-download-0.2.4.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.3

File hashes

Hashes for ncbi-acc-download-0.2.4.tar.gz
Algorithm Hash digest
SHA256 d96bd794dfef6048879710c809b4df470a44cc06b3996de6741980cfb631e2ef
MD5 a92d8c42c1a7d3fe0c519b0c437e028c
BLAKE2b-256 4cd0510aa19f198951e9ab4252311dc2be0461af0cdecf3961d76d1321bab22b

See more details on using hashes here.

File details

Details for the file ncbi_acc_download-0.2.4-py2.py3-none-any.whl.

File metadata

  • Download URL: ncbi_acc_download-0.2.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.3

File hashes

Hashes for ncbi_acc_download-0.2.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e483c8c3624a3d578138be9042a87e4e35efdf5abeefd5cd0d0c65d5c015db40
MD5 1c188648cee2343b6b01c6f875f0c9cd
BLAKE2b-256 7f7d92195263f786fd9906ec022d9f05dc9cd379df7394a800aacf13b05771bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page