diff --git a/main.nf b/main.nf index e22337c..edb7394 100644 --- a/main.nf +++ b/main.nf @@ -32,10 +32,7 @@ include { PIPELINE_INITIALISATION } from './subworkflows/local/utils_nf include { PIPELINE_COMPLETION } from './subworkflows/local/utils_nfcore_proteinfold_pipeline' include { getColabfoldAlphafold2Params } from './subworkflows/local/utils_nfcore_proteinfold_pipeline' include { getColabfoldAlphafold2ParamsPath } from './subworkflows/local/utils_nfcore_proteinfold_pipeline' - -include { GENERATE_REPORT } from './modules/local/generate_report' -include { COMPARE_STRUCTURES } from './modules/local/compare_structures' -include { FOLDSEEK_EASYSEARCH } from './modules/nf-core/foldseek/easysearch/main' +include { POST_PROCESSING } from './subworkflows/local/post_processing' /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -61,11 +58,15 @@ workflow NFCORE_PROTEINFOLD { samplesheet // channel: samplesheet read in from --input main: - ch_samplesheet = samplesheet - ch_multiqc = Channel.empty() - ch_versions = Channel.empty() - ch_report_input = Channel.empty() - requested_modes = params.mode.toLowerCase().split(",") + ch_samplesheet = samplesheet + ch_multiqc = Channel.empty() + ch_versions = Channel.empty() + ch_report_input = Channel.empty() + ch_foldseek_db = Channel.empty() + ch_colabfold_out = Channel.empty() + ch_esmfold_out = Channel.empty() + ch_alphafold2_out = Channel.empty() + requested_modes = params.mode.toLowerCase().split(",") // // WORKFLOW: Run alphafold2 // @@ -121,11 +122,16 @@ workflow NFCORE_PROTEINFOLD { PREPARE_ALPHAFOLD2_DBS.out.pdb_seqres, PREPARE_ALPHAFOLD2_DBS.out.uniprot ) - ch_multiqc = ALPHAFOLD2.out.multiqc_report + ch_multiqc = ch_multiqc.mix(ALPHAFOLD2.out.multiqc_report.collect()) ch_versions = ch_versions.mix(ALPHAFOLD2.out.versions) ch_report_input = ch_report_input.mix( ALPHAFOLD2.out.pdb.join(ALPHAFOLD2.out.msa).map{it[0]["model"] = "alphafold2"; it} ) + ALPHAFOLD2 + .out + .main_pdb + .map{[it[0]["id"], it[0], it[1]]} + .set{ch_alphafold2_out} } // @@ -160,7 +166,7 @@ workflow NFCORE_PROTEINFOLD { PREPARE_COLABFOLD_DBS.out.uniref30, params.num_recycles_colabfold ) - ch_multiqc = COLABFOLD.out.multiqc_report + ch_multiqc = ch_multiqc.mix(COLABFOLD.out.multiqc_report) ch_versions = ch_versions.mix(COLABFOLD.out.versions) ch_report_input = ch_report_input.mix( COLABFOLD @@ -169,6 +175,14 @@ workflow NFCORE_PROTEINFOLD { .join(COLABFOLD.out.msa) .map { it[0]["model"] = "colabfold"; it } ) + COLABFOLD + .out + .main_pdb + .map{[it[0]["id"], it[0], it[1]]} + .join(COLABFOLD.out.msa + .map{[it[0]["id"], it[1]]}, + remainder:true + ).set{ch_colabfold_out} } // @@ -196,84 +210,49 @@ workflow NFCORE_PROTEINFOLD { PREPARE_ESMFOLD_DBS.out.params, params.num_recycles_esmfold ) - ch_multiqc = ESMFOLD.out.multiqc_report + ch_multiqc = ch_multiqc.mix(ESMFOLD.out.multiqc_report.collect()) ch_versions = ch_versions.mix(ESMFOLD.out.versions) ch_report_input = ch_report_input.mix( ESMFOLD.out.pdb.combine(Channel.fromPath("$projectDir/assets/NO_FILE")).map{it[0]["model"] = "esmfold"; it} ) + ch_report_input.filter{it[0]["model"] == "esmfold"} + .map{[it[0]["id"], it[0], it[1], it[2]]} + .set{ch_esmfold_out} } // // POST PROCESSING: generate visulaisation reports // - if (!params.skip_visualisation){ - GENERATE_REPORT( - ch_report_input.map{[it[0], it[1]]}, - ch_report_input.map{[it[0], it[2]]}, - ch_report_input.map{it[0].model}, - Channel.fromPath("$projectDir/assets/proteinfold_template.html", checkIfExists: true).first() - ) - ch_versions = ch_versions.mix(GENERATE_REPORT.out.versions) - //GENERATE_REPORT.out.sequence_coverage.view() - if (requested_modes.size() > 1){ - ch_report_input.filter{it[0]["model"] == "esmfold"} - .map{[it[0]["id"], it[0], it[1], it[2]]} - .set{ch_comparision_report_files} - - if (requested_modes.contains("alphafold2")) { - ch_comparision_report_files = ch_comparision_report_files.mix( - ALPHAFOLD2 - .out - .main_pdb - .map{[it[0]["id"], it[0], it[1]]} - .join(GENERATE_REPORT.out.sequence_coverage - .filter{it[0]["model"] == "alphafold2"} - .map{[it[0]["id"], it[1]]}, remainder:true - ) - ) - } - if (requested_modes.contains("colabfold")) { - ch_comparision_report_files = ch_comparision_report_files.mix( - COLABFOLD - .out - .main_pdb - .map{[it[0]["id"], it[0], it[1]]} - .join(COLABFOLD.out.msa - .map{[it[0]["id"], it[1]]}, - remainder:true - ) - ) - } - - ch_comparision_report_files - .groupTuple(by: [0], size: requested_modes.size()) - .set{ch_comparision_report_input} - - COMPARE_STRUCTURES( - ch_comparision_report_input.map{it[1][0]["models"] = params.mode.toLowerCase(); [it[1][0], it[2]]}, - ch_comparision_report_input.map{it[1][0]["models"] = params.mode.toLowerCase(); [it[1][0], it[3]]}, - Channel.fromPath("$projectDir/assets/comparison_template.html", checkIfExists: true).first() - ) - ch_versions = ch_versions.mix(COMPARE_STRUCTURES.out.versions) - } - } - if (params.foldseek_search == "easysearch"){ ch_foldseek_db = channel.value([["id": params.foldseek_db], file(params.foldseek_db_path, checkIfExists: true)]) - - FOLDSEEK_EASYSEARCH( - ch_report_input - .map{ - if (it[0].model == "esmfold") - [it[0], it[1]] - else - [it[0], it[1][0]] - }, - ch_foldseek_db - ) } + ch_multiqc_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config ) : Channel.empty() + ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo ) : Channel.empty() + ch_multiqc_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) +//ch_multiqc.view() + POST_PROCESSING( + params.skip_visualisation, + requested_modes.size(), + ch_report_input, + Channel.fromPath("$projectDir/assets/proteinfold_template.html", checkIfExists: true).first(), + Channel.fromPath("$projectDir/assets/comparison_template.html", checkIfExists: true).first(), + params.foldseek_search, + ch_foldseek_db, + params.skip_multiqc, + params.outdir, + ch_versions, + ch_multiqc, + Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true).first(), + ch_multiqc_config.first(), + ch_multiqc_logo.first(), + ch_multiqc_methods_description.first(), + ch_alphafold2_out, + ch_esmfold_out, + ch_colabfold_out + ) + emit: multiqc_report = ch_multiqc } diff --git a/modules/nf-core/multiqc/main.nf b/modules/nf-core/multiqc/main.nf index 7d6cf08..7ff05e6 100644 --- a/modules/nf-core/multiqc/main.nf +++ b/modules/nf-core/multiqc/main.nf @@ -1,13 +1,13 @@ process MULTIQC { label 'process_single' - + tag "$meta.model" conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/multiqc:1.25.1--pyhdfd78af_0' : 'biocontainers/multiqc:1.25.1--pyhdfd78af_0' }" input: - path multiqc_files + tuple val(meta), path(multiqc_files) path(multiqc_config) path(extra_multiqc_config) path(multiqc_logo) @@ -25,7 +25,7 @@ process MULTIQC { script: def args = task.ext.args ?: '' - def prefix = task.ext.prefix ? "--filename ${task.ext.prefix}.html" : '' + def prefix = task.ext.prefix ? "--filename ${task.ext.prefix}.html" : "--filename ${meta.model}_multiqc_report.html" def config = multiqc_config ? "--config $multiqc_config" : '' def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' def logo = multiqc_logo ? "--cl-config 'custom_logo: \"${multiqc_logo}\"'" : '' diff --git a/modules/nf-core/multiqc/multiqc.diff b/modules/nf-core/multiqc/multiqc.diff index d0efc03..fc76364 100644 --- a/modules/nf-core/multiqc/multiqc.diff +++ b/modules/nf-core/multiqc/multiqc.diff @@ -1,14 +1,272 @@ Changes in module 'nf-core/multiqc' +--- modules/nf-core/multiqc/meta.yml ++++ modules/nf-core/multiqc/meta.yml +@@ -1,5 +1,6 @@ + name: multiqc +-description: Aggregate results from bioinformatics analyses across many samples into a single report ++description: Aggregate results from bioinformatics analyses across many samples into ++ a single report + keywords: + - QC + - bioinformatics tools +@@ -12,40 +13,59 @@ + homepage: https://multiqc.info/ + documentation: https://multiqc.info/docs/ + licence: ["GPL-3.0-or-later"] ++ identifier: biotools:multiqc + input: +- - multiqc_files: +- type: file +- description: | +- List of reports / files recognised by MultiQC, for example the html and zip output of FastQC +- - multiqc_config: +- type: file +- description: Optional config yml for MultiQC +- pattern: "*.{yml,yaml}" +- - extra_multiqc_config: +- type: file +- description: Second optional config yml for MultiQC. Will override common sections in multiqc_config. +- pattern: "*.{yml,yaml}" +- - multiqc_logo: +- type: file +- description: Optional logo file for MultiQC +- pattern: "*.{png}" ++ - - multiqc_files: ++ type: file ++ description: | ++ List of reports / files recognised by MultiQC, for example the html and zip output of FastQC ++ - - multiqc_config: ++ type: file ++ description: Optional config yml for MultiQC ++ pattern: "*.{yml,yaml}" ++ - - extra_multiqc_config: ++ type: file ++ description: Second optional config yml for MultiQC. Will override common sections ++ in multiqc_config. ++ pattern: "*.{yml,yaml}" ++ - - multiqc_logo: ++ type: file ++ description: Optional logo file for MultiQC ++ pattern: "*.{png}" ++ - - replace_names: ++ type: file ++ description: | ++ Optional two-column sample renaming file. First column a set of ++ patterns, second column a set of corresponding replacements. Passed via ++ MultiQC's `--replace-names` option. ++ pattern: "*.{tsv}" ++ - - sample_names: ++ type: file ++ description: | ++ Optional TSV file with headers, passed to the MultiQC --sample_names ++ argument. ++ pattern: "*.{tsv}" + output: + - report: +- type: file +- description: MultiQC report file +- pattern: "multiqc_report.html" ++ - "*multiqc_report.html": ++ type: file ++ description: MultiQC report file ++ pattern: "multiqc_report.html" + - data: +- type: directory +- description: MultiQC data dir +- pattern: "multiqc_data" ++ - "*_data": ++ type: directory ++ description: MultiQC data dir ++ pattern: "multiqc_data" + - plots: +- type: file +- description: Plots created by MultiQC +- pattern: "*_data" ++ - "*_plots": ++ type: file ++ description: Plots created by MultiQC ++ pattern: "*_data" + - versions: +- type: file +- description: File containing software versions +- pattern: "versions.yml" ++ - versions.yml: ++ type: file ++ description: File containing software versions ++ pattern: "versions.yml" + authors: + - "@abhi18av" + - "@bunop" + --- modules/nf-core/multiqc/main.nf +++ modules/nf-core/multiqc/main.nf -@@ -7,7 +7,7 @@ - 'biocontainers/multiqc:1.21--pyhdfd78af_0' }" +@@ -3,14 +3,16 @@ + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? +- 'https://depot.galaxyproject.org/singularity/multiqc:1.21--pyhdfd78af_0' : +- 'biocontainers/multiqc:1.21--pyhdfd78af_0' }" ++ 'https://depot.galaxyproject.org/singularity/multiqc:1.25.1--pyhdfd78af_0' : ++ 'biocontainers/multiqc:1.25.1--pyhdfd78af_0' }" input: - path multiqc_files, stageAs: "?/*" -+ path multiqc_files ++ tuple val(meta), path(multiqc_files) path(multiqc_config) path(extra_multiqc_config) path(multiqc_logo) ++ path(replace_names) ++ path(sample_names) + + output: + path "*multiqc_report.html", emit: report +@@ -23,16 +25,22 @@ + + script: + def args = task.ext.args ?: '' ++ def prefix = task.ext.prefix ? "--filename ${task.ext.prefix}.html" : "--filename ${meta.model}_multiqc_report.html" + def config = multiqc_config ? "--config $multiqc_config" : '' + def extra_config = extra_multiqc_config ? "--config $extra_multiqc_config" : '' +- def logo = multiqc_logo ? /--cl-config 'custom_logo: "${multiqc_logo}"'/ : '' ++ def logo = multiqc_logo ? "--cl-config 'custom_logo: \"${multiqc_logo}\"'" : '' ++ def replace = replace_names ? "--replace-names ${replace_names}" : '' ++ def samples = sample_names ? "--sample-names ${sample_names}" : '' + """ + multiqc \\ + --force \\ + $args \\ + $config \\ ++ $prefix \\ + $extra_config \\ + $logo \\ ++ $replace \\ ++ $samples \\ + . + + cat <<-END_VERSIONS > versions.yml +@@ -44,7 +52,7 @@ + stub: + """ + mkdir multiqc_data +- touch multiqc_plots ++ mkdir multiqc_plots + touch multiqc_report.html + + cat <<-END_VERSIONS > versions.yml + +--- modules/nf-core/multiqc/environment.yml ++++ modules/nf-core/multiqc/environment.yml +@@ -1,7 +1,5 @@ +-name: multiqc + channels: + - conda-forge + - bioconda +- - defaults + dependencies: +- - bioconda::multiqc=1.21 ++ - bioconda::multiqc=1.25.1 + +--- modules/nf-core/multiqc/tests/main.nf.test.snap ++++ modules/nf-core/multiqc/tests/main.nf.test.snap +@@ -2,14 +2,14 @@ + "multiqc_versions_single": { + "content": [ + [ +- "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" ++ "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + ] + ], + "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.10.1" ++ "nf-test": "0.9.0", ++ "nextflow": "24.04.4" + }, +- "timestamp": "2024-02-29T08:48:55.657331" ++ "timestamp": "2024-10-02T17:51:46.317523" + }, + "multiqc_stub": { + "content": [ +@@ -17,25 +17,25 @@ + "multiqc_report.html", + "multiqc_data", + "multiqc_plots", +- "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" ++ "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + ] + ], + "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.10.1" ++ "nf-test": "0.9.0", ++ "nextflow": "24.04.4" + }, +- "timestamp": "2024-02-29T08:49:49.071937" ++ "timestamp": "2024-10-02T17:52:20.680978" + }, + "multiqc_versions_config": { + "content": [ + [ +- "versions.yml:md5,21f35ee29416b9b3073c28733efe4b7d" ++ "versions.yml:md5,41f391dcedce7f93ca188f3a3ffa0916" + ] + ], + "meta": { +- "nf-test": "0.8.4", +- "nextflow": "23.10.1" ++ "nf-test": "0.9.0", ++ "nextflow": "24.04.4" + }, +- "timestamp": "2024-02-29T08:49:25.457567" ++ "timestamp": "2024-10-02T17:52:09.185842" + } + } +--- modules/nf-core/multiqc/tests/main.nf.test ++++ modules/nf-core/multiqc/tests/main.nf.test +@@ -8,6 +8,8 @@ + tag "modules_nfcore" + tag "multiqc" + ++ config "./nextflow.config" ++ + test("sarscov2 single-end [fastqc]") { + + when { +@@ -17,6 +19,8 @@ + input[1] = [] + input[2] = [] + input[3] = [] ++ input[4] = [] ++ input[5] = [] + """ + } + } +@@ -41,6 +45,8 @@ + input[1] = Channel.of(file("https://github.com/nf-core/tools/raw/dev/nf_core/pipeline-template/assets/multiqc_config.yml", checkIfExists: true)) + input[2] = [] + input[3] = [] ++ input[4] = [] ++ input[5] = [] + """ + } + } +@@ -66,6 +72,8 @@ + input[1] = [] + input[2] = [] + input[3] = [] ++ input[4] = [] ++ input[5] = [] + """ + } + } + +--- /dev/null ++++ modules/nf-core/multiqc/tests/nextflow.config +@@ -0,0 +1,5 @@ ++process { ++ withName: 'MULTIQC' { ++ ext.prefix = null ++ } ++} ************************************************************ diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf new file mode 100644 index 0000000..631644d --- /dev/null +++ b/subworkflows/local/post_processing.nf @@ -0,0 +1,130 @@ +// +// Post processing analysis for the predected structures +// + +// +// SUBWORKFLOW: Consisting entirely of nf-core/modules +// +include { paramsSummaryMap } from 'plugin/nf-schema' +include { paramsSummaryMultiqc } from '../nf-core/utils_nfcore_pipeline' +include { softwareVersionsToYAML } from '../nf-core/utils_nfcore_pipeline' +include { methodsDescriptionText } from './utils_nfcore_proteinfold_pipeline' + +include { GENERATE_REPORT } from '../../modules/local/generate_report' +include { COMPARE_STRUCTURES } from '../../modules/local/compare_structures' +include { FOLDSEEK_EASYSEARCH } from '../../modules/nf-core/foldseek/easysearch/main' +include { MULTIQC } from '../../modules/nf-core/multiqc/main' + + +workflow POST_PROCESSING { + + take: + skip_visualisation + requested_modes_size + ch_report_input + ch_proteinfold_template + ch_comparison_template + foldseek_search + ch_foldseek_db + skip_multiqc + outdir + ch_versions + ch_multiqc_rep + ch_multiqc_config + ch_multiqc_custom_config + ch_multiqc_logo + ch_multiqc_custom_methods_description + ch_alphafold2_out + ch_esmfold_out + ch_colabfold_out + + main: + ch_comparision_report_files = Channel.empty() + + if (!skip_visualisation){ + GENERATE_REPORT( + ch_report_input.map{[it[0], it[1]]}, + ch_report_input.map{[it[0], it[2]]}, + ch_report_input.map{it[0].model}, + ch_proteinfold_template + ) + ch_versions = ch_versions.mix(GENERATE_REPORT.out.versions) + + if (requested_modes_size > 1){ + ch_comparision_report_files = ch_comparision_report_files.mix(ch_alphafold2_out + .join(GENERATE_REPORT.out.sequence_coverage + .filter{it[0]["model"] == "alphafold2"} + .map{[it[0]["id"], it[1]]}, remainder:true + ) + ) + + ch_comparision_report_files = ch_comparision_report_files.mix( + ch_colabfold_out + ) + + ch_comparision_report_files = ch_comparision_report_files.mix( + ch_esmfold_out + ) + //ch_comparision_report_files.view() + ch_comparision_report_files + .groupTuple(by: [0], size: requested_modes_size) + .set{ch_comparision_report_input} + + COMPARE_STRUCTURES( + ch_comparision_report_input.map{it[1][0]["models"] = params.mode.toLowerCase(); [it[1][0], it[2]]}, + ch_comparision_report_input.map{it[1][0]["models"] = params.mode.toLowerCase(); [it[1][0], it[3]]}, + ch_comparison_template + ) + ch_versions = ch_versions.mix(COMPARE_STRUCTURES.out.versions) + } + } + + if (foldseek_search == "easysearch"){ + FOLDSEEK_EASYSEARCH( + ch_report_input + .map{ + if (it[0].model == "esmfold") + [it[0], it[1]] + else + [it[0], it[1][0]] + }, + ch_foldseek_db + ) + } + + // + // Collate and save software versions + // + softwareVersionsToYAML(ch_versions) + .collectFile(storeDir: "${outdir}/pipeline_info", name: 'nf_core_proteinfold_software_versions.yml', sort: true, newLine: true) + .set { ch_collated_versions } + // + // MODULE: MultiQC + // + if (!skip_multiqc) { + summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") + ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) + ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) + ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description)) + + ch_multiqc_files = Channel.empty() + ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) + ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) + ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) + MULTIQC ( + ch_multiqc_rep.combine(ch_multiqc_files.collect().map{[it]}).map{[it[0], it[1] + it[2]]}, + ch_multiqc_config, + ch_multiqc_custom_config.collect().ifEmpty([]), + ch_multiqc_logo.collect().ifEmpty([]), + [], + [] + ) + ch_multiqc_report = MULTIQC.out.report.toList() + }else{ + ch_multiqc_report = Channel.empty() + } + + emit: + versions = ch_versions + multiqc_report = ch_multiqc_report +} diff --git a/workflows/alphafold2.nf b/workflows/alphafold2.nf index 2a753e6..63b6e08 100644 --- a/workflows/alphafold2.nf +++ b/workflows/alphafold2.nf @@ -17,19 +17,6 @@ include { RUN_ALPHAFOLD2_PRED } from '../modules/local/run_alphafold2_pred' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -// -// MODULE: Installed directly from nf-core/modules -// -include { MULTIQC } from '../modules/nf-core/multiqc/main' - -// -// SUBWORKFLOW: Consisting entirely of nf-core/modules -// -include { paramsSummaryMap } from 'plugin/nf-schema' -include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_proteinfold_pipeline' - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUN MAIN WORKFLOW @@ -60,6 +47,7 @@ workflow ALPHAFOLD2 { ch_pdb = Channel.empty() ch_main_pdb = Channel.empty() ch_msa = Channel.empty() + ch_multiqc_rep = Channel.empty() if (alphafold2_model_preset != 'multimer') { ch_samplesheet @@ -93,7 +81,7 @@ workflow ALPHAFOLD2 { ch_pdb = ch_pdb.mix(RUN_ALPHAFOLD2.out.pdb) ch_main_pdb = ch_main_pdb.mix(RUN_ALPHAFOLD2.out.main_pdb) ch_msa = ch_msa.mix(RUN_ALPHAFOLD2.out.msa) - ch_multiqc_rep = RUN_ALPHAFOLD2.out.multiqc.map{it[1]}.collect() + ch_multiqc_rep = RUN_ALPHAFOLD2.out.multiqc.map{it[1]}.toSortedList().map{[["model":"alphafold2"], it]} ch_versions = ch_versions.mix(RUN_ALPHAFOLD2.out.versions) } else if (alphafold2_mode == 'split_msa_prediction') { @@ -136,52 +124,15 @@ workflow ALPHAFOLD2 { ch_pdb = ch_pdb.mix(RUN_ALPHAFOLD2_PRED.out.pdb) ch_main_pdb = ch_main_pdb.mix(RUN_ALPHAFOLD2_PRED.out.main_pdb) ch_msa = ch_msa.mix(RUN_ALPHAFOLD2_PRED.out.msa) - ch_multiqc_rep = RUN_ALPHAFOLD2_PRED.out.multiqc.map{it[1]}.collect() + ch_multiqc_rep = RUN_ALPHAFOLD2_PRED.out.multiqc.map{it[1]}.toSortedList().map{[["model":"alphafold2"], it]} ch_versions = ch_versions.mix(RUN_ALPHAFOLD2_PRED.out.versions) } - // - // Collate and save software versions - // - softwareVersionsToYAML(ch_versions) - .collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_proteinfold_software_mqc_alphafold2_versions.yml', sort: true, newLine: true) - .set { ch_collated_versions } - // - // MODULE: MultiQC - // - ch_multiqc_report = Channel.empty() - if (!params.skip_multiqc) { - ch_multiqc_report = Channel.empty() - ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) - ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config ) : Channel.empty() - ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo ) : Channel.empty() - summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") - ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) - ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description)) - - ch_multiqc_files = Channel.empty() - ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) - ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) - ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) - ch_multiqc_files = ch_multiqc_files.mix(ch_multiqc_rep) - - MULTIQC ( - ch_multiqc_files.collect(), - ch_multiqc_config.toList(), - ch_multiqc_custom_config.toList(), - ch_multiqc_logo.toList(), - [], - [] - ) - ch_multiqc_report = MULTIQC.out.report.toList() - } - emit: main_pdb = ch_main_pdb // channel: /path/to/*.pdb pdb = ch_pdb // channel: /path/to/*.pdb msa = ch_msa // channel: /path/to/*msa.tsv - multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html + multiqc_report = ch_multiqc_rep // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/workflows/colabfold.nf b/workflows/colabfold.nf index c2a4f2b..c7875cb 100644 --- a/workflows/colabfold.nf +++ b/workflows/colabfold.nf @@ -17,19 +17,6 @@ include { MULTIFASTA_TO_CSV } from '../modules/local/multifasta_to_csv' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -// -// MODULE: Installed directly from nf-core/modules -// -include { MULTIQC } from '../modules/nf-core/multiqc/main' - -// -// SUBWORKFLOW: Consisting entirely of nf-core/modules -// -include { paramsSummaryMap } from 'plugin/nf-schema' -include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_proteinfold_pipeline' - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUN MAIN WORKFLOW @@ -120,49 +107,11 @@ workflow COLABFOLD { ch_versions = ch_versions.mix(COLABFOLD_BATCH.out.versions) } - // - // Collate and save software versions - // - softwareVersionsToYAML(ch_versions) - .collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_proteinfold_software_mqc_colabfold_versions.yml', sort: true, newLine: true) - .set { ch_collated_versions } - - // - // MODULE: MultiQC - // - ch_multiqc_report = Channel.empty() - if (!params.skip_multiqc) { - ch_multiqc_report = Channel.empty() - ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) - ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config ) : Channel.empty() - ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo ) : Channel.empty() - summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") - ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) - ch_multiqc_custom_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_custom_methods_description)) - - ch_multiqc_files = Channel.empty() - ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) - ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) - ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) - ch_multiqc_files = ch_multiqc_files.mix(COLABFOLD_BATCH.out.multiqc.map{it[1]}.collect()) - - MULTIQC ( - ch_multiqc_files.collect(), - ch_multiqc_config.toList(), - ch_multiqc_custom_config.toList(), - ch_multiqc_logo.toList(), - [], - [] - ) - ch_multiqc_report = MULTIQC.out.report.toList() - } - emit: pdb = COLABFOLD_BATCH.out.pdb // channel: /path/to/*.pdb main_pdb = COLABFOLD_BATCH.out.main_pdb // channel: /path/to/*.pdb msa = COLABFOLD_BATCH.out.msa // channel: /path/to/*_coverage.png - multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html + multiqc_report = COLABFOLD_BATCH.out.multiqc.map{it[1]}.flatten().toList().map{[["model":"colabfold"], it]} // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index ab7e5a8..57aaa04 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -16,19 +16,6 @@ include { MULTIFASTA_TO_SINGLEFASTA } from '../modules/local/multifasta_to_singl ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -// -// MODULE: Installed directly from nf-core/modules -// -include { MULTIQC } from '../modules/nf-core/multiqc/main' - -// -// SUBWORKFLOW: Consisting entirely of nf-core/modules -// -include { paramsSummaryMap } from 'plugin/nf-schema' -include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline' -include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_proteinfold_pipeline' - /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RUN MAIN WORKFLOW @@ -69,47 +56,9 @@ workflow ESMFOLD { ch_versions = ch_versions.mix(RUN_ESMFOLD.out.versions) } - // - // Collate and save software versions - // - softwareVersionsToYAML(ch_versions) - .collectFile(storeDir: "${params.outdir}/pipeline_info", name: 'nf_core_proteinfold_software_mqc_esmfold_versions.yml', sort: true, newLine: true) - .set { ch_collated_versions } - - // - // MODULE: MultiQC - // - ch_multiqc_report = Channel.empty() - if (!params.skip_multiqc) { - ch_multiqc_report = Channel.empty() - ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true) - ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config ) : Channel.empty() - ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo ) : Channel.empty() - summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") - ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) - ch_multiqc_methods_description = params.multiqc_methods_description ? file(params.multiqc_methods_description, checkIfExists: true) : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_methods_description)) - - ch_multiqc_files = Channel.empty() - ch_multiqc_files = ch_multiqc_files.mix(ch_workflow_summary.collectFile(name: 'workflow_summary_mqc.yaml')) - ch_multiqc_files = ch_multiqc_files.mix(ch_methods_description.collectFile(name: 'methods_description_mqc.yaml')) - ch_multiqc_files = ch_multiqc_files.mix(ch_collated_versions) - ch_multiqc_files = ch_multiqc_files.mix(RUN_ESMFOLD.out.multiqc.map{it[1]}.collect()) - - MULTIQC ( - ch_multiqc_files.collect(), - ch_multiqc_config.toList(), - ch_multiqc_custom_config.toList(), - ch_multiqc_logo.toList(), - [], - [] - ) - ch_multiqc_report = MULTIQC.out.report.toList() - } - emit: pdb = RUN_ESMFOLD.out.pdb // channel: /path/to/*pdb - multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html + multiqc_report = RUN_ESMFOLD.out.multiqc.map{it[1]}.toSortedList().map{[["model":"esmfold"], it]} // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] }