Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent pipeline fails from erroneous param validation when igenomes is used #433

Closed
wants to merge 12 commits into from
Closed
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Enhancements & fixes

[[PR #433](https://github.com/nf-core/chipseq/pull/415)] - Prevent pipeline fails from erroneous param validation of fasta.

### Parameters

| Old parameter | New parameter |
Expand Down
33 changes: 22 additions & 11 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,6 +26,16 @@ 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
Expand Down Expand Up @@ -138,6 +137,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)
//
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ params {
skip_spp = false
skip_igv = false
skip_multiqc = false
skip_peak_calling = false

// Options: Config
bamtools_filter_pe_config = "$projectDir/assets/bamtools_filter_pe.json"
Expand Down
10 changes: 10 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,16 @@
"description": "Skip MultiQC.",
"fa_icon": "fas fa-fast-forward"
},
"skip_peak_calling": {
"type": "boolean",
"description": "Skip MACS2 peak calling.",
"fa_icon": "fas fa-fast-forward"
},
"skip_reporting": {
"type": "boolean",
"description": "Skip reporting.",
"fa_icon": "fas fa-fast-forward"
},
"skip_qc": {
"type": "boolean",
"fa_icon": "fas fa-fast-forward",
Expand Down
27 changes: 0 additions & 27 deletions subworkflows/local/utils_nfcore_chipseq_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
Loading