nf-core/fetchngs
repository·master·Indexed 42 days ago
https://github.com/nf-core/fetchngsA bioinformatics pipeline used to automate the retrieval of metadata and raw FastQ sequencing data from public repositories including SRA, ENA, DDBJ, and GEO. It resolves identifiers to experiment-level IDs, fetches metadata via the ENA API, and supports multiple download methods including FTP, Aspera, and sra-tools. The pipeline produces collated samplesheets compatible with various nf-core pipelines such as rnaseq, sarek, and mag.
What's inside nf-core/fetchngs
- nf-core/fetchngs is a bioinformatics pipeline designed to fetch metadata and raw FastQ files from public databases. It currently supports SRA, ENA, DDBJ, and GEO identifiers. The pipeline resolves these IDs to experiment-level IDs, fetches metadata via the ENA API, downloads FastQ files using various methods, and produces a collated samplesheet containing metadata and file paths.
Understand nf-core/fetchngs output structure
masterThe
nf-core/fetchngspipeline generates several directories within your specified results directory. The output is categorized into downloaded sequencing data, metadata, and pipeline execution reports.Sequencing Data and Metadata
fastq/: Contains the downloaded*.fastq.gzfiles (paired-end or single-end).fastq/md5/: Contains*.md5checksum files for files downloaded from the ENA.samplesheet/: Contains files for downstream pipeline integration:samplesheet.csv: An auto-created samplesheet containing metadata and paths to the FastQ files.id_mappings.csv: A mapping file used to rename samples using specific metadata fields.multiqc_config.yml: A configuration file for MultiQC to facilitate bulk renaming of sample names from database IDs.
metadata/: Contains ENA metadata files (*.runinfo_ftp.tsvand*.runinfo.tsv).
Pipeline Execution Information
pipeline_info/: Contains execution and software reports:- Nextflow Reports:
execution_report.html,execution_timeline.html,execution_trace.txt, andpipeline_dag.dot/pipeline_dag.svg. - Pipeline Reports:
pipeline_report.html,pipeline_report.txt, andsoftware_versions.yml. Note:pipeline_report*files are only generated if the--emailor--email_on_failparameters are used. - Configuration:
params.jsoncontains the parameters used during the run.
- Nextflow Reports:
Supported identifier types for nf-core/fetchngs
masterThe pipeline automatically downloads and processes raw FastQ files from public repositories using various identifier types. You can provide these identifiers in a file (one per line) via the
--inputparameter. Supported identifier types include:- SRA:
SRR,SRX,SRS,SAMN,SRP,SRA,PRJNA - ENA:
ERR,ERX,ERS,SAMEA,ERP,ERA,PRJEB - DDBJ:
DRR,DRX,DRS,SAMD,DRP,DRA,PRJDB - GEO:
GSM,GSE
Note: If
SRR/ERR/DRRrun IDs are provided, the pipeline resolves them to their correspondingSRX/ERX/DRXexperiment IDs to allow merging multiple runs from the same experiment (similar to merging multiple libraries from the same sample).- SRA:
Handle samples with more than 2 FastQ files
masterThe ENA API may only list primary FastQ files, but some samples (e.g., 10x or UMI-based preps) contain additional technical FastQ files that can only be retrieved via
sra-tools.If you anticipate that a sample has more than 2 FastQ files, you must use the
sratoolsdownload method to ensure all files (including technical reads) are captured.--download_method sratoolsUse GitHub Codespaces for development
masterYou can contribute tonf-core/fetchngswithout a local environment by using GitHub Codespaces. The repository includes adevcontainerconfiguration that provides a browser-based VS Code environment with Nextflow,nf-core/tools, and other utilities pre-installed via Docker.Use samplesheet and MultiQC outputs for sample renaming
masterWhen running
nf-core/fetchngs, the pipeline produces asamplesheet/directory designed to help you manage sample identities in downstream workflows.To customize how samples are named from their database IDs, use the
--sample_mapping_fieldsparameter. This affects the generation of:id_mappings.csv: Used to map database IDs to more informative names.multiqc_config.yml: A config file you can pass to other nf-core pipelines using the--multiqc_configparameter to perform bulk renaming in MultiQC reports.
Example workflow:
- Run
fetchngswith--sample_mapping_fieldsto define your preferred naming metadata. - Use the resulting
multiqc_config.ymlin your next nf-core pipeline to ensure consistent sample naming in reports.
Update the Nextflow minimum required version
masterIf your changes require a new feature from core Nextflow, use the
nf-core pipelines bump-versioncommand to update the minimum required version.nf-core pipelines bump-version --nextflow . <min_nf_version>Contribution quick start for nf-core/fetchngs
masterTo contribute code to nf-core/fetchngs, follow these steps:
- Prerequisites: Ensure
Nextflow,nf-core tools, andnf-testare installed. - Issue Tracking: Check for an existing GitHub issue regarding your change. If none exists, create one.
- Fork & Branch: Fork the
nf-core/fetchngsrepository and create a new branch for your changes. - Development: Follow pipeline conventions for code and logic.
- Documentation: Update files in
docs/, updatenextflow_schema.jsonusingnf-core/tools, and updateCITATIONS.md. - Testing: Run and/or update tests using
nf-test. - Linting: Use
nf-core/toolsto lint your code. - Pull Request: Submit a PR against the
devbranch.
- Prerequisites: Ensure
How to add a new pipeline step
masterWhen adding a new step to the pipeline, follow these requirements:
- Channels: Define the input channel from the previous process using the naming scheme
ch_output_from_<process>. Define intermediate/terminal channels usingch_<previousprocess>_for_<nextprocess>. - Modules: Install a module via
nf-core/toolsor write a local module. Specify resource requirements (CPUs, memory, time) inconf/base.configusing standardwithLabel:selectors. - Outputs: Define output channels. Mix version outputs into
ch_versionsand relevant files intoch_multiqc. - Parameters: Add new parameters to
nextflow.configwith default values. Usenf-core pipelines schema buildto updatenextflow_schema.json. - Validation: Add parameter validation to the
utils_nfcore_pipeline/main.nfsubworkflow. - Documentation: Update
usage.md,output.md, andcitation.md. - Testing & Linting: Perform local tests, add new tests in
tests/, and run linting.
- Channels: Define the input channel from the previous process using the naming scheme
Ensure reproducibility with specific pipeline versions
masterTo guarantee that the exact same code and software versions are used for future runs, specify a specific pipeline version using the
-rflag. You can find available versions on the nf-core/fetchngs releases page.Example using version 1.3.1:
nextflow run nf-core/fetchngs -r 1.3.1 --input ./ids.csv --outdir ./results -profile dockernextflow run nf-core/fetchngs -r 1.3.1 --input ./ids.csv --outdir ./results -profile dockerAdd a new pipeline to fetchngs
masterTo add support for a new pipeline in
fetchngs, complete these three steps:- Update Extras: Add an entry to
pipeline_extrasinsubworkflows/local/channel_sra_create_csv/main.nf. Map the pipeline name to its extra samplesheet columns (e.g.,[strandedness: strandedness]). - Add Tests: Create a new test file in
workflows/tests/namedsra_nf_core_pipeline_<pipeline>.nf.test. Setinput[5]to the pipeline name and include appropriate tags. - Update Schema: If the new pipeline introduces new parameters, run the schema builder:
nf-core pipelines schema build
nf-core pipelines schema build- Update Extras: Add an entry to
Use a parameters file for pipeline settings
masterTo avoid long CLI commands and ensure reproducibility, you can specify pipeline parameters in a
yamlorjsonfile using the-params-fileflag.Warning: Do not use
-c <file>to specify pipeline parameters; this will cause errors. The-cflag is reserved for Nextflow configuration files used for tuning resource specifications or module arguments.Example usage with a YAML file:
nextflow run nf-core/fetchngs -profile docker -params-file params.yamlExample
params.yamlcontent:input: './ids.csv' outdir: './results/'nextflow run nf-core/fetchngs -profile docker -params-file params.yaml