Merge pull request #1648 from nf-core/refactor-sra-fastq

refactor: rename and update subworkflow
This commit is contained in:
Harshil Patel 2022-05-12 11:26:15 +01:00 committed by GitHub
commit be0f022053
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 106 additions and 86 deletions

View file

@ -1,34 +0,0 @@
//
// Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA).
//
params.prefetch_options = [:]
params.fasterqdump_options = [:]
include { SRATOOLS_PREFETCH } from '../../../modules/sratools/prefetch/main' addParams( options: params.prefetch_options )
include { SRATOOLS_FASTERQDUMP } from '../../../modules/sratools/fasterqdump/main' addParams( options: params.fasterqdump_options )
workflow SRA_FASTQ {
take:
sra_ids // channel: [ val(meta), val(id) ]
main:
ch_versions = Channel.empty()
//
// Prefetch sequencing reads in SRA format.
//
SRATOOLS_PREFETCH ( sra_ids )
ch_versions = ch_versions.mix( SRATOOLS_PREFETCH.out.versions.first() )
//
// Convert the SRA format into one or more compressed FASTQ files.
//
SRATOOLS_FASTERQDUMP ( SRATOOLS_PREFETCH.out.sra )
ch_versions = ch_versions.mix( SRATOOLS_FASTERQDUMP.out.versions.first() )
emit:
reads = SRATOOLS_FASTERQDUMP.out.reads // channel: [ val(meta), [ reads ] ]
versions = ch_versions // channel: [ versions.yml ]
}

View file

@ -0,0 +1,38 @@
include { CUSTOM_SRATOOLSNCBISETTINGS } from '../../../modules/custom/sratoolsncbisettings/main'
include { SRATOOLS_PREFETCH } from '../../../modules/sratools/prefetch/main'
include { SRATOOLS_FASTERQDUMP } from '../../../modules/sratools/fasterqdump/main'
/**
* Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA).
*/
workflow SRAFASTQ {
take:
sra_ids // channel: [ val(meta), val(id) ]
main:
ch_versions = Channel.empty()
//
// Detect existing NCBI user settings or create new ones.
//
CUSTOM_SRATOOLSNCBISETTINGS()
def settings = CUSTOM_SRATOOLSNCBISETTINGS.out.ncbi_settings
ch_versions = ch_versions.mix( CUSTOM_SRATOOLSNCBISETTINGS.out.versions )
//
// Prefetch sequencing reads in SRA format.
//
SRATOOLS_PREFETCH ( sra_ids, settings )
ch_versions = ch_versions.mix( SRATOOLS_PREFETCH.out.versions.first() )
//
// Convert the SRA format into one or more compressed FASTQ files.
//
SRATOOLS_FASTERQDUMP ( SRATOOLS_PREFETCH.out.sra, settings )
ch_versions = ch_versions.mix( SRATOOLS_FASTERQDUMP.out.versions.first() )
emit:
reads = SRATOOLS_FASTERQDUMP.out.reads // channel: [ val(meta), [ reads ] ]
versions = ch_versions // channel: [ versions.yml ]
}

View file

@ -1,11 +1,14 @@
name: sra_fastq
description: Download FASTQ sequencing reads from the NCBI's Sequence Read Archive (SRA).
keywords:
- SRA
- NCBI
- sequencing
- FASTQ
- prefetch
- dump
- fasterq-dump
modules:
- custom/sratoolsncbisettings
- sratools/prefetch
- sratools/fasterqdump
input:
@ -17,7 +20,7 @@ input:
- id:
type: string
description: >
SRA identifier.
SRA run identifier.
# TODO Update when we decide on a standard for subworkflow docs
output:
- meta:

View file

@ -1,23 +0,0 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SRA_FASTQ } from '../../../../subworkflows/nf-core/sra_fastq/main.nf' addParams( [:] )
workflow test_sra_fastq_single_end {
input = [
[ id:'test_single_end', single_end:true ], // meta map
'SRR13255544'
]
SRA_FASTQ ( input )
}
workflow test_sra_fastq_paired_end {
input = [
[ id:'test_paired_end', single_end:false ], // meta map
'SRR11140744'
]
SRA_FASTQ ( input )
}

View file

@ -1,27 +0,0 @@
- name: sra fastq single-end
command: nextflow run ./tests/subworkflows/nf-core/sra_fastq -entry test_sra_fastq_single_end -c tests/config/nextflow.config
tags:
- subworkflows
# - subworkflows/sra_fastq
# Modules
# - sratools
# - sratools/prefetch
# - sratools/fasterqdump
files:
- path: output/sratools/SRR13255544.fastq.gz
md5sum: 1054c7b71884acdb5eed8a378f18be82
- name: sra fastq paired-end
command: nextflow run ./tests/subworkflows/nf-core/sra_fastq -entry test_sra_fastq_paired_end -c tests/config/nextflow.config
tags:
- subworkflows
# - subworkflows/sra_fastq
# Modules
# - sratools
# - sratools/prefetch
# - sratools/fasterqdump
files:
- path: output/sratools/SRR11140744_1.fastq.gz
md5sum: 193809c784a4ea132ab2a253fa4f55b6
- path: output/sratools/SRR11140744_2.fastq.gz
md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e

View file

@ -0,0 +1,29 @@
#!/usr/bin/env nextflow
nextflow.enable.dsl = 2
include { SRAFASTQ } from '../../../../subworkflows/nf-core/srafastq/main.nf'
workflow test_srafastq_single_end {
input = Channel.of(
[
[ id:'test_single_end1', single_end:true ], // meta map
'DRR000774'
],
[
[ id:'test_single_end2', single_end:true ], // meta map
'DRR000775'
]
)
SRAFASTQ ( input )
}
workflow test_srafastq_paired_end {
input = [
[ id:'test_paired_end', single_end:false ], // meta map
'SRR11140744'
]
SRAFASTQ ( input )
}

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

@ -0,0 +1,29 @@
- name: srafastq single-end
command: nextflow run ./tests/subworkflows/nf-core/srafastq -entry test_srafastq_single_end -c tests/config/nextflow.config -c tests/subworkflows/nf-core/srafastq/nextflow.config
tags:
- subworkflows
# - subworkflows/srafastq
# Modules
# - sratools
# - sratools/prefetch
# - sratools/fasterqdump
files:
- path: output/sratools/DRR000774.fastq.gz
md5sum: 19029a1132115b55277a0d79ee089b49
- path: output/sratools/DRR000775.fastq.gz
md5sum: 59ff24c86ecb260752668c059c2a1eaf
- name: srafastq paired-end
command: nextflow run ./tests/subworkflows/nf-core/srafastq -entry test_srafastq_paired_end -c tests/config/nextflow.config -c tests/subworkflows/nf-core/srafastq/nextflow.config
tags:
- subworkflows
# - subworkflows/srafastq
# Modules
# - sratools
# - sratools/prefetch
# - sratools/fasterqdump
files:
- path: output/sratools/SRR11140744_1.fastq.gz
md5sum: 193809c784a4ea132ab2a253fa4f55b6
- path: output/sratools/SRR11140744_2.fastq.gz
md5sum: 3e3b3af3413f50a1685fd7b3f1456d4e