Skip to main content

A script for batch-downloading and automatic compression of data from NCBI Sequence Read Archive. Built on SRA-Toolkit.

Project description

sra-downloader

A script for batch-downloading and automatic compression of data from NCBI Sequence Read Archive. Built on SRA-Toolkit.

Features:

  • Downloading SRAs using either accession IDs or NCBI generated files
  • Organizing sequences by projects that they come from
  • Detecting which runs have been already downloaded

Requirements

  • python >= 3.6
  • sra-toolkit >= 2.9.6
  • pigz

Instalation

1. From PyPi

  1. Run pip install sra-downloader

2. From sources

  1. Download a repo into a folder
  2. Run pip install .

Usage

usage: sra-downloader [-h] [--fname FILENAME] [--save-dir SAVE_DIRECTORY] [--uncompressed [UNCOMPRESSED]] [sra_id [sra_id ...]]

Download SRA data

positional arguments:
  sra_id                SRA IDs to download

optional arguments:
  -h, --help            show this help message and exit
  --fname FILENAME      CSV file with list of SRAs to download. Header must include `Run` and `BioProject`.
  --save-dir SAVE_DIRECTORY
                        a directory that the files will be saved to. (default: ./downloaded)
  --uncompressed [UNCOMPRESSED]
                        if present, the files will not be compressed. (default: False)

Examples

sra-downloader ERR2177760 --uncompressed
sra-downloader --fname SraRunTable.txt --save-dir ./SRAs

Sample output

└─── save_folder
    ├── PRJEB14961
    │   ├── ERR1551967.sra_1.fastq.gz  # - raw read archived files from SRA
    │   ├── ERR1551967.sra_2.fastq.gz 
    │   └── SraRunTable.txt            # - original SraRunTable.txt with useful metadata about samples  
    └── PRJEB20463
        ├── ERR2177760.sra_1.fastq.gz
        ├── ERR2177760.sra_2.fastq.gz 
        ├── absent.txt                 # - entries that were unaccessible due to various reasons
        └── SraRunTable.txt

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

sra-downloader-1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distributions

sra_downloader-1.0-py3.8.egg (9.7 kB view hashes)

Uploaded Source

sra_downloader-1.0-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

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