Skip to content

Commit

Permalink
Refactor workflow outputs
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
  • Loading branch information
bentsherman committed Nov 3, 2024
1 parent aef604b commit f1f763c
Show file tree
Hide file tree
Showing 11 changed files with 123 additions and 498 deletions.
13 changes: 0 additions & 13 deletions bin/multiqc_mappings_config.py

This file was deleted.

71 changes: 38 additions & 33 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,9 @@ nextflow.preview.types = true
include { SRA } from './workflows/sra'
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_fetchngs_pipeline'
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_fetchngs_pipeline'
include { SOFTWARE_VERSIONS } from './subworkflows/nf-core/utils_nfcore_pipeline'
include { SraParams } from './workflows/sra'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NAMED WORKFLOWS FOR PIPELINE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

//
// WORKFLOW: Run main nf-core/fetchngs analysis pipeline depending on type of identifier provided
//
workflow NFCORE_FETCHNGS {

take:
ids : Channel<String>
params : SraParams

main:

//
// WORKFLOW: Download FastQ files for SRA / ENA / GEO / DDBJ ids
//
SRA (
ids,
params
)

}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RUN MAIN WORKFLOW
Expand All @@ -57,6 +31,7 @@ workflow NFCORE_FETCHNGS {

workflow {

main:
//
// SUBWORKFLOW: Run initialisation tasks
//
Expand All @@ -74,13 +49,10 @@ workflow {
//
// WORKFLOW: Run primary workflows for the pipeline
//
NFCORE_FETCHNGS (
let samples = SRA (
ids,
SraParams(
params.ena_metadata_fields ?: '',
params.sample_mapping_fields,
params.nf_core_pipeline ?: '',
params.nf_core_rnaseq_strandedness ?: 'auto',
params.download_method,
params.skip_fastq_download,
params.dbgap_key,
Expand All @@ -91,6 +63,11 @@ workflow {
)
)

//
// SUBWORKFLOW: Collect software versions
//
let versions = SOFTWARE_VERSIONS()

//
// SUBWORKFLOW: Run completion tasks
//
Expand All @@ -102,11 +79,39 @@ workflow {
params.monochrome_logs,
params.hook_url
)

publish:
samples >> 'samples'
versions >> 'versions'
}

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WORKFLOW OUTPUTS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

output {
directory params.outdir
mode params.publish_dir_mode
samples {
path { _sample ->
let dirs = [
'fastq': 'fastq',
'md5': 'fastq/md5'
]
return { file -> "${dirs[file.ext]}/${file.baseName}" }
}
index {
path 'samplesheet/samplesheet.json'
sort { sample -> sample.id }
}
}

versions {
path '.'
index {
path 'nf_core_fetchngs_software_mqc_versions.yml'
}
}
}

/*
Expand Down
24 changes: 0 additions & 24 deletions modules/local/multiqc_mappings_config/main.nf

This file was deleted.

24 changes: 0 additions & 24 deletions modules/local/multiqc_mappings_config/tests/main.nf.test

This file was deleted.

31 changes: 0 additions & 31 deletions modules/local/multiqc_mappings_config/tests/main.nf.test.snap

This file was deleted.

79 changes: 0 additions & 79 deletions modules/local/sra_to_samplesheet/main.nf

This file was deleted.

27 changes: 0 additions & 27 deletions modules/local/sra_to_samplesheet/tests/main.nf.test

This file was deleted.

Loading

0 comments on commit f1f763c

Please sign in to comment.