From 037581b2cb63a751cf10c255b1d09b4a7d0071e3 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 20 Nov 2024 16:58:04 +0100 Subject: [PATCH 1/3] Fix params validation --- main.nf | 34 +++++++++++++------ .../utils_nfcore_chipseq_pipeline/main.nf | 27 --------------- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/main.nf b/main.nf index bee79135..26bdbbc4 100755 --- a/main.nf +++ b/main.nf @@ -9,17 +9,6 @@ ---------------------------------------------------------------------------------------- */ -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ -include { CHIPSEQ } from './workflows/chipseq' -include { PREPARE_GENOME } from './subworkflows/local/prepare_genome' -include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_chipseq_pipeline' -include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_chipseq_pipeline' -include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_chipseq_pipeline' - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GENOME PARAMETER VALUES @@ -37,6 +26,17 @@ params.gene_bed = getGenomeAttribute('gene_bed') params.blacklist = getGenomeAttribute('blacklist') params.macs_gsize = getMacsGsize(params) +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +include { CHIPSEQ } from './workflows/chipseq' +include { PREPARE_GENOME } from './subworkflows/local/prepare_genome' +include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_chipseq_pipeline' +include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_chipseq_pipeline' + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NAMED WORKFLOWS FOR PIPELINE @@ -138,6 +138,18 @@ workflow { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +// +// Get attribute from genome config file e.g. fasta +// +def getGenomeAttribute(attribute) { + if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { + if (params.genomes[params.genome].containsKey(attribute)) { + return params.genomes[params.genome][attribute] + } + } + return null +} + // // Get macs genome size (macs_gsize) // diff --git a/subworkflows/local/utils_nfcore_chipseq_pipeline/main.nf b/subworkflows/local/utils_nfcore_chipseq_pipeline/main.nf index 4255b5e8..305d7c22 100644 --- a/subworkflows/local/utils_nfcore_chipseq_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_chipseq_pipeline/main.nf @@ -158,33 +158,6 @@ def validateInputParameters() { } } -// -// Validate channels from input samplesheet -// -def validateInputSamplesheet(input) { - def (metas, fastqs) = input[1..2] - - // Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end - def endedness_ok = metas.collect { meta -> meta.single_end }.unique().size == 1 - if (!endedness_ok) { - error("Please check input samplesheet -> Multiple runs of a sample must be of the same datatype i.e. single-end or paired-end: ${metas[0].id}") - } - - return [metas[0], fastqs] -} - -// -// Get attribute from genome config file e.g. fasta -// -def getGenomeAttribute(attribute) { - if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) { - if (params.genomes[params.genome].containsKey(attribute)) { - return params.genomes[params.genome][attribute] - } - } - return null -} - // // Exit pipeline if incorrect --genome key provided // From 32697932e62684932818187001e0f090f0a82048 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 20 Nov 2024 16:58:14 +0100 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9ce0000..8039ef04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhancements & fixes +[[PR #434](https://github.com/nf-core/chipseq/pull/434)] - Prevent pipeline fails from erroneous param validation when igenomes is used. + + ### Parameters | Old parameter | New parameter | From 4addb4baf941f0d30ebc9fa3cd2d54fe0a7288a5 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Wed, 20 Nov 2024 16:03:35 +0000 Subject: [PATCH 3/3] Make lint happy --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8039ef04..709dda22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [[PR #434](https://github.com/nf-core/chipseq/pull/434)] - Prevent pipeline fails from erroneous param validation when igenomes is used. - ### Parameters | Old parameter | New parameter |