diff --git a/conf/modules.config b/conf/modules.config index 3227877..ce83871 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -12,12 +12,6 @@ process { - publishDir = [ - path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] - // BWA MEM withName: "BWA_MEM" { ext.args = {[ @@ -33,7 +27,6 @@ process { // Picard CrosscheckFingerprints withName: "PICARD_CROSSCHECKFINGERPRINTS" { - publishDir = [ enabled:false ] ext.args = {[ "--CROSSCHECK_BY SAMPLE", "--CROSSCHECK_MODE CHECK_ALL_OTHERS", @@ -47,7 +40,6 @@ process { } withName: "NGSBITS_SAMPLEGENDER" { - publishDir = [ enabled:false ] ext.prefix = { "${meta.id}.xy" } ext.args = "-max_female ${params.max_yx_female} -min_male ${params.min_yx_male}" ext.args2 = "-min_female ${params.min_hetx_female} -max_male ${params.max_hetx_male}" @@ -56,20 +48,10 @@ process { withName: 'MULTIQC_POOLS' { ext.args = { params.multiqc_title ? "--title \"${params.multiqc_title}_${meta.id}\"" : "--title \"$meta.id\"" } - publishDir = [ - path: { "${params.outdir}/multiqc" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } withName: 'MULTIQC_MAIN' { ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' } - publishDir = [ - path: { "${params.outdir}/multiqc" }, - mode: params.publish_dir_mode, - saveAs: { filename -> filename.equals('versions.yml') ? null : filename } - ] } } diff --git a/main.nf b/main.nf index 007f38b..7aeec67 100644 --- a/main.nf +++ b/main.nf @@ -17,41 +17,6 @@ include { SAMPLETRACKING } from './workflows/sampletracking' include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nfcore_sampletracking_pipeline' include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_sampletracking_pipeline' -/* -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - NAMED WORKFLOWS FOR PIPELINE -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -*/ -// -// WORKFLOW: Run main analysis pipeline depending on type of input -// -workflow NFCMGG_SAMPLETRACKING { - - take: - samplesheet // channel: samplesheet read in from --input - bwa_index // channel: bwa index file - genome_fasta // channel: genome fasta file - haplotype_map // channel: haplotype map file - outdir // channel: output directory - - main: - - // - // WORKFLOW: Run pipeline - // - SAMPLETRACKING ( - samplesheet, - bwa_index, - genome_fasta, - haplotype_map, - outdir - ) - emit: - multiqc_report = SAMPLETRACKING.out.multiqc_report // channel: /path/to/multiqc_report.html -} -/* - - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUN MAIN WORKFLOW @@ -67,7 +32,6 @@ workflow { PIPELINE_INITIALISATION ( params.version, params.validate_params, - params.monochrome_logs, args, params.outdir, params.input, @@ -79,22 +43,25 @@ workflow { // // WORKFLOW: Run main workflow // - NFCMGG_SAMPLETRACKING ( + SAMPLETRACKING ( PIPELINE_INITIALISATION.out.samplesheet, - Channel.value([ + channel.value([ [id: "bwa"], file(params.bwa_index, checkIfExists: true) ]), - Channel.value( + channel.value( [[id:"genome_fasta"], file(params.fasta, checkIfExists: true), file(params.fai, checkIfExists: true), ]), - Channel.value( + channel.value( [[id:"haplotype_map"], file(params.haplotype_map, checkIfExists: true) ]), - params.outdir + params.outdir, + params.multiqc_config, + params.multiqc_logo, + params.multiqc_methods_description ) // // SUBWORKFLOW: Run completion tasks @@ -106,8 +73,17 @@ workflow { params.outdir, params.monochrome_logs, params.hook_url, - NFCMGG_SAMPLETRACKING.out.multiqc_report + SAMPLETRACKING.out.multiqc_report ) + + publish: + multiqc_report = SAMPLETRACKING.out.multiqc_report + multiqc_pools = SAMPLETRACKING.out.multiqc_pools +} + +output { + multiqc_report { path "multiqc/" } + multiqc_pools { path "multiqc/" } } /* diff --git a/modules.json b/modules.json index 0c1ce60..e3630b3 100644 --- a/modules.json +++ b/modules.json @@ -29,7 +29,7 @@ }, "picard/crosscheckfingerprints": { "branch": "master", - "git_sha": "df124e87c74d8b40285199f8cc20151f5aa57255", + "git_sha": "4e8415483e3119fc3035ece12ec9236dac261357", "installed_by": ["modules"], "patch": "modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff" }, @@ -49,7 +49,7 @@ }, "utils_nfcore_pipeline": { "branch": "master", - "git_sha": "05954dab2ff481bcb999f24455da29a5828af08d", + "git_sha": "271e7fc14eb1320364416d996fb077421f3faed2", "installed_by": ["subworkflows"] }, "utils_nfschema_plugin": { diff --git a/modules/nf-core/picard/crosscheckfingerprints/main.nf b/modules/nf-core/picard/crosscheckfingerprints/main.nf index b1239a7..e68989d 100644 --- a/modules/nf-core/picard/crosscheckfingerprints/main.nf +++ b/modules/nf-core/picard/crosscheckfingerprints/main.nf @@ -22,8 +22,8 @@ process PICARD_CROSSCHECKFINGERPRINTS { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def input1_cmd = input1.collect{"--INPUT $it"}.join(' ') - def input2_cmd = input2.collect{"--SECOND_INPUT $it"}.join(' ') + def input1_cmd = input1.collect{ f1 -> "--INPUT $f1"}.join(' ') + def input2_cmd = input2.collect{ f2 -> "--SECOND_INPUT $f2"}.join(' ') def reference_cmd = fasta ? "--REFERENCE_SEQUENCE $fasta" : "" def avail_mem = 3072 diff --git a/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff b/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff index 93e0f34..86b0117 100644 --- a/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff +++ b/modules/nf-core/picard/crosscheckfingerprints/picard-crosscheckfingerprints.diff @@ -1,6 +1,4 @@ Changes in component 'nf-core/picard/crosscheckfingerprints' -'modules/nf-core/picard/crosscheckfingerprints/environment.yml' is unchanged -'modules/nf-core/picard/crosscheckfingerprints/meta.yml' is unchanged Changes in 'picard/crosscheckfingerprints/main.nf': --- modules/nf-core/picard/crosscheckfingerprints/main.nf +++ modules/nf-core/picard/crosscheckfingerprints/main.nf @@ -14,7 +12,9 @@ Changes in 'picard/crosscheckfingerprints/main.nf': output: tuple val(meta), path("*.crosscheck_metrics.txt"), emit: crosscheck_metrics +'modules/nf-core/picard/crosscheckfingerprints/environment.yml' is unchanged +'modules/nf-core/picard/crosscheckfingerprints/meta.yml' is unchanged +'modules/nf-core/picard/crosscheckfingerprints/tests/main.nf.test' is unchanged 'modules/nf-core/picard/crosscheckfingerprints/tests/main.nf.test.snap' is unchanged 'modules/nf-core/picard/crosscheckfingerprints/tests/nextflow.config' is unchanged -'modules/nf-core/picard/crosscheckfingerprints/tests/main.nf.test' is unchanged ************************************************************ diff --git a/nextflow.config b/nextflow.config index 84b3774..7e6fd60 100644 --- a/nextflow.config +++ b/nextflow.config @@ -283,3 +283,6 @@ validation { defaultIgnoreParams = [] monochromeLogs = params.monochrome_logs } + +workflow.output.mode = params.publish_dir_mode +outputDir = params.outdir diff --git a/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf b/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf index 960f3b5..7c83e26 100644 --- a/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf +++ b/subworkflows/local/utils_nfcore_sampletracking_pipeline/main.nf @@ -29,7 +29,6 @@ workflow PIPELINE_INITIALISATION { take: version // boolean: Display version and exit validate_params // boolean: Boolean whether to validate parameters against the schema at runtime - monochrome_logs // boolean: Do not use coloured log outputs nextflow_cli_args // array: List of positional nextflow CLI args outdir // string: The output directory where the results will be saved input // string: Path to input samplesheet @@ -39,7 +38,7 @@ workflow PIPELINE_INITIALISATION { main: - ch_versions = Channel.empty() + ch_versions = channel.empty() // // Print version and exit if required and dump pipeline parameters to JSON file @@ -89,7 +88,7 @@ workflow PIPELINE_INITIALISATION { return counts }) - Channel + channel .fromList(input_list) .map { meta, sample_bam, sample_bam_index, snp_fastq_1, snp_fastq_2, snp_bam, snp_bam_index -> diff --git a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index bfd2587..2f30e9a 100644 --- a/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -98,7 +98,7 @@ def workflowVersionToYAML() { // Get channel of software versions used in pipeline in YAML format // def softwareVersionsToYAML(ch_versions) { - return ch_versions.unique().map { version -> processVersionsFromYAML(version) }.unique().mix(Channel.of(workflowVersionToYAML())) + return ch_versions.unique().map { version -> processVersionsFromYAML(version) }.unique().mix(channel.of(workflowVersionToYAML())) } // diff --git a/workflows/sampletracking.nf b/workflows/sampletracking.nf index 11ef55f..4d3964f 100644 --- a/workflows/sampletracking.nf +++ b/workflows/sampletracking.nf @@ -39,9 +39,9 @@ workflow SAMPLETRACKING { main: - def ch_versions = Channel.empty() - def ch_multiqc_files = Channel.empty() - def ch_pool_multiqc_files = Channel.empty() + def ch_versions = channel.empty() + def ch_multiqc_files = channel.empty() + def ch_pool_multiqc_files = channel.empty() def (ch_sample, ch_snp, ch_rest) = ch_samplesheet @@ -109,7 +109,7 @@ workflow SAMPLETRACKING { // Crosscheck fingerprints // - def ch_crosscheck_metrics_out = Channel.empty() + def ch_crosscheck_metrics_out = channel.empty() ch_samplesheet_fixed .filter { meta, _sample_bam, _sample_bam_index, snp_fastq, snp_bam, _snp_bam_index -> if(!snp_bam && !snp_fastq) { @@ -169,7 +169,7 @@ workflow SAMPLETRACKING { // // Determine sample sex // - def ch_sex_prediction_out = Channel.empty() + def ch_sex_prediction_out = channel.empty() ch_samplesheet_fixed .map { meta, sample_bam, sample_bam_index, _snp_fastq, _snp_bam, _snp_bam_index -> [ meta, sample_bam, sample_bam_index ] @@ -267,24 +267,24 @@ workflow SAMPLETRACKING { // // MODULE: MultiQC // - ch_multiqc_config = Channel.fromPath( + ch_multiqc_config = channel.fromPath( "$projectDir/assets/multiqc_config.yml", checkIfExists: true) ch_multiqc_custom_config = multiqc_config ? - Channel.fromPath(multiqc_config, checkIfExists: true) : - Channel.empty() + channel.fromPath(multiqc_config, checkIfExists: true) : + channel.empty() ch_multiqc_logo = multiqc_logo ? - Channel.fromPath(multiqc_logo, checkIfExists: true) : - Channel.empty() + channel.fromPath(multiqc_logo, checkIfExists: true) : + channel.empty() summary_params = paramsSummaryMap( workflow, parameters_schema: "nextflow_schema.json") - ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) + ch_workflow_summary = channel.value(paramsSummaryMultiqc(summary_params)) ch_multiqc_files = ch_multiqc_files.mix( ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) ch_multiqc_custom_methods_description = multiqc_methods_description ? file(multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - ch_methods_description = Channel.value( + ch_methods_description = channel.value( methodsDescriptionText(ch_multiqc_custom_methods_description)) ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions)