diff --git a/CHANGELOG.md b/CHANGELOG.md index f9ce0000..709dda22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ 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 | 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 //