Skip to content

Commit 50bd6f6

Browse files
authored
Merge pull request #434 from JoseEspinosa/fixes
Prevent pipeline fails from erroneous param validation when igenomes is used
2 parents 43369af + 4addb4b commit 50bd6f6

File tree

3 files changed

+25
-38
lines changed

3 files changed

+25
-38
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
### Enhancements & fixes
99

10+
[[PR #434](https://github.com/nf-core/chipseq/pull/434)] - Prevent pipeline fails from erroneous param validation when igenomes is used.
11+
1012
### Parameters
1113

1214
| Old parameter | New parameter |

main.nf

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@
99
----------------------------------------------------------------------------------------
1010
*/
1111

12-
/*
13-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14-
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
15-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16-
*/
17-
include { CHIPSEQ } from './workflows/chipseq'
18-
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
19-
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_chipseq_pipeline'
20-
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_chipseq_pipeline'
21-
include { getGenomeAttribute } from './subworkflows/local/utils_nfcore_chipseq_pipeline'
22-
2312
/*
2413
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2514
GENOME PARAMETER VALUES
@@ -37,6 +26,17 @@ params.gene_bed = getGenomeAttribute('gene_bed')
3726
params.blacklist = getGenomeAttribute('blacklist')
3827
params.macs_gsize = getMacsGsize(params)
3928

29+
/*
30+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31+
IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
32+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33+
*/
34+
35+
include { CHIPSEQ } from './workflows/chipseq'
36+
include { PREPARE_GENOME } from './subworkflows/local/prepare_genome'
37+
include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_chipseq_pipeline'
38+
include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_chipseq_pipeline'
39+
4040
/*
4141
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4242
NAMED WORKFLOWS FOR PIPELINE
@@ -138,6 +138,18 @@ workflow {
138138
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139139
*/
140140

141+
//
142+
// Get attribute from genome config file e.g. fasta
143+
//
144+
def getGenomeAttribute(attribute) {
145+
if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) {
146+
if (params.genomes[params.genome].containsKey(attribute)) {
147+
return params.genomes[params.genome][attribute]
148+
}
149+
}
150+
return null
151+
}
152+
141153
//
142154
// Get macs genome size (macs_gsize)
143155
//

subworkflows/local/utils_nfcore_chipseq_pipeline/main.nf

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -158,33 +158,6 @@ def validateInputParameters() {
158158
}
159159
}
160160

161-
//
162-
// Validate channels from input samplesheet
163-
//
164-
def validateInputSamplesheet(input) {
165-
def (metas, fastqs) = input[1..2]
166-
167-
// Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end
168-
def endedness_ok = metas.collect { meta -> meta.single_end }.unique().size == 1
169-
if (!endedness_ok) {
170-
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}")
171-
}
172-
173-
return [metas[0], fastqs]
174-
}
175-
176-
//
177-
// Get attribute from genome config file e.g. fasta
178-
//
179-
def getGenomeAttribute(attribute) {
180-
if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) {
181-
if (params.genomes[params.genome].containsKey(attribute)) {
182-
return params.genomes[params.genome][attribute]
183-
}
184-
}
185-
return null
186-
}
187-
188161
//
189162
// Exit pipeline if incorrect --genome key provided
190163
//

0 commit comments

Comments
 (0)