Skip to main content

Utility to fetch public and private RAW read and assembly files from the ENA

Project description

Testing PyPI version Docker Repository on Quay

Microbiome Informatics ENA fetch tool

Set of tools which allows you to fetch RAW read and assembly files from the European Nucleotide Archive (ENA).

Install fetch tool

Install from Pypi

$ pip install fetch-tool

Install from the git repo

$ pip install https://github.com/EBI-Metagenomics/fetch_tool/archive/master.zip

Configuration options

The tool has a number of options, with sensible defaults for the most common use cases.

Setup the configuration file, the template fetchdata-config-template.json for the configuration file.

The required fields are:

  • ena_api_user
  • ena_api_password

Fetch read files (amplicon and WGS data)

Usage

$ fetch-read-tool -h
usage: fetch-read-tool [-h] [-p PROJECTS [PROJECTS ...] | -l PROJECT_LIST] [-d DIR] [-v] [--version] [-f] [--ignore-errors] [--private] [-i] [-c CONFIG_FILE] [--fix-desc-file] [-ru RUNS [RUNS ...]
                       | --run-list RUN_LIST]

optional arguments:
  -h, --help            show this help message and exit
  -p PROJECTS [PROJECTS ...], --projects PROJECTS [PROJECTS ...]
                        Whitespace separated list of project accession(s)
  -l PROJECT_LIST, --project-list PROJECT_LIST
                        File containing line-separated project list
  -d DIR, --dir DIR     Base directory for downloads
  -v, --verbose         Verbose
  --version             Version
  -f, --force           Ignore download errors and force re-download all files
  --ignore-errors       Ignore download errors and continue
  --private             Use when fetching private data
  -i, --interactive     interactive mode - allows you to skip failed downloads.
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        Alternative config file
  --fix-desc-file       Fixed runs in project description file
  -ru RUNS [RUNS ...], --runs RUNS [RUNS ...]
                        Run accession(s), whitespace separated. Use to download only certain project runs
  --run-list RUN_LIST   File containing line-separated run accessions

Example

Download amplicon study:

$ fetch-read-tool -p SRP062869 -v -d /home/<user>/temp/

Fetch assembly files

Usage

fetch-assembly-tool -h
usage: fetch-assembly-tool [-h] [-p PROJECTS [PROJECTS ...] | -l PROJECT_LIST] [-d DIR] [-v] [--version] [-f] [--ignore-errors] [--private] [-i] [-c CONFIG_FILE] [--fix-desc-file]
                           [-as ASSEMBLIES [ASSEMBLIES ...]] [--assembly-type {primary metagenome,binned metagenome,metatranscriptome}] [--assembly-list ASSEMBLY_LIST]

optional arguments:
  -h, --help            show this help message and exit
  -p PROJECTS [PROJECTS ...], --projects PROJECTS [PROJECTS ...]
                        Whitespace separated list of project accession(s)
  -l PROJECT_LIST, --project-list PROJECT_LIST
                        File containing line-separated project list
  -d DIR, --dir DIR     Base directory for downloads
  -v, --verbose         Verbose
  --version             Version
  -f, --force           Ignore download errors and force re-download all files
  --ignore-errors       Ignore download errors and continue
  --private             Use when fetching private data
  -i, --interactive     interactive mode - allows you to skip failed downloads.
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        Alternative config file
  --fix-desc-file       Fixed runs in project description file
  -as ASSEMBLIES [ASSEMBLIES ...], --assemblies ASSEMBLIES [ASSEMBLIES ...]
                        Assembly ERZ accession(s), whitespace separated. Use to download only certain project assemblies
  --assembly-type {primary metagenome,binned metagenome,metatranscriptome}
                        Assembly type
  --assembly-list ASSEMBLY_LIST
                        File containing line-separated assembly accessions

Example

Download assembly study:

$ fetch-assembly-tool -p ERP111288 -v -d /home/<user>/temp/

How to set up your development environment

We recommend you to use miniconda|conda to manage the environment.

Clone the repo and install the requirements.

$ git clone git@github.com:EBI-Metagenomics/fetch_tool.git
$ cd fetch_tool
$ # activate anv (conda activate xxx)
$ pip install .[dev]

Pre-commit hooks

Setup the git pre-commit hook:

pre-commit install

Why?

pre-commit will run a set of pre-configured tools before allowing you to commit files. You can find the currently configure hooks and configurations in .pre-commit-config.yaml

Tests

This repo uses pytest.

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

fetch_tool-1.0.3.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

fetch_tool-1.0.3-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file fetch_tool-1.0.3.tar.gz.

File metadata

  • Download URL: fetch_tool-1.0.3.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for fetch_tool-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6627d6138069cb2e4ab49db0c00400b0ae162d2d7dace4cfb90a29fb13eae220
MD5 b0e3a98630f975d0c0dfad86b1e19437
BLAKE2b-256 c25afff4758be5b66ee5fcaaee8b57f73daeaf57efe186cf2ae637c40b9e30ed

See more details on using hashes here.

File details

Details for the file fetch_tool-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: fetch_tool-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for fetch_tool-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2f4f96b9da034e1f81ce19e12668e0895221bfcf051a9d168b816e3d077cadaf
MD5 bce46a4da9bffa98023dff2bf650bc8f
BLAKE2b-256 8de7b638a81b1c6757db271f7a8b028f811a26d8bc6cf91d5054d1133ebc93b0

See more details on using hashes here.

Supported by

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