From b520b9bd26d0a995a81760f16a74a76ed0cd69c1 Mon Sep 17 00:00:00 2001 From: Ziad Al Bkhetan Date: Sat, 21 Sep 2024 13:03:10 +1000 Subject: [PATCH 1/9] accepting mutltiple models --- conf/modules_alphafold2.config | 15 +++++++++++---- conf/modules_colabfold.config | 14 ++++++++++++-- conf/modules_esmfold.config | 11 ++++++++++- main.nf | 14 ++++++++------ nextflow.config | 8 +++++--- nextflow_schema.json | 3 +-- tower.yml | 8 ++++++-- 7 files changed, 53 insertions(+), 20 deletions(-) diff --git a/conf/modules_alphafold2.config b/conf/modules_alphafold2.config index 4aae2d30..33b04c38 100644 --- a/conf/modules_alphafold2.config +++ b/conf/modules_alphafold2.config @@ -17,11 +17,18 @@ process { withName: 'GUNZIP|COMBINE_UNIPROT|DOWNLOAD_PDBMMCIF|ARIA2_PDB_SEQRES' { publishDir = [ - path: {"${params.outdir}/DBs/${params.mode}/${params.alphafold2_mode}"}, + path: {"${params.outdir}/DBs/alphafold2/${params.alphafold2_mode}"}, mode: 'symlink', saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, ] } + withName: 'NFCORE_PROTEINFOLD:ALPHAFOLD2:MULTIQC' { + publishDir = [ + path: { "${params.outdir}/multiqc" }, + mode: 'copy', + saveAs: { filename -> filename.equals('versions.yml') ? null : "alphafold2_$filename" } + ] + } } if (params.alphafold2_mode == 'standard') { @@ -33,7 +40,7 @@ if (params.alphafold2_mode == 'standard') { params.max_template_date ? "--max_template_date ${params.max_template_date}" : '' ].join(' ').trim() publishDir = [ - path: { "${params.outdir}/${params.mode}/${params.alphafold2_mode}" }, + path: { "${params.outdir}/alphafold2/${params.alphafold2_mode}" }, mode: 'copy', saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, ] @@ -47,7 +54,7 @@ if (params.alphafold2_mode == 'split_msa_prediction') { withName: 'RUN_ALPHAFOLD2_MSA' { ext.args = params.max_template_date ? "--max_template_date ${params.max_template_date}" : '' publishDir = [ - path: { "${params.outdir}/${params.mode}/${params.alphafold2_mode}" }, + path: { "${params.outdir}/alphafold2/${params.alphafold2_mode}" }, mode: 'copy', saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -57,7 +64,7 @@ if (params.alphafold2_mode == 'split_msa_prediction') { if(params.use_gpu) { accelerator = 1 } ext.args = params.use_gpu ? '--use_gpu_relax=true' : '--use_gpu_relax=false' publishDir = [ - path: { "${params.outdir}/${params.mode}/${params.alphafold2_mode}" }, + path: { "${params.outdir}/alphafold2/${params.alphafold2_mode}" }, mode: 'copy', saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] diff --git a/conf/modules_colabfold.config b/conf/modules_colabfold.config index a7a719b0..2efcfa01 100644 --- a/conf/modules_colabfold.config +++ b/conf/modules_colabfold.config @@ -10,6 +10,16 @@ ---------------------------------------------------------------------------------------- */ +process { + withName: 'NFCORE_PROTEINFOLD:COLABFOLD:MULTIQC' { + publishDir = [ + path: { "${params.outdir}/multiqc" }, + mode: 'copy', + saveAs: { filename -> filename.equals('versions.yml') ? null : "colabfold_$filename" } + ] + } +} + if (params.colabfold_server == 'webserver') { process { withName: 'COLABFOLD_BATCH' { @@ -20,7 +30,7 @@ if (params.colabfold_server == 'webserver') { params.host_url ? "--host-url ${params.host_url}" : '' ].join(' ').trim() publishDir = [ - path: { "${params.outdir}/${params.mode}/${params.colabfold_server}" }, + path: { "${params.outdir}/colabfold/${params.colabfold_server}" }, mode: 'copy', saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, pattern: '*.*' @@ -57,7 +67,7 @@ if (params.colabfold_server == 'local') { params.use_templates ? '--templates' : '' ].join(' ').trim() publishDir = [ - path: { "${params.outdir}/${params.mode}/${params.colabfold_server}" }, + path: { "${params.outdir}/colabfold/${params.colabfold_server}" }, mode: 'copy', saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, pattern: '*.*' diff --git a/conf/modules_esmfold.config b/conf/modules_esmfold.config index 81b3048f..5b3113b8 100644 --- a/conf/modules_esmfold.config +++ b/conf/modules_esmfold.config @@ -14,10 +14,19 @@ process { withName: 'RUN_ESMFOLD' { ext.args = {params.use_gpu ? '' : '--cpu-only'} publishDir = [ - path: { "${params.outdir}/${params.mode}" }, + path: { "${params.outdir}/colabfold" }, mode: 'copy', saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, pattern: '*.*' ] } + + withName: 'NFCORE_PROTEINFOLD:ESMFOLD:MULTIQC' { + publishDir = [ + path: { "${params.outdir}/multiqc" }, + mode: 'copy', + saveAs: { filename -> filename.equals('versions.yml') ? null : "esmfold_$filename" } + ] + } + } diff --git a/main.nf b/main.nf index d6da0f09..cdc63d84 100644 --- a/main.nf +++ b/main.nf @@ -17,13 +17,15 @@ nextflow.enable.dsl = 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -if (params.mode == "alphafold2") { +if (params.mode.toLowerCase().split(",").contains("alphafold2")) { include { PREPARE_ALPHAFOLD2_DBS } from './subworkflows/local/prepare_alphafold2_dbs' include { ALPHAFOLD2 } from './workflows/alphafold2' -} else if (params.mode == "colabfold") { +} +if (params.mode.toLowerCase().split(",").contains("colabfold")) { include { PREPARE_COLABFOLD_DBS } from './subworkflows/local/prepare_colabfold_dbs' include { COLABFOLD } from './workflows/colabfold' -} else if (params.mode == "esmfold") { +} +if (params.mode.toLowerCase().split(",").contains("esmfold")) { include { PREPARE_ESMFOLD_DBS } from './subworkflows/local/prepare_esmfold_dbs' include { ESMFOLD } from './workflows/esmfold' } @@ -60,7 +62,7 @@ workflow NFCORE_PROTEINFOLD { // // WORKFLOW: Run alphafold2 // - if(params.mode == "alphafold2") { + if(params.mode.toLowerCase().split(",").contains("alphafold2")) { // // SUBWORKFLOW: Prepare Alphafold2 DBs // @@ -118,7 +120,7 @@ workflow NFCORE_PROTEINFOLD { // // WORKFLOW: Run colabfold // - else if(params.mode == "colabfold") { + if(params.mode.toLowerCase().split(",").contains("colabfold")) { // // SUBWORKFLOW: Prepare Colabfold DBs // @@ -153,7 +155,7 @@ workflow NFCORE_PROTEINFOLD { // // WORKFLOW: Run esmfold // - else if(params.mode == "esmfold") { + if(params.mode.toLowerCase().split(",").contains("esmfold")) { // // SUBWORKFLOW: Prepare esmfold DBs // diff --git a/nextflow.config b/nextflow.config index 7a0c5c4e..3f7428dd 100644 --- a/nextflow.config +++ b/nextflow.config @@ -330,11 +330,13 @@ manifest { includeConfig 'conf/modules.config' // Load modules config for pipeline specific modes -if (params.mode == 'alphafold2') { +if (params.mode.toLowerCase().split(",").contains("alphafold2")) { includeConfig 'conf/modules_alphafold2.config' -} else if (params.mode == 'colabfold') { +} +if (params.mode.toLowerCase().split(",").contains("colabfold")) { includeConfig 'conf/modules_colabfold.config' -} else if (params.mode == 'esmfold') { +} +if (params.mode.toLowerCase().split(",").contains("esmfold")) { includeConfig 'conf/modules_esmfold.config' } diff --git a/nextflow_schema.json b/nextflow_schema.json index df0bbfe3..2d3ce68e 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -32,8 +32,7 @@ "mode": { "type": "string", "default": "alphafold2", - "description": "Specifies the mode in which the pipeline will be run", - "enum": ["alphafold2", "colabfold", "esmfold"], + "description": "Specifies the mode in which the pipeline will be run. mode can be any combination of ['alphafold2', 'colabfold', 'esmfold'] separated by a comma (',') with no spaces.", "fa_icon": "fas fa-cogs" }, "use_gpu": { diff --git a/tower.yml b/tower.yml index 787aedfe..7fc70c10 100644 --- a/tower.yml +++ b/tower.yml @@ -1,5 +1,9 @@ reports: - multiqc_report.html: - display: "MultiQC HTML report" + esmfold_multiqc_report.html: + display: "ESMFOLD MultiQC HTML report" + alphafold2_multiqc_report.html: + display: "ALPHAFOLD2 MultiQC HTML report" + colabfold_multiqc_report.html: + display: "COLABFOLD MultiQC HTML report" samplesheet.csv: display: "Auto-created samplesheet with collated metadata and FASTQ paths" From 78ba2883c9120deb7925aaa4dcbf8933b3610339 Mon Sep 17 00:00:00 2001 From: Ziad Al Bkhetan Date: Sat, 21 Sep 2024 13:33:05 +1000 Subject: [PATCH 2/9] accepting mutltiple models --- conf/modules_esmfold.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/modules_esmfold.config b/conf/modules_esmfold.config index 5b3113b8..d8356924 100644 --- a/conf/modules_esmfold.config +++ b/conf/modules_esmfold.config @@ -14,7 +14,7 @@ process { withName: 'RUN_ESMFOLD' { ext.args = {params.use_gpu ? '' : '--cpu-only'} publishDir = [ - path: { "${params.outdir}/colabfold" }, + path: { "${params.outdir}/esmfold" }, mode: 'copy', saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, pattern: '*.*' From e7b4f06079680105b573a5b23abdd89837a1cbd6 Mon Sep 17 00:00:00 2001 From: Ziad Al Bkhetan Date: Sat, 21 Sep 2024 13:56:00 +1000 Subject: [PATCH 3/9] update usage --- docs/usage.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index be725651..55120275 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -37,7 +37,9 @@ An [example samplesheet](../assets/samplesheet.csv) has been provided with the p ## Running the pipeline -The typical commands for running the pipeline on AlphaFold2, Colabfold and ESMFold modes are shown below. +The typical commands for running the pipeline on AlphaFold2, Colabfold and ESMFold modes are shown below. + +> You can run any combination of the models by providing them to the `--mode` parameter separated by a comma. For example: `--mode alphafold2,esmfold,colabfold` will run the three models in parallel. AlphaFold2 regular can be run using this command: From 0bb9d9d378170b4b0c60e210d6bd8934d431e6c6 Mon Sep 17 00:00:00 2001 From: Ziad Al Bkhetan Date: Sat, 21 Sep 2024 14:08:02 +1000 Subject: [PATCH 4/9] update docs - usage and output --- docs/output.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/output.md b/docs/output.md index 29d2337c..9b9a8fb8 100644 --- a/docs/output.md +++ b/docs/output.md @@ -183,9 +183,9 @@ Below you can find an indicative example of the TSV file with the pLDDT scores p Output files - `multiqc` - - multiqc_report.html: A standalone HTML file that can be viewed in your web browser. - - multiqc_data/: Directory containing parsed statistics from the different tools used in the pipeline. - - multiqc_plots/: Directory containing static images from the report in various formats. + - `_multiqc_report.html`: A standalone HTML file that can be viewed in your web browser. + - `_multiqc_data/`: Directory containing parsed statistics from the different tools used in the pipeline. + - `_multiqc_plots/`: Directory containing static images from the report in various formats. From 080c16f8aed9c5fdd5585a4d04d9a2203a481877 Mon Sep 17 00:00:00 2001 From: Ziad Al Bkhetan Date: Sat, 21 Sep 2024 14:14:27 +1000 Subject: [PATCH 5/9] update change log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f2d420..9ba92e3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [[PR #175](https://github.com/nf-core/proteinfold/pull/175)] - Fix typo in some instances of model preset `alphafold2_ptm`. +- [[PR #178](https://github.com/nf-core/proteinfold/pull/178)] - Enable running multiple modes in parallel. + ## [[1.1.1](https://github.com/nf-core/proteinfold/releases/tag/1.1.1)] - 2025-07-30 ### Enhancements & fixes From fbe52036cc47894c57e8c0f877d2e37fe980e826 Mon Sep 17 00:00:00 2001 From: Ziad Al Bkhetan Date: Sat, 21 Sep 2024 14:30:16 +1000 Subject: [PATCH 6/9] lint minor fixes --- main.nf | 4 ++-- nextflow.config | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.nf b/main.nf index cdc63d84..6d762db1 100644 --- a/main.nf +++ b/main.nf @@ -20,11 +20,11 @@ nextflow.enable.dsl = 2 if (params.mode.toLowerCase().split(",").contains("alphafold2")) { include { PREPARE_ALPHAFOLD2_DBS } from './subworkflows/local/prepare_alphafold2_dbs' include { ALPHAFOLD2 } from './workflows/alphafold2' -} +} if (params.mode.toLowerCase().split(",").contains("colabfold")) { include { PREPARE_COLABFOLD_DBS } from './subworkflows/local/prepare_colabfold_dbs' include { COLABFOLD } from './workflows/colabfold' -} +} if (params.mode.toLowerCase().split(",").contains("esmfold")) { include { PREPARE_ESMFOLD_DBS } from './subworkflows/local/prepare_esmfold_dbs' include { ESMFOLD } from './workflows/esmfold' diff --git a/nextflow.config b/nextflow.config index 3f7428dd..2bc5ca0a 100644 --- a/nextflow.config +++ b/nextflow.config @@ -332,10 +332,10 @@ includeConfig 'conf/modules.config' // Load modules config for pipeline specific modes if (params.mode.toLowerCase().split(",").contains("alphafold2")) { includeConfig 'conf/modules_alphafold2.config' -} +} if (params.mode.toLowerCase().split(",").contains("colabfold")) { includeConfig 'conf/modules_colabfold.config' -} +} if (params.mode.toLowerCase().split(",").contains("esmfold")) { includeConfig 'conf/modules_esmfold.config' } From dc3bf4fe90cdebf47a09b8de703c93f1acfce78f Mon Sep 17 00:00:00 2001 From: Ziad Al Bkhetan Date: Sat, 21 Sep 2024 14:44:39 +1000 Subject: [PATCH 7/9] lint fixes --- docs/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index 55120275..ecf813ce 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -37,7 +37,7 @@ An [example samplesheet](../assets/samplesheet.csv) has been provided with the p ## Running the pipeline -The typical commands for running the pipeline on AlphaFold2, Colabfold and ESMFold modes are shown below. +The typical commands for running the pipeline on AlphaFold2, Colabfold and ESMFold modes are shown below. > You can run any combination of the models by providing them to the `--mode` parameter separated by a comma. For example: `--mode alphafold2,esmfold,colabfold` will run the three models in parallel. From 2ae16a3ff93fe3f4dbf3149182274eefd74e7628 Mon Sep 17 00:00:00 2001 From: Ziad Al-Bkhetan Date: Thu, 26 Sep 2024 17:34:10 +1000 Subject: [PATCH 8/9] Update CHANGELOG.md Co-authored-by: Jose Espinosa-Carrasco --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ba92e3b..85ada4e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhancements & fixes - [[PR #175](https://github.com/nf-core/proteinfold/pull/175)] - Fix typo in some instances of model preset `alphafold2_ptm`. - - [[PR #178](https://github.com/nf-core/proteinfold/pull/178)] - Enable running multiple modes in parallel. ## [[1.1.1](https://github.com/nf-core/proteinfold/releases/tag/1.1.1)] - 2025-07-30 From 73a75e25e7a9f845a8c06b2c0427248ee37340ae Mon Sep 17 00:00:00 2001 From: Ziad Al-Bkhetan Date: Thu, 26 Sep 2024 17:34:18 +1000 Subject: [PATCH 9/9] Update CHANGELOG.md Co-authored-by: Jose Espinosa-Carrasco --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ada4e4..44cd1bd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhancements & fixes -- [[PR #175](https://github.com/nf-core/proteinfold/pull/175)] - Fix typo in some instances of model preset `alphafold2_ptm`. +- [[#177](https://github.com/nf-core/proteinfold/issues/177)]- Fix typo in some instances of model preset `alphafold2_ptm`. - [[PR #178](https://github.com/nf-core/proteinfold/pull/178)] - Enable running multiple modes in parallel. ## [[1.1.1](https://github.com/nf-core/proteinfold/releases/tag/1.1.1)] - 2025-07-30