Package: fastq-dl
fastq-dlDownload FASTQ files from theEuropean Nucleotide Archiveor theSequence Read Archiverepositories.Introductionfastq-dltakes an ENA/SRA accession (Study, Sample, Experiment, or Run) and queries ENA (viaData Warehouse API) to determine the associated
metadata. It then downloads FASTQ files for each Run. For Samples or Experiments with multiple
Runs, users can optionally merge the runs.InstallationBiocondafastq-dlis available fromBiocondaand I highly recommend you
go this route to for installation.conda create -n fastq-dl -c conda-forge -c bioconda fastq-dl
conda activate fastq-dlUsagefastq-dl --help

 Usage: fastq-dl [OPTIONS]                                                                        
                                                                                                  
 Download FASTQ files from ENA or SRA.                                                            
                                                                                                  
╭─ Required Options ─────────────────────────────────────────────────────────────────────────────╮
│ *  --accession  -a  TEXT  ENA/SRA accession to query. (Study, Sample, Experiment, Run          │
│                           accession)                                                           │
│                           [required]                                                           │
╰────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Additional Options ───────────────────────────────────────────────────────────────────────────╮
│ --provider                    [ena|sra]  Specify which provider (ENA or SRA) to use.           │
│                                          [default: ena]                                        │
│ --group-by-experiment                    Group Runs by experiment accession.                   │
│ --group-by-sample                        Group Runs by sample accession.                       │
│ --outdir                  -o  TEXT       Directory to output downloads to. [default: ./]       │
│ --prefix                      TEXT       Prefix to use for naming log files. [default: fastq]  │
│ --cpus                        INTEGER    Total cpus used for downloading from SRA.             │
│                                          [default: 1]                                          │
│ --max-attempts            -m  INTEGER    Maximum number of download attempts. [default: 10]    │
│ --force                                  Overwrite existing files if their MD5 checksums do    │
│                                          not match.                                            │
│ --sra-lite                               Set preference to SRA Lite                            │
│ --only-provider                          Only attempt download from specified provider.        │
│ --only-download-metadata                 Skip FASTQ downloads, and retrieve only the metadata. │
│ --silent                                 Only critical errors will be printed.                 │
│ --sleep                   -s  INTEGER    Minimum amount of time to sleep between retries (API  │
│                                          query and download)                                   │
│                                          [default: 10]                                         │
│ --version                 -V             Show the version and exit.                            │
│ --verbose                 -v             Print debug related text.                             │
│ --help                    -h             Show this message and exit.                           │
╰────────────────────────────────────────────────────────────────────────────────────────────────╯fastq-dlrequires a single ENA/SRA Study, Sample, Experiment, or Run accession and FASTQs
for all Runs that fall under the given accession will be downloaded. For example, if a Study
accession is given all Runs under that studies umbrella will be downloaded. By default,fastq-dlwill try to download from ENA first, then SRA.--accessionThe accession you would like to download associated FASTQS for. Currently the following types
of accessions are accepted.Accession TypePrefixesExampleBioProjectPRJEB, PRJNA, PRJDBPRJEB42779, PRJNA480016, PRJDB14838StudyERP, DRP, SRPERP126685, DRP009283, SRP158268BioSampleSAMD, SAME, SAMNSAMD00258402, SAMEA7997453, SAMN06479985SampleERS, DRS, SRSERS5684710, DRS259711, SRS2024210ExperimentERX, DRX, SRXERX5050800, DRX406443, SRX4563689RunERR, DRR, SRRERR5260405, DRR421224, SRR7706354The accessions are using regular expressions from theENA Training Modules - Accession Numberssection.--providerfastq-dlgives you the option to download from ENA or SRA. the--provideroption will
specify which provider you would like to attempt downloads from first. If a download fails
from the first provider, additional attempts will be made using the other provider.ENA was selected as the default provider because the FASTQs are available directly without
the need for conversion.--only-providerBy default,fastq-dlwill fallback on a secondary provider to attempt downloads. There
may be cases where you would prefer to disable this feature, and that is exactly the
purpose of--only-provider. When provided, if a FASTQ cannot be downloaded from the
original provider, no additional attempts will be made.--group-by-experiment & --group-by-sampleThere maybe times you might want to group Run accessions based on a Experiment or Sample
accessions. This will merge FASTQs associated with a Run accession based its associated
Experiment accession (--group-by-experiment) or Sample accession (--group-by-sample).--sra-liteDownloads from SRA are provided inSRA Normalized and SRA Liteformats.
SRA Normalized is the original format with full base quality scores and SRA Lite are smaller
due to simplifying the quality scores to a uniform Q30. By default the preference will be
set to SRA Normalized, if you prefer SRA Lite you can use--sra-liteto set the
preference to SRA Lite.Output FilesExtensionDescription-run-info.tsvTab-delimited file containing metadata for each Run downloaded-run-mergers.tsvTab-delimited file merge information from--group-by-experimentor--group-by-sample.fastq.gzFASTQ files downloaded from ENA or SRAExample UsageDownload FASTQs associated with a StudySometimes you might be reading a paper and they very kindly provided a Bioproject of all
the samples they sequenced. So, you decide you want to download FASTQs for all the samples
asscociated with the Bioproject.fastq-dlcan help you with that!fastq-dl --accession PRJNA248678 --provider SRA
fastq-dl --accession PRJNA248678The above commands will download the 3 Runs that fall under Study accessionPRJNA248678from either SRA (--provider SRA) or ENA (without--provider).Download FASTQs associated with an ExperimentLet's say instead of the whole Bioproject you just want a single Experiment. You can do
that as well.fastq-dl --accession SRX477044The above command would download the Run accessions from ENA that fall under Experiment SRX477044.The relationship of Experiment to Run is a 1-to-many relationship, or there can be many Run accessions
associated with a single Experiment Accession (e.g. re-sequencing the same sample). Although in most
cases, it is a 1-to-1 relationship, you can use--group-by-experimentto merge multiple runs
associated with an Experiment accession into a single FASTQ file.Download FASTQs associated with an SampleOk, this time you just want a single Sample, or Biosample.fastq-dl --accession SRS1904245 --provider SRAThe above command would download the Run accessions from SRA that fall under Sample SRS1904245.Similar to Experiment accessions, the relationship of Sample to Run is a 1-to-many relationship,
or there can be many Run accessions associated with a single Sample Accession. Although in most
cases, it is a 1-to-1 relationship, you can use--group-by-sampleto merge multiple runs
associated with an Sample accession into a single FASTQ file._Warning! For some type strains (e.g. S. aureus USA300) a Biosample accession might be associated with
100s or 1000s of Run accessions. These Runs are likely associated with many different conditions and
really should not fall under a single BioSample accession. Please consider this when using--group-by-sample.Download FASTQs associated with a RunLet's keep it super simple and just download a Run.fastq-dl --accession SRR1178105 --provider SRAThe above command would download the Run SRR1178105 from SRA. Run accessions are the end of the
line (1-to-1 relationship), so you will always get the expected Run.Alternativesfastq-dl, is a spin-off ofena-dl, that has been developed for
usage withBactopia. With this in mind, EBI/NCBI and provide
their own tools (enaBrowserToolsandSRA Toolkit) that offer more extensive access to their databases.