Skip to content

Commit

Permalink
Fixes #201
Browse files Browse the repository at this point in the history
  • Loading branch information
drpatelh committed Jun 10, 2021
1 parent 5929e12 commit f889766
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
5 changes: 3 additions & 2 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,21 @@ WorkflowMain.initialise(workflow, params, log)
========================================================================================
*/

include { ILLUMINA } from './workflows/illumina'
include { NANOPORE } from './workflows/nanopore'

workflow NFCORE_VIRALRECON {

//
// WORKFLOW: Variant and de novo assembly analysis for Illumina data
//
if (params.platform == 'illumina') {
include { ILLUMINA } from './workflows/illumina'
ILLUMINA ()

//
// WORKFLOW: Variant analysis for Nanopore data
//
} else if (params.platform == 'nanopore') {
include { NANOPORE } from './workflows/nanopore'
NANOPORE ()
}
}
Expand Down
12 changes: 8 additions & 4 deletions workflows/illumina.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def valid_params = [
def summary_params = NfcoreSchema.paramsSummaryMap(workflow, params)

// Validate input parameters
WorkflowIllumina.initialise(params, log, valid_params)
if (params.platform == 'illumina') {
WorkflowIllumina.initialise(params, log, valid_params)
}

// Check input path parameters to see if they exist
def checkPathParamList = [
Expand Down Expand Up @@ -691,9 +693,11 @@ workflow ILLUMINA {
========================================================================================
*/

workflow.onComplete {
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report, fail_mapped_reads)
NfcoreTemplate.summary(workflow, params, log, fail_mapped_reads, pass_mapped_reads)
if (params.platform == 'illumina') {
workflow.onComplete {
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report, fail_mapped_reads)
NfcoreTemplate.summary(workflow, params, log, fail_mapped_reads, pass_mapped_reads)
}
}

/*
Expand Down
25 changes: 12 additions & 13 deletions workflows/nanopore.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def valid_params = [
def summary_params = NfcoreSchema.paramsSummaryMap(workflow, params)

// Validate input parameters
WorkflowNanopore.initialise(params, log, valid_params)
if (params.platform == 'nanopore') {
WorkflowNanopore.initialise(params, log, valid_params)
}

def checkPathParamList = [
params.input, params.fastq_dir, params.fast5_dir,
Expand All @@ -23,6 +25,10 @@ for (param in checkPathParamList) { if (param) { file(param, checkIfExists: true
// Stage dummy file to be used as an optional input where required
ch_dummy_file = file("$projectDir/assets/dummy_file.txt", checkIfExists: true)

// MultiQC config files
ch_multiqc_config = file("$projectDir/assets/multiqc_config_nanopore.yaml", checkIfExists: true)
ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config) : Channel.empty()

if (params.input) { ch_input = file(params.input) }
if (params.fast5_dir) { ch_fast5_dir = file(params.fast5_dir) } else { ch_fast5_dir = ch_dummy_file }
if (params.sequencing_summary) { ch_sequencing_summary = file(params.sequencing_summary) } else { ch_sequencing_summary = ch_multiqc_config }
Expand All @@ -35,15 +41,6 @@ if (params.artic_minion_caller == 'medaka') {
}
}

/*
========================================================================================
CONFIG FILES
========================================================================================
*/

ch_multiqc_config = file("$projectDir/assets/multiqc_config_nanopore.yaml", checkIfExists: true)
ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath(params.multiqc_config) : Channel.empty()

/*
========================================================================================
IMPORT LOCAL MODULES/SUBWORKFLOWS
Expand Down Expand Up @@ -511,9 +508,11 @@ workflow NANOPORE {
========================================================================================
*/

workflow.onComplete {
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report)
NfcoreTemplate.summary(workflow, params, log)
if (params.platform == 'nanopore') {
workflow.onComplete {
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report)
NfcoreTemplate.summary(workflow, params, log)
}
}

/*
Expand Down

0 comments on commit f889766

Please sign in to comment.