From 2fd0d5e8a40f9d3b6ab195a624e4b8d03c760ec0 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Mon, 4 Nov 2024 12:44:10 +0100 Subject: [PATCH 01/30] Refactor modules structure --- .../{colabfold_batch.nf => colabfold_batch/main.nf} | 0 modules/local/combine_uniprot/environment.yml | 8 ++++++++ .../{combine_uniprot.nf => combine_uniprot/main.nf} | 2 +- modules/local/compare_structures/environment.yml | 9 +++++++++ .../main.nf} | 6 +++--- modules/local/download_pdbmmcif/environment.yml | 7 +++++++ .../{download_pdbmmcif.nf => download_pdbmmcif/main.nf} | 8 ++++---- modules/local/generate_report/environment.yml | 9 +++++++++ .../{generate_report.nf => generate_report/main.nf} | 6 +++--- .../main.nf} | 0 modules/local/multifasta_to_csv/environment.yml | 7 +++++++ .../{multifasta_to_csv.nf => multifasta_to_csv/main.nf} | 2 +- modules/local/multifasta_to_singlefasta/environment.yml | 8 ++++++++ .../main.nf} | 0 .../local/{run_alphafold2.nf => run_alphafold2/main.nf} | 0 .../main.nf} | 0 .../main.nf} | 0 modules/local/{run_esmfold.nf => run_esmfold/main.nf} | 0 18 files changed, 60 insertions(+), 12 deletions(-) rename modules/local/{colabfold_batch.nf => colabfold_batch/main.nf} (100%) create mode 100644 modules/local/combine_uniprot/environment.yml rename modules/local/{combine_uniprot.nf => combine_uniprot/main.nf} (96%) create mode 100644 modules/local/compare_structures/environment.yml rename modules/local/{compare_structures.nf => compare_structures/main.nf} (80%) create mode 100644 modules/local/download_pdbmmcif/environment.yml rename modules/local/{download_pdbmmcif.nf => download_pdbmmcif/main.nf} (84%) create mode 100644 modules/local/generate_report/environment.yml rename modules/local/{generate_report.nf => generate_report/main.nf} (83%) rename modules/local/{mmseqs_colabfoldsearch.nf => mmseqs_colabfoldsearch/main.nf} (100%) create mode 100644 modules/local/multifasta_to_csv/environment.yml rename modules/local/{multifasta_to_csv.nf => multifasta_to_csv/main.nf} (96%) create mode 100644 modules/local/multifasta_to_singlefasta/environment.yml rename modules/local/{multifasta_to_singlefasta.nf => multifasta_to_singlefasta/main.nf} (100%) rename modules/local/{run_alphafold2.nf => run_alphafold2/main.nf} (100%) rename modules/local/{run_alphafold2_msa.nf => run_alphafold2_msa/main.nf} (100%) rename modules/local/{run_alphafold2_pred.nf => run_alphafold2_pred/main.nf} (100%) rename modules/local/{run_esmfold.nf => run_esmfold/main.nf} (100%) diff --git a/modules/local/colabfold_batch.nf b/modules/local/colabfold_batch/main.nf similarity index 100% rename from modules/local/colabfold_batch.nf rename to modules/local/colabfold_batch/main.nf diff --git a/modules/local/combine_uniprot/environment.yml b/modules/local/combine_uniprot/environment.yml new file mode 100644 index 00000000..ba4697d0 --- /dev/null +++ b/modules/local/combine_uniprot/environment.yml @@ -0,0 +1,8 @@ +name: combine_uniprot +channels: + - conda-forge + - bioconda +dependencies: + - conda-forge::grep=3.11 + - conda-forge::sed=4.8 + - conda-forge::tar=1.34 \ No newline at end of file diff --git a/modules/local/combine_uniprot.nf b/modules/local/combine_uniprot/main.nf similarity index 96% rename from modules/local/combine_uniprot.nf rename to modules/local/combine_uniprot/main.nf index 7f4637b3..e295476d 100644 --- a/modules/local/combine_uniprot.nf +++ b/modules/local/combine_uniprot/main.nf @@ -1,7 +1,7 @@ process COMBINE_UNIPROT { label 'process_single' - conda "conda-forge::sed=4.7" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : 'nf-core/ubuntu:20.04' }" diff --git a/modules/local/compare_structures/environment.yml b/modules/local/compare_structures/environment.yml new file mode 100644 index 00000000..6cce8226 --- /dev/null +++ b/modules/local/compare_structures/environment.yml @@ -0,0 +1,9 @@ +name: compare_structures +channels: +- conda-forge +- bioconda +dependencies: +- conda-forge::biopython=1.84 +- conda-forge::matplotlib=3.9.2 +- conda-forge::pip=24.2 +- conda-forge::plotly=5.24.1 diff --git a/modules/local/compare_structures.nf b/modules/local/compare_structures/main.nf similarity index 80% rename from modules/local/compare_structures.nf rename to modules/local/compare_structures/main.nf index 756d2525..f2b1b590 100644 --- a/modules/local/compare_structures.nf +++ b/modules/local/compare_structures/main.nf @@ -2,10 +2,10 @@ process COMPARE_STRUCTURES { tag "$meta.id" label 'process_single' - conda "bioconda::multiqc:1.21" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'oras://community.wave.seqera.io/library/pip_biopython_matplotlib_plotly:e865101a15ad0014' : - 'community.wave.seqera.io/library/pip_biopython_matplotlib_plotly:4d51afeb4bb75495' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/24/241f0746484727a3633f544c3747bfb77932e1c8c252e769640bd163232d9112/data' : + 'community.wave.seqera.io/library/biopython_matplotlib_pip_plotly:35975fa0fc54b2d3' }" input: tuple val(meta), path(pdb) diff --git a/modules/local/download_pdbmmcif/environment.yml b/modules/local/download_pdbmmcif/environment.yml new file mode 100644 index 00000000..760a631e --- /dev/null +++ b/modules/local/download_pdbmmcif/environment.yml @@ -0,0 +1,7 @@ +name: download_pdbmmcif +channels: +- conda-forge +- bioconda +dependencies: +- conda-forge::aria2=1.36.0 +- conda-forge::rsync=3.3.0 \ No newline at end of file diff --git a/modules/local/download_pdbmmcif.nf b/modules/local/download_pdbmmcif/main.nf similarity index 84% rename from modules/local/download_pdbmmcif.nf rename to modules/local/download_pdbmmcif/main.nf index 98ef831e..df289391 100644 --- a/modules/local/download_pdbmmcif.nf +++ b/modules/local/download_pdbmmcif/main.nf @@ -6,11 +6,11 @@ process DOWNLOAD_PDBMMCIF { label 'process_low' label 'error_retry' - conda "bioconda::aria2=1.36.0 conda-forge::rsync=3.2.7" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-4a7c46784ad871c48746744c6b8dbc5d0a97b9ca:33e61a87922824f8afcecf88a7717a2d4cb514e9-0' : - 'biocontainers/mulled-v2-4a7c46784ad871c48746744c6b8dbc5d0a97b9ca:33e61a87922824f8afcecf88a7717a2d4cb514e9-0' }" - + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3c/3c2e1079a0721851248bd2aa45f3d4cd32bfdb7395d609132567d772150965cc/data' : + 'community.wave.seqera.io/library/aria2_rsync:1627a7e9b559cfa0' }" + input: val source_url_pdb_mmcif val source_url_pdb_obsolete diff --git a/modules/local/generate_report/environment.yml b/modules/local/generate_report/environment.yml new file mode 100644 index 00000000..5ae9f601 --- /dev/null +++ b/modules/local/generate_report/environment.yml @@ -0,0 +1,9 @@ +name: generate_report +channels: +- conda-forge +- bioconda +dependencies: +- conda-forge::biopython=1.84 +- conda-forge::matplotlib=3.9.2 +- conda-forge::pip=24.2 +- conda-forge::plotly=5.24.1 diff --git a/modules/local/generate_report.nf b/modules/local/generate_report/main.nf similarity index 83% rename from modules/local/generate_report.nf rename to modules/local/generate_report/main.nf index 3bfdc04e..7a644ec8 100644 --- a/modules/local/generate_report.nf +++ b/modules/local/generate_report/main.nf @@ -2,10 +2,10 @@ process GENERATE_REPORT { tag "$meta.id-$meta.model" label 'process_single' - conda "bioconda::multiqc:1.21" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'oras://community.wave.seqera.io/library/pip_biopython_matplotlib_plotly:e865101a15ad0014' : - 'community.wave.seqera.io/library/pip_biopython_matplotlib_plotly:4d51afeb4bb75495' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/24/241f0746484727a3633f544c3747bfb77932e1c8c252e769640bd163232d9112/data' : + 'community.wave.seqera.io/library/biopython_matplotlib_pip_plotly:35975fa0fc54b2d3' }" input: tuple val(meta), path(pdb) diff --git a/modules/local/mmseqs_colabfoldsearch.nf b/modules/local/mmseqs_colabfoldsearch/main.nf similarity index 100% rename from modules/local/mmseqs_colabfoldsearch.nf rename to modules/local/mmseqs_colabfoldsearch/main.nf diff --git a/modules/local/multifasta_to_csv/environment.yml b/modules/local/multifasta_to_csv/environment.yml new file mode 100644 index 00000000..244151a8 --- /dev/null +++ b/modules/local/multifasta_to_csv/environment.yml @@ -0,0 +1,7 @@ +name: multifasta_to_csv + - conda-forge + - bioconda +dependencies: + - conda-forge::grep=3.11 + - conda-forge::sed=4.8 + - conda-forge::tar=1.34 \ No newline at end of file diff --git a/modules/local/multifasta_to_csv.nf b/modules/local/multifasta_to_csv/main.nf similarity index 96% rename from modules/local/multifasta_to_csv.nf rename to modules/local/multifasta_to_csv/main.nf index d5d68fbf..5a737f78 100644 --- a/modules/local/multifasta_to_csv.nf +++ b/modules/local/multifasta_to_csv/main.nf @@ -2,7 +2,7 @@ process MULTIFASTA_TO_CSV { tag "$meta.id" label 'process_single' - conda "conda-forge::sed=4.7" + conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : 'nf-core/ubuntu:20.04' }" diff --git a/modules/local/multifasta_to_singlefasta/environment.yml b/modules/local/multifasta_to_singlefasta/environment.yml new file mode 100644 index 00000000..c133cc0f --- /dev/null +++ b/modules/local/multifasta_to_singlefasta/environment.yml @@ -0,0 +1,8 @@ +name: multifasta_to_singlefasta +channels: + - conda-forge + - bioconda +dependencies: + - conda-forge::grep=3.11 + - conda-forge::sed=4.8 + - conda-forge::tar=1.34 \ No newline at end of file diff --git a/modules/local/multifasta_to_singlefasta.nf b/modules/local/multifasta_to_singlefasta/main.nf similarity index 100% rename from modules/local/multifasta_to_singlefasta.nf rename to modules/local/multifasta_to_singlefasta/main.nf diff --git a/modules/local/run_alphafold2.nf b/modules/local/run_alphafold2/main.nf similarity index 100% rename from modules/local/run_alphafold2.nf rename to modules/local/run_alphafold2/main.nf diff --git a/modules/local/run_alphafold2_msa.nf b/modules/local/run_alphafold2_msa/main.nf similarity index 100% rename from modules/local/run_alphafold2_msa.nf rename to modules/local/run_alphafold2_msa/main.nf diff --git a/modules/local/run_alphafold2_pred.nf b/modules/local/run_alphafold2_pred/main.nf similarity index 100% rename from modules/local/run_alphafold2_pred.nf rename to modules/local/run_alphafold2_pred/main.nf diff --git a/modules/local/run_esmfold.nf b/modules/local/run_esmfold/main.nf similarity index 100% rename from modules/local/run_esmfold.nf rename to modules/local/run_esmfold/main.nf From e85ae5121338fe5a849e976b25d779240266903d Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Mon, 4 Nov 2024 12:44:18 +0100 Subject: [PATCH 02/30] Delete view --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index edb73940..7ef18682 100644 --- a/main.nf +++ b/main.nf @@ -231,7 +231,7 @@ workflow NFCORE_PROTEINFOLD { 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(), From 329b06b3206680be62aab6ca9c4a76ab3f8d4b48 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Mon, 4 Nov 2024 16:19:46 +0100 Subject: [PATCH 03/30] Change naming to top_ranked_pdb and other formatting issues --- modules/local/colabfold_batch/main.nf | 10 +++++----- modules/local/run_alphafold2/main.nf | 2 +- modules/local/run_alphafold2_msa/main.nf | 2 +- modules/local/run_alphafold2_pred/main.nf | 8 ++++---- modules/local/run_esmfold/main.nf | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/local/colabfold_batch/main.nf b/modules/local/colabfold_batch/main.nf index 8710f9eb..4a54dde1 100644 --- a/modules/local/colabfold_batch/main.nf +++ b/modules/local/colabfold_batch/main.nf @@ -18,11 +18,11 @@ process COLABFOLD_BATCH { val numRec output: - tuple val(meta), path ("${meta.id}_colabfold.pdb"), emit: main_pdb - tuple val(meta), path ("*_relaxed_rank_*.pdb"), emit: pdb - tuple val(meta), path ("*_coverage.png") , emit: msa - tuple val(meta), path ("*_mqc.png") , emit: multiqc - path "versions.yml" , emit: versions + tuple val(meta), path ("${meta.id}_colabfold.pdb"), emit: top_ranked_pdb + tuple val(meta), path ("*_relaxed_rank_*.pdb") , emit: pdb + tuple val(meta), path ("*_coverage.png") , emit: msa + tuple val(meta), path ("*_mqc.png") , emit: multiqc + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/local/run_alphafold2/main.nf b/modules/local/run_alphafold2/main.nf index f41636a9..6ebd3c1d 100644 --- a/modules/local/run_alphafold2/main.nf +++ b/modules/local/run_alphafold2/main.nf @@ -29,7 +29,7 @@ process RUN_ALPHAFOLD2 { output: path ("${fasta.baseName}*") - tuple val(meta), path ("${meta.id}_alphafold2.pdb"), emit: main_pdb + tuple val(meta), path ("${meta.id}_alphafold2.pdb") , emit: top_ranked_pdb tuple val(meta), path ("${fasta.baseName}/ranked*pdb"), emit: pdb tuple val(meta), path ("${fasta.baseName}/*_msa.tsv") , emit: msa tuple val(meta), path ("*_mqc.tsv") , emit: multiqc diff --git a/modules/local/run_alphafold2_msa/main.nf b/modules/local/run_alphafold2_msa/main.nf index a4f00676..7428eb7f 100644 --- a/modules/local/run_alphafold2_msa/main.nf +++ b/modules/local/run_alphafold2_msa/main.nf @@ -30,7 +30,7 @@ process RUN_ALPHAFOLD2_MSA { output: path ("${fasta.baseName}*") tuple val(meta), path ("${fasta.baseName}.features.pkl"), emit: features - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/local/run_alphafold2_pred/main.nf b/modules/local/run_alphafold2_pred/main.nf index d5e1b9b5..13fb15a7 100644 --- a/modules/local/run_alphafold2_pred/main.nf +++ b/modules/local/run_alphafold2_pred/main.nf @@ -30,11 +30,11 @@ process RUN_ALPHAFOLD2_PRED { output: path ("${fasta.baseName}*") - tuple val(meta), path ("${meta.id}_alphafold2.pdb"), emit: main_pdb + tuple val(meta), path ("${meta.id}_alphafold2.pdb") , emit: top_ranked_pdb tuple val(meta), path ("${fasta.baseName}/ranked*pdb"), emit: pdb - tuple val(meta), path ("*_msa.tsv"), emit: msa - tuple val(meta), path ("*_mqc.tsv"), emit: multiqc - path "versions.yml", emit: versions + tuple val(meta), path ("*_msa.tsv") , emit: msa + tuple val(meta), path ("*_mqc.tsv") , emit: multiqc + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/local/run_esmfold/main.nf b/modules/local/run_esmfold/main.nf index 83397be1..9f0478f1 100644 --- a/modules/local/run_esmfold/main.nf +++ b/modules/local/run_esmfold/main.nf @@ -16,7 +16,7 @@ process RUN_ESMFOLD { output: tuple val(meta), path ("${meta.id}_esmfold.pdb") , emit: pdb tuple val(meta), path ("${meta.id}_plddt_mqc.tsv"), emit: multiqc - path "versions.yml", emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when From c16d03e531202a0d19db838c3813687a3596cfc2 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Mon, 4 Nov 2024 16:20:12 +0100 Subject: [PATCH 04/30] Unify multiqc_report processing --- workflows/alphafold2.nf | 55 +++++++++++++++++++++++++++-------------- workflows/colabfold.nf | 22 +++++++++++------ workflows/esmfold.nf | 12 +++++++-- 3 files changed, 61 insertions(+), 28 deletions(-) diff --git a/workflows/alphafold2.nf b/workflows/alphafold2.nf index 63b6e081..8d7081ee 100644 --- a/workflows/alphafold2.nf +++ b/workflows/alphafold2.nf @@ -43,11 +43,11 @@ workflow ALPHAFOLD2 { ch_uniprot // channel: path(uniprot) main: - ch_multiqc_files = Channel.empty() - ch_pdb = Channel.empty() - ch_main_pdb = Channel.empty() - ch_msa = Channel.empty() - ch_multiqc_rep = Channel.empty() + ch_multiqc_files = Channel.empty() + ch_pdb = Channel.empty() + ch_top_ranked_pdb = Channel.empty() + ch_msa = Channel.empty() + ch_multiqc_report = Channel.empty() if (alphafold2_model_preset != 'multimer') { ch_samplesheet @@ -78,11 +78,19 @@ workflow ALPHAFOLD2 { ch_pdb_seqres, ch_uniprot ) - 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]}.toSortedList().map{[["model":"alphafold2"], it]} - ch_versions = ch_versions.mix(RUN_ALPHAFOLD2.out.versions) + + RUN_ALPHAFOLD2 + .out + .multiqc + .map { it[1] } + .toSortedList() + .map { [ [ "model": "alphafold2" ], it ] } + .set { ch_multiqc_report } + + ch_pdb = ch_pdb.mix(RUN_ALPHAFOLD2.out.pdb) + ch_top_ranked_pdb = ch_top_ranked_pdb.mix(RUN_ALPHAFOLD2.out.top_ranked_pdb) + ch_msa = ch_msa.mix(RUN_ALPHAFOLD2.out.msa) + ch_versions = ch_versions.mix(RUN_ALPHAFOLD2.out.versions) } else if (alphafold2_mode == 'split_msa_prediction') { // @@ -121,18 +129,27 @@ workflow ALPHAFOLD2 { ch_uniprot, RUN_ALPHAFOLD2_MSA.out.features ) - 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]}.toSortedList().map{[["model":"alphafold2"], it]} - ch_versions = ch_versions.mix(RUN_ALPHAFOLD2_PRED.out.versions) + + // ch_multiqc_rep = + RUN_ALPHAFOLD2_PRED + .out + .multiqc + .map { it[1] } + .toSortedList() + .map { [ [ "model": "alphafold2" ], it ] } + .set { ch_multiqc_report } + + ch_pdb = ch_pdb.mix(RUN_ALPHAFOLD2_PRED.out.pdb) + ch_top_ranked_pdb = ch_top_ranked_pdb.mix(RUN_ALPHAFOLD2_PRED.out.top_ranked_pdb) + ch_msa = ch_msa.mix(RUN_ALPHAFOLD2_PRED.out.msa) + ch_versions = ch_versions.mix(RUN_ALPHAFOLD2_PRED.out.versions) } 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_rep // channel: /path/to/multiqc_report.html + top_ranked_pdb = ch_top_ranked_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 versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/workflows/colabfold.nf b/workflows/colabfold.nf index c7875cb1..4a40d816 100644 --- a/workflows/colabfold.nf +++ b/workflows/colabfold.nf @@ -35,7 +35,7 @@ workflow COLABFOLD { num_recycles // int: Number of recycles for esmfold main: - ch_multiqc_files = Channel.empty() + ch_multiqc_report = Channel.empty() if (params.colabfold_server == 'webserver') { // @@ -104,15 +104,23 @@ workflow COLABFOLD { ch_uniref30, num_recycles ) - ch_versions = ch_versions.mix(COLABFOLD_BATCH.out.versions) + ch_versions = ch_versions.mix(COLABFOLD_BATCH.out.versions) } + + COLABFOLD_BATCH + .out + .multiqc + .map { it[1] } + .toSortedList() + .map { [ [ "model":"colabfold"], it ] } + .set { ch_multiqc_report } 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 = 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) ] + top_ranked_pdb = COLABFOLD_BATCH.out.top_ranked_pdb // channel: /path/to/*.pdb + pdb = COLABFOLD_BATCH.out.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 + versions = ch_versions // channel: [ path(versions.yml) ] } /* diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index 57aaa04e..c1e6002b 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -56,9 +56,17 @@ workflow ESMFOLD { ch_versions = ch_versions.mix(RUN_ESMFOLD.out.versions) } + RUN_ESMFOLD + .out + .multiqc + .map { it[1] } + .toSortedList() + .map { [ [ "model": "esmfold"], it ] } + .set { ch_multiqc_report } + emit: - pdb = RUN_ESMFOLD.out.pdb // channel: /path/to/*pdb - multiqc_report = RUN_ESMFOLD.out.multiqc.map{it[1]}.toSortedList().map{[["model":"esmfold"], it]} // channel: /path/to/multiqc_report.html + pdb = RUN_ESMFOLD.out.pdb // channel: /path/to/*pdb + multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } From dd195bb3f18f7296234e18a0965018b55e989e82 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 5 Nov 2024 21:47:00 +0100 Subject: [PATCH 05/30] Simplify main and refactor the other subworkflows accordingly --- main.nf | 156 +++++++++++++++++--------- subworkflows/local/post_processing.nf | 89 +++++++++------ workflows/alphafold2.nf | 17 ++- workflows/colabfold.nf | 29 ++++- workflows/esmfold.nf | 23 +++- 5 files changed, 216 insertions(+), 98 deletions(-) diff --git a/main.nf b/main.nf index 7ef18682..4477b3d1 100644 --- a/main.nf +++ b/main.nf @@ -52,21 +52,26 @@ params.colabfold_alphafold2_params_path = getColabfoldAlphafold2ParamsPath() // // WORKFLOW: Run main analysis pipeline // -workflow NFCORE_PROTEINFOLD { +ch_dummy_file = Channel.fromPath("$projectDir/assets/NO_FILE") + +workflow NFCORE_PROTEINFOLD { + take: samplesheet // channel: samplesheet read in from --input main: ch_samplesheet = samplesheet + ch_alphafold_top_ranked_pdb = Channel.empty() + ch_colabfold_top_ranked_pdb = Channel.empty() + ch_esmfold_top_ranked_pdb = Channel.empty() 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(",") + requested_modes_size = requested_modes.size() + // // WORKFLOW: Run alphafold2 // @@ -122,16 +127,21 @@ workflow NFCORE_PROTEINFOLD { PREPARE_ALPHAFOLD2_DBS.out.pdb_seqres, PREPARE_ALPHAFOLD2_DBS.out.uniprot ) - 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} + ch_alphafold_top_ranked_pdb = ALPHAFOLD2.out.top_ranked_pdb + 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_msa) + // ALPHAFOLD2 + // .out + // .pdb + // .join(ALPHAFOLD2.out.msa) + // .map { it[0]["model"] = "alphafold2"; it } + // ) + // ALPHAFOLD2 + // .out + // .top_ranked_pdb + // .map { [ it[0]["id"], it[0], it[1] ] } + // .set { ch_alphafold2_out } } // @@ -166,23 +176,25 @@ workflow NFCORE_PROTEINFOLD { PREPARE_COLABFOLD_DBS.out.uniref30, params.num_recycles_colabfold ) - 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 - .out - .pdb - .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} + + ch_colabfold_top_ranked_pdb = COLABFOLD.out.top_ranked_pdb + 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.out.pdb_msa) + // COLABFOLD + // .out + // .pdb + // .join(COLABFOLD.out.msa) + // .map { it[0]["model"] = "colabfold"; it } + // ) + // COLABFOLD + // .out + // .top_ranked_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} } // @@ -208,49 +220,81 @@ workflow NFCORE_PROTEINFOLD { ch_samplesheet, ch_versions, PREPARE_ESMFOLD_DBS.out.params, - params.num_recycles_esmfold - ) - 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} + params.num_recycles_esmfold, + ch_dummy_file ) - ch_report_input.filter{it[0]["model"] == "esmfold"} - .map{[it[0]["id"], it[0], it[1], it[2]]} - .set{ch_esmfold_out} + + ch_esmfold_top_ranked_pdb = ESMFOLD2.out.top_ranked_pdb + 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_msa) + // ESMFOLD + // .out + // .pdb + // .combine(ch_dummy_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 + // POST PROCESSING: generate visualisation reports // + // TODO: we need to validate the rest of foldseek parameters if foldseek is set to run + // TODO: maybe create a parameter that is run_foldseek or skip_foldsee instead as there are no more mode than can be use now + + // TODO move it to pdb.config? asign as in prepare dbs if (params.foldseek_search == "easysearch"){ - ch_foldseek_db = channel.value([["id": params.foldseek_db], - file(params.foldseek_db_path, - checkIfExists: true)]) + ch_foldseek_db = channel.value([ + [ + id: params.foldseek_db, + ], + file(params.foldseek_db_path, checkIfExists: true) + ]) } - 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_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true).first() + ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config ).first() : Channel.empty() + ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo ).first() : 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) + //tendria que incluir la funcion aqui! + // quizá todo tendría que ir a post_processing incluido lo de arriba! + // ch_multiqc_methods_description = Channel.value( + // methodsDescriptionText( + // params.multiqc_methods_description + // ? file(params.multiqc_methods_description) + // : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) + // ) + // ).collectFile(name: 'methods_description_mqc.yaml') + + ch_report_template = Channel.value(file("$projectDir/assets/report_template.html", checkIfExists: true)) + ch_comparison_template = Channel.value(file("$projectDir/assets/comparison_template.html", checkIfExists: true)) POST_PROCESSING( params.skip_visualisation, - requested_modes.size(), + 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(), + ch_report_template, + ch_comparison_template, 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 + ch_multiqc_config, + ch_multiqc_custom_config, + ch_multiqc_logo, + ch_multiqc_methods_description, + ch_alphafold_top_ranked_pdb, + ch_colabfold_top_ranked_pdb, + ch_esmfold_top_ranked_pdb ) emit: diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 631644d7..20e5ed0a 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -1,5 +1,5 @@ // -// Post processing analysis for the predected structures +// Post processing analysis for the predicted structures // // @@ -22,7 +22,7 @@ workflow POST_PROCESSING { skip_visualisation requested_modes_size ch_report_input - ch_proteinfold_template + ch_report_template ch_comparison_template foldseek_search ch_foldseek_db @@ -33,46 +33,54 @@ workflow POST_PROCESSING { ch_multiqc_config ch_multiqc_custom_config ch_multiqc_logo - ch_multiqc_custom_methods_description - ch_alphafold2_out - ch_esmfold_out - ch_colabfold_out + ch_multiqc_methods_description + ch_alphafold2_top_ranked_pdb + ch_colabfold_top_ranked_pdb + ch_esmfold_top_ranked_pdb main: - ch_comparision_report_files = Channel.empty() + ch_comparison_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_report_input.map { [it[0], it[1]] }, + ch_report_input.map { [it[0], it[2]] }, + ch_report_input.map { it[0].model }, + ch_report_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 + ch_comparison_report_files = ch_comparison_report_files.mix(ch_alphafold2_top_ranked_pdb .join(GENERATE_REPORT.out.sequence_coverage - .filter{it[0]["model"] == "alphafold2"} - .map{[it[0]["id"], it[1]]}, remainder:true + .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_comparison_report_files = ch_comparison_report_files.mix( + ch_colabfold_top_ranked_pdb ) - ch_comparision_report_files = ch_comparision_report_files.mix( - ch_esmfold_out + ch_comparison_report_files = ch_comparison_report_files.mix( + ch_esmfold_top_ranked_pdb ) - //ch_comparision_report_files.view() - ch_comparision_report_files + + ch_comparison_report_files .groupTuple(by: [0], size: requested_modes_size) - .set{ch_comparision_report_input} + .set { ch_comparison_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_report_input + .map { + it[1][0]["models"] = params.mode.toLowerCase(); + [ it[1][0], it[2] ] + }, + ch_comparison_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) @@ -84,9 +92,9 @@ workflow POST_PROCESSING { ch_report_input .map{ if (it[0].model == "esmfold") - [it[0], it[1]] + [ it[0], it[1] ] else - [it[0], it[1][0]] + [ it[0], it[1][0] ] }, ch_foldseek_db ) @@ -98,33 +106,46 @@ workflow POST_PROCESSING { 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 // + ch_multiqc_report = Channel.empty() + 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_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_methods_description)) + // 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_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_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 + versions = ch_versions multiqc_report = ch_multiqc_report } diff --git a/workflows/alphafold2.nf b/workflows/alphafold2.nf index 8d7081ee..82e30d1b 100644 --- a/workflows/alphafold2.nf +++ b/workflows/alphafold2.nf @@ -130,7 +130,6 @@ workflow ALPHAFOLD2 { RUN_ALPHAFOLD2_MSA.out.features ) - // ch_multiqc_rep = RUN_ALPHAFOLD2_PRED .out .multiqc @@ -139,16 +138,26 @@ workflow ALPHAFOLD2 { .map { [ [ "model": "alphafold2" ], it ] } .set { ch_multiqc_report } - ch_pdb = ch_pdb.mix(RUN_ALPHAFOLD2_PRED.out.pdb) ch_top_ranked_pdb = ch_top_ranked_pdb.mix(RUN_ALPHAFOLD2_PRED.out.top_ranked_pdb) + ch_pdb = ch_pdb.mix(RUN_ALPHAFOLD2_PRED.out.pdb) ch_msa = ch_msa.mix(RUN_ALPHAFOLD2_PRED.out.msa) ch_versions = ch_versions.mix(RUN_ALPHAFOLD2_PRED.out.versions) } + ch_top_ranked_pdb + .map { [ it[0]["id"], it[0], it[1] ] } // TODO think of passing just the map and not the id alone + .set { ch_top_ranked_pdb } + + ch_pdb + .join(ch_msa) + .map { it[0]["model"] = "alphafold2"; it } + .set { ch_pdb_msa } + emit: top_ranked_pdb = ch_top_ranked_pdb // channel: /path/to/*.pdb - pdb = ch_pdb // channel: /path/to/*.pdb - msa = ch_msa // channel: /path/to/*msa.tsv + // pdb = ch_pdb // channel: /path/to/*.pdb + // msa = ch_msa // channel: /path/to/*msa.tsv + pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, /path/to/*_coverage.png ] multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/workflows/colabfold.nf b/workflows/colabfold.nf index 4a40d816..e375deec 100644 --- a/workflows/colabfold.nf +++ b/workflows/colabfold.nf @@ -107,6 +107,28 @@ workflow COLABFOLD { ch_versions = ch_versions.mix(COLABFOLD_BATCH.out.versions) } + COLABFOLD_BATCH + .out + .top_ranked_pdb + .map { [ it[0]["id"], it[0], it[1] ] } + .join( + COLABFOLD_BATCH.out.msa + .map { [ it[0]["id"], it[1] ] }, + remainder:true + ) + .set { ch_top_ranked_pdb } + + COLABFOLD_BATCH + .out + .pdb + .join(COLABFOLD_BATCH.out.msa) + //.view (assign instead meta, pdb, msa) + .map { + it[0]["model"] = "colabfold" + it + } + .set { ch_pdb_msa } + COLABFOLD_BATCH .out .multiqc @@ -116,9 +138,10 @@ workflow COLABFOLD { .set { ch_multiqc_report } emit: - top_ranked_pdb = COLABFOLD_BATCH.out.top_ranked_pdb // channel: /path/to/*.pdb - pdb = COLABFOLD_BATCH.out.pdb // channel: /path/to/*.pdb - msa = COLABFOLD_BATCH.out.msa // channel: /path/to/*_coverage.png + top_ranked_pdb = ch_top_ranked_pdb // channel: /path/to/*.pdb + // pdb = COLABFOLD_BATCH.out.pdb // channel: /path/to/*.pdb + // msa = COLABFOLD_BATCH.out.msa // channel: /path/to/*_coverage.png + pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, /path/to/*_coverage.png ] multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index c1e6002b..ef8376a4 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -29,6 +29,7 @@ workflow ESMFOLD { ch_versions // channel: [ path(versions.yml) ] ch_esmfold_params // directory: /path/to/esmfold/params/ ch_num_recycles // int: Number of recycles for esmfold + ch_dummy_file // channel: [ path(NO_FILE) ] main: ch_multiqc_files = Channel.empty() @@ -55,6 +56,10 @@ workflow ESMFOLD { ) ch_versions = ch_versions.mix(RUN_ESMFOLD.out.versions) } + + ch_report_input.filter{it[0]["model"] == "esmfold"} + .map{[it[0]["id"], it[0], it[1], it[2]]} + .set{ch_esmfold_out} RUN_ESMFOLD .out @@ -64,8 +69,24 @@ workflow ESMFOLD { .map { [ [ "model": "esmfold"], it ] } .set { ch_multiqc_report } + RUN_ESMFOLD + .out + .pdb + .combine(ch_dummy_file) + .map { + it[0]["model"] = "esmfold" + it + } + .set { ch_pdb_msa } + + ch_pdb_msa + .map { [ it[0]["id"], it[0], it[1], it[2] ] } //TODO do we need all of them (structure different to the other modes) + .set { ch_top_ranked_pdb } + emit: - pdb = RUN_ESMFOLD.out.pdb // channel: /path/to/*pdb + pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, dummy_file ] + top_ranked_pdb = ch_top_ranked_pdb // channel: //TODO update structure + // pdb = RUN_ESMFOLD.out.pdb // channel: /path/to/*pdb multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } From ba472fe723514352c0472f7e3ee81cb760d3463a Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 5 Nov 2024 21:47:19 +0100 Subject: [PATCH 06/30] Change report naming --- assets/{proteinfold_template.html => report_template.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename assets/{proteinfold_template.html => report_template.html} (100%) diff --git a/assets/proteinfold_template.html b/assets/report_template.html similarity index 100% rename from assets/proteinfold_template.html rename to assets/report_template.html From 315802962e23db181918e5441409ed283527fa2f Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 5 Nov 2024 21:47:37 +0100 Subject: [PATCH 07/30] Align emits --- modules/local/generate_report/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/local/generate_report/main.nf b/modules/local/generate_report/main.nf index 7a644ec8..8ab8fc5d 100644 --- a/modules/local/generate_report/main.nf +++ b/modules/local/generate_report/main.nf @@ -14,10 +14,10 @@ process GENERATE_REPORT { path(template) output: - tuple val(meta), path ("*report.html"), emit: report + tuple val(meta), path ("*report.html") , emit: report tuple val(meta), path ("*seq_coverage.png"), optional: true, emit: sequence_coverage - tuple val(meta), path ("*_LDDT.html"), emit: plddt - path "versions.yml" , emit: versions + tuple val(meta), path ("*_LDDT.html") , emit: plddt + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when From 3744a447a74af36b671478b640eedfdfbd205188 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 5 Nov 2024 21:58:36 +0100 Subject: [PATCH 08/30] Get rid of params in subworkflow --- subworkflows/local/post_processing.nf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 20e5ed0a..66b14829 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -20,6 +20,7 @@ workflow POST_PROCESSING { take: skip_visualisation + requested_modes requested_modes_size ch_report_input ch_report_template @@ -73,12 +74,12 @@ workflow POST_PROCESSING { COMPARE_STRUCTURES( ch_comparison_report_input .map { - it[1][0]["models"] = params.mode.toLowerCase(); + it[1][0]["models"] = requested_modes.toLowerCase(); [ it[1][0], it[2] ] }, ch_comparison_report_input .map{ - it[1][0]["models"] = params.mode.toLowerCase(); + it[1][0]["models"] = requested_modes.mode.toLowerCase(); [ it[1][0], it[3] ] }, ch_comparison_template From 647039f975db3b309a912278265d7f41e9f5bbb7 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Tue, 5 Nov 2024 22:07:32 +0100 Subject: [PATCH 09/30] Add uncommited file --- main.nf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.nf b/main.nf index 4477b3d1..b2fa263c 100644 --- a/main.nf +++ b/main.nf @@ -278,6 +278,7 @@ workflow NFCORE_PROTEINFOLD { POST_PROCESSING( params.skip_visualisation, + requested_modes, requested_modes_size, ch_report_input, ch_report_template, From 20068d8ff54dad4a20283eca9f3ac4f1c5dea710 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 6 Nov 2024 12:27:10 +0100 Subject: [PATCH 10/30] Generate channel for top ranked pdbs for esmfold --- workflows/esmfold.nf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index ef8376a4..bad6f4ae 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -60,6 +60,16 @@ workflow ESMFOLD { ch_report_input.filter{it[0]["model"] == "esmfold"} .map{[it[0]["id"], it[0], it[1], it[2]]} .set{ch_esmfold_out} + + RUN_ESMFOLD + .out + .pdb + .combine(Channel.fromPath("$projectDir/assets/NO_FILE")) + .map { + it[0]["model"] = "esmfold"; + [ it[0]["id"], it[0], it[1], it[2] ] + } + .set { ch_top_ranked_pdb } RUN_ESMFOLD .out From 62b9263876c037745372966db30ac981bcbf9f25 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 6 Nov 2024 12:36:38 +0100 Subject: [PATCH 11/30] Fix typo --- main.nf | 2 +- workflows/esmfold.nf | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/main.nf b/main.nf index b2fa263c..64d9c6a9 100644 --- a/main.nf +++ b/main.nf @@ -224,7 +224,7 @@ workflow NFCORE_PROTEINFOLD { ch_dummy_file ) - ch_esmfold_top_ranked_pdb = ESMFOLD2.out.top_ranked_pdb + ch_esmfold_top_ranked_pdb = ESMFOLD.out.top_ranked_pdb 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_msa) diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index bad6f4ae..e478bccd 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -57,10 +57,9 @@ workflow ESMFOLD { ch_versions = ch_versions.mix(RUN_ESMFOLD.out.versions) } - ch_report_input.filter{it[0]["model"] == "esmfold"} - .map{[it[0]["id"], it[0], it[1], it[2]]} - .set{ch_esmfold_out} - + // ch_report_input.filter{it[0]["model"] == "esmfold"} + // .map{[it[0]["id"], it[0], it[1], it[2]]} + // .set{ch_esmfold_out} RUN_ESMFOLD .out .pdb From 4e501f79ca8daaf42ae70221d06f331961bd94f6 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 8 Nov 2024 11:45:53 +0100 Subject: [PATCH 12/30] Add view() --- subworkflows/local/post_processing.nf | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 66b14829..4cce5c89 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -91,12 +91,12 @@ workflow POST_PROCESSING { 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] ] - }, + .map{ + if (it[0].model == "esmfold") + [ it[0], it[1] ] + else + [ it[0], it[1][0] ] + }, ch_foldseek_db ) } @@ -124,7 +124,16 @@ workflow POST_PROCESSING { 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_rep.view() + ch_multiqc_files.view() + ch_multiqc_rep + .combine( + ch_multiqc_files + .collect() + .map { [it] } + ) + .map { [ it[0], it[1] + it[2] ] } + .view() MULTIQC ( ch_multiqc_rep .combine( From fb360d692a24283bc8a25c6f3aceb9e094e21e92 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 8 Nov 2024 12:11:52 +0100 Subject: [PATCH 13/30] Update --- subworkflows/local/post_processing.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 4cce5c89..9060b10d 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -124,7 +124,7 @@ workflow POST_PROCESSING { 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_rep.view() + // ch_multiqc_rep.view() ch_multiqc_files.view() ch_multiqc_rep .combine( From 870f78057f095f5c6775b8269fcb2bdd45fac1f0 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 8 Nov 2024 12:19:55 +0100 Subject: [PATCH 14/30] Test --- subworkflows/local/post_processing.nf | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 9060b10d..76b4adf0 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -124,16 +124,18 @@ workflow POST_PROCESSING { 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_rep.view() - ch_multiqc_files.view() - ch_multiqc_rep - .combine( - ch_multiqc_files - .collect() - .map { [it] } - ) - .map { [ it[0], it[1] + it[2] ] } - .view() + ch_multiqc_rep.view() + // ch_multiqc_files.view() + // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/25/b25d4bdd0d7147786e18b422a8fc36/methods_description_mqc.yaml + // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/7d/0852a1333d2c3137523ac45c8b781a/workflow_summary_mqc.yaml + // ch_multiqc_rep + // .combine( + // ch_multiqc_files + // .collect() + // .map { [it] } + // ) + // .map { [ it[0], it[1] + it[2] ] } + // .view() MULTIQC ( ch_multiqc_rep .combine( From 171385a8f9e2c150ef950b1d8df4223ca63d62b0 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 8 Nov 2024 15:02:01 +0100 Subject: [PATCH 15/30] add flatten --- subworkflows/local/post_processing.nf | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 76b4adf0..384e2f18 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -124,7 +124,20 @@ workflow POST_PROCESSING { 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_rep.view() + + ch_test = ch_multiqc_rep + .combine( + ch_multiqc_files + .collect() + .map { [it] } + ) + .map { [ it[0], it[1] + it[2] ] } + ch_test.view() + + // ch_multiqc_rep.view() + // [[model:colabfold], + // [[/nfs/scratch02/cn/jespinosa/colabfold_batch/25/c494f54f03f707e3582987b4f0ec45/T1024_LmrP____408_residues__coverage_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/25/c494f54f03f707e3582987b4f0ec45/T1024_LmrP____408_residues__pae_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/25/c494f54f03f707e3582987b4f0ec45/T1024_LmrP____408_residues__plddt_mqc.png], [/nfs/scratch02/cn/jespinosa/colabfold_batch/aa/b464e7512e77e2880acb6c55c83107/T1026_FBNSV____172_residues__coverage_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/aa/b464e7512e77e2880acb6c55c83107/T1026_FBNSV____172_residues__pae_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/aa/b464e7512e77e2880acb6c55c83107/T1026_FBNSV____172_residues__plddt_mqc.png]]] + // ch_multiqc_files.view() // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/25/b25d4bdd0d7147786e18b422a8fc36/methods_description_mqc.yaml // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/7d/0852a1333d2c3137523ac45c8b781a/workflow_summary_mqc.yaml @@ -142,6 +155,7 @@ workflow POST_PROCESSING { ch_multiqc_files .collect() .map { [it] } + .flatten() ) .map { [ it[0], it[1] + it[2] ] }, ch_multiqc_config, From a057a102c5947f7cab49cb56d7e4534761311719 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 8 Nov 2024 17:15:24 +0100 Subject: [PATCH 16/30] Update --- subworkflows/local/post_processing.nf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 384e2f18..519d0b03 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -132,7 +132,7 @@ workflow POST_PROCESSING { .map { [it] } ) .map { [ it[0], it[1] + it[2] ] } - ch_test.view() + ch_test.view() // ch_multiqc_rep.view() // [[model:colabfold], @@ -141,23 +141,23 @@ workflow POST_PROCESSING { // ch_multiqc_files.view() // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/25/b25d4bdd0d7147786e18b422a8fc36/methods_description_mqc.yaml // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/7d/0852a1333d2c3137523ac45c8b781a/workflow_summary_mqc.yaml - // ch_multiqc_rep - // .combine( - // ch_multiqc_files - // .collect() - // .map { [it] } - // ) - // .map { [ it[0], it[1] + it[2] ] } - // .view() + ch_multiqc_rep + .combine( + ch_multiqc_files + .collect() + .map { [it] } + ) + .map { [ it[1] + it[2] + it[3] ] } + .view() + MULTIQC ( ch_multiqc_rep .combine( ch_multiqc_files .collect() .map { [it] } - .flatten() ) - .map { [ it[0], it[1] + it[2] ] }, + .map { [ it[1] + it[2] + it[3] ] }, ch_multiqc_config, ch_multiqc_custom_config .collect() From b3acd962f38720b982f6b21c7fbdaee80255f968 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 8 Nov 2024 17:40:24 +0100 Subject: [PATCH 17/30] Update channel --- subworkflows/local/post_processing.nf | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 519d0b03..487e239b 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -141,23 +141,18 @@ workflow POST_PROCESSING { // ch_multiqc_files.view() // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/25/b25d4bdd0d7147786e18b422a8fc36/methods_description_mqc.yaml // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/7d/0852a1333d2c3137523ac45c8b781a/workflow_summary_mqc.yaml - ch_multiqc_rep + ch_test = ch_multiqc_rep .combine( ch_multiqc_files .collect() .map { [it] } ) .map { [ it[1] + it[2] + it[3] ] } - .view() + + ch_test.view() MULTIQC ( - ch_multiqc_rep - .combine( - ch_multiqc_files - .collect() - .map { [it] } - ) - .map { [ it[1] + it[2] + it[3] ] }, + ch_test, ch_multiqc_config, ch_multiqc_custom_config .collect() From 1ec50e82c63391eab714d78cc93bf6c676fc6c26 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Fri, 8 Nov 2024 18:12:39 +0100 Subject: [PATCH 18/30] Update --- subworkflows/local/post_processing.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 487e239b..34dad951 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -147,7 +147,7 @@ workflow POST_PROCESSING { .collect() .map { [it] } ) - .map { [ it[1] + it[2] + it[3] ] } + .map { [ it[1] + it[2] ] } ch_test.view() From c1d7faa96079144e8a02e304cf3a69aa5fc42293 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Mon, 11 Nov 2024 10:42:50 +0100 Subject: [PATCH 19/30] Reshape channel --- subworkflows/local/post_processing.nf | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 34dad951..a5e1df85 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -142,13 +142,17 @@ workflow POST_PROCESSING { // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/25/b25d4bdd0d7147786e18b422a8fc36/methods_description_mqc.yaml // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/7d/0852a1333d2c3137523ac45c8b781a/workflow_summary_mqc.yaml ch_test = ch_multiqc_rep - .combine( - ch_multiqc_files + .map { + [ it[0], it[1] ] + } .collect() - .map { [it] } - ) - .map { [ it[1] + it[2] ] } - + .combine( + ch_multiqc_files + .collect() + .map { [it] } + ) + .map { [ it[1] + it[2] + it[3] ] } + ch_test.view() MULTIQC ( From 50c317273ad6e4ee7aa669d88436f027c13c0973 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Mon, 11 Nov 2024 11:33:56 +0100 Subject: [PATCH 20/30] Add view --- subworkflows/local/post_processing.nf | 24 ++++++++++++------------ workflows/colabfold.nf | 12 ++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index a5e1df85..76530e4b 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -141,19 +141,19 @@ workflow POST_PROCESSING { // ch_multiqc_files.view() // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/25/b25d4bdd0d7147786e18b422a8fc36/methods_description_mqc.yaml // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/7d/0852a1333d2c3137523ac45c8b781a/workflow_summary_mqc.yaml - ch_test = ch_multiqc_rep - .map { - [ it[0], it[1] ] - } - .collect() - .combine( - ch_multiqc_files - .collect() - .map { [it] } - ) - .map { [ it[1] + it[2] + it[3] ] } + // ch_test = ch_multiqc_rep + // // .map { + // // [ it[0], it[1] ] + // // } + // // .collect() + // .combine( + // ch_multiqc_files + // .collect() + // .map { [it] } + // ) + // .map { [ it[1] + it[2] + it[3] ] } - ch_test.view() + // ch_test.view() MULTIQC ( ch_test, diff --git a/workflows/colabfold.nf b/workflows/colabfold.nf index e375deec..6570e910 100644 --- a/workflows/colabfold.nf +++ b/workflows/colabfold.nf @@ -136,6 +136,18 @@ workflow COLABFOLD { .toSortedList() .map { [ [ "model":"colabfold"], it ] } .set { ch_multiqc_report } + + COLABFOLD_BATCH + .out + .multiqc + .view() + + ch_multiqc_report.view() + COLABFOLD_BATCH + .out + .multiqc + .collect() + .view() emit: top_ranked_pdb = ch_top_ranked_pdb // channel: /path/to/*.pdb From ae8d68e47f0936796d7cbaf37bc630c3b1b6bd0e Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Mon, 11 Nov 2024 12:05:58 +0100 Subject: [PATCH 21/30] Add flatten --- workflows/alphafold2.nf | 4 ++-- workflows/colabfold.nf | 6 +++--- workflows/esmfold.nf | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/workflows/alphafold2.nf b/workflows/alphafold2.nf index 82e30d1b..bd683322 100644 --- a/workflows/alphafold2.nf +++ b/workflows/alphafold2.nf @@ -84,7 +84,7 @@ workflow ALPHAFOLD2 { .multiqc .map { it[1] } .toSortedList() - .map { [ [ "model": "alphafold2" ], it ] } + .map { [ [ "model": "alphafold2" ], it.flatten() ] } .set { ch_multiqc_report } ch_pdb = ch_pdb.mix(RUN_ALPHAFOLD2.out.pdb) @@ -135,7 +135,7 @@ workflow ALPHAFOLD2 { .multiqc .map { it[1] } .toSortedList() - .map { [ [ "model": "alphafold2" ], it ] } + .map { [ [ "model": "alphafold2" ], it.flatten() ] } .set { ch_multiqc_report } ch_top_ranked_pdb = ch_top_ranked_pdb.mix(RUN_ALPHAFOLD2_PRED.out.top_ranked_pdb) diff --git a/workflows/colabfold.nf b/workflows/colabfold.nf index 6570e910..20b28076 100644 --- a/workflows/colabfold.nf +++ b/workflows/colabfold.nf @@ -122,7 +122,7 @@ workflow COLABFOLD { .out .pdb .join(COLABFOLD_BATCH.out.msa) - //.view (assign instead meta, pdb, msa) + //.view (assign instead meta, pdb, msa named in map instead of just it) .map { it[0]["model"] = "colabfold" it @@ -134,14 +134,14 @@ workflow COLABFOLD { .multiqc .map { it[1] } .toSortedList() - .map { [ [ "model":"colabfold"], it ] } + .map { [ [ "model":"colabfold"], it.flatten() ] } .set { ch_multiqc_report } COLABFOLD_BATCH .out .multiqc .view() - + ch_multiqc_report.view() COLABFOLD_BATCH .out diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index e478bccd..fb16ad09 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -75,7 +75,7 @@ workflow ESMFOLD { .multiqc .map { it[1] } .toSortedList() - .map { [ [ "model": "esmfold"], it ] } + .map { [ [ "model": "esmfold"], it.flatten() ] } .set { ch_multiqc_report } RUN_ESMFOLD From dd47a3d503fe785532cd53edf6ca3f532a02687c Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 13 Nov 2024 14:49:40 +0100 Subject: [PATCH 22/30] Add view --- subworkflows/local/post_processing.nf | 43 +++++++-------------------- 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 76530e4b..e292cabe 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -70,16 +70,17 @@ workflow POST_PROCESSING { ch_comparison_report_files .groupTuple(by: [0], size: requested_modes_size) .set { ch_comparison_report_input } + requested_modes.view() COMPARE_STRUCTURES( ch_comparison_report_input .map { - it[1][0]["models"] = requested_modes.toLowerCase(); + it[1][0]["models"] = requested_modes.toString().toLowerCase(); [ it[1][0], it[2] ] }, ch_comparison_report_input .map{ - it[1][0]["models"] = requested_modes.mode.toLowerCase(); + it[1][0]["models"] = requested_modes.mode.toString().toLowerCase(); [ it[1][0], it[3] ] }, ch_comparison_template @@ -124,39 +125,15 @@ workflow POST_PROCESSING { 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_test = ch_multiqc_rep - .combine( - ch_multiqc_files - .collect() - .map { [it] } - ) - .map { [ it[0], it[1] + it[2] ] } - ch_test.view() - - // ch_multiqc_rep.view() - // [[model:colabfold], - // [[/nfs/scratch02/cn/jespinosa/colabfold_batch/25/c494f54f03f707e3582987b4f0ec45/T1024_LmrP____408_residues__coverage_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/25/c494f54f03f707e3582987b4f0ec45/T1024_LmrP____408_residues__pae_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/25/c494f54f03f707e3582987b4f0ec45/T1024_LmrP____408_residues__plddt_mqc.png], [/nfs/scratch02/cn/jespinosa/colabfold_batch/aa/b464e7512e77e2880acb6c55c83107/T1026_FBNSV____172_residues__coverage_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/aa/b464e7512e77e2880acb6c55c83107/T1026_FBNSV____172_residues__pae_mqc.png, /nfs/scratch02/cn/jespinosa/colabfold_batch/aa/b464e7512e77e2880acb6c55c83107/T1026_FBNSV____172_residues__plddt_mqc.png]]] - - // ch_multiqc_files.view() - // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/25/b25d4bdd0d7147786e18b422a8fc36/methods_description_mqc.yaml - // /nfs/scratch02/cn/jespinosa/colabfold_batch/tmp/7d/0852a1333d2c3137523ac45c8b781a/workflow_summary_mqc.yaml - // ch_test = ch_multiqc_rep - // // .map { - // // [ it[0], it[1] ] - // // } - // // .collect() - // .combine( - // ch_multiqc_files - // .collect() - // .map { [it] } - // ) - // .map { [ it[1] + it[2] + it[3] ] } - - // ch_test.view() MULTIQC ( - ch_test, + 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() From b341f1b5874938abec6edd39f5f7672301dc3d80 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 13 Nov 2024 15:53:35 +0100 Subject: [PATCH 23/30] Fix bug --- subworkflows/local/post_processing.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index e292cabe..30ea7634 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -75,12 +75,12 @@ workflow POST_PROCESSING { COMPARE_STRUCTURES( ch_comparison_report_input .map { - it[1][0]["models"] = requested_modes.toString().toLowerCase(); + it[1][0]["models"] = requested_modes.toLowerCase(); [ it[1][0], it[2] ] }, ch_comparison_report_input .map{ - it[1][0]["models"] = requested_modes.mode.toString().toLowerCase(); + it[1][0]["models"] = requested_modes.toLowerCase(); [ it[1][0], it[3] ] }, ch_comparison_template From 40c9d1629b6a241fcda6b255987bf4636ee2a3ea Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Wed, 13 Nov 2024 16:01:47 +0100 Subject: [PATCH 24/30] Fix typo --- subworkflows/local/post_processing.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 30ea7634..a7f8c8fe 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -70,7 +70,6 @@ workflow POST_PROCESSING { ch_comparison_report_files .groupTuple(by: [0], size: requested_modes_size) .set { ch_comparison_report_input } - requested_modes.view() COMPARE_STRUCTURES( ch_comparison_report_input From 405d45de8ecfbd552c2c7aed09aa81404b1a8711 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 14 Nov 2024 10:53:38 +0100 Subject: [PATCH 25/30] Correctly pass mode to post_processing --- main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.nf b/main.nf index 64d9c6a9..f5772e7c 100644 --- a/main.nf +++ b/main.nf @@ -278,7 +278,7 @@ workflow NFCORE_PROTEINFOLD { POST_PROCESSING( params.skip_visualisation, - requested_modes, + params.mode, requested_modes_size, ch_report_input, ch_report_template, From 4be470a51f3d2c4b80ca28229f62fcb4a6919d85 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 14 Nov 2024 12:34:50 +0100 Subject: [PATCH 26/30] Clean code (views, comments, etc. out) --- main.nf | 52 ++------------------------- subworkflows/local/post_processing.nf | 4 +-- workflows/alphafold2.nf | 11 +++--- workflows/colabfold.nf | 14 +++----- workflows/esmfold.nf | 14 +++----- 5 files changed, 18 insertions(+), 77 deletions(-) diff --git a/main.nf b/main.nf index f5772e7c..2cf3d6d5 100644 --- a/main.nf +++ b/main.nf @@ -117,8 +117,8 @@ workflow NFCORE_PROTEINFOLD { params.alphafold2_mode, params.alphafold2_model_preset, PREPARE_ALPHAFOLD2_DBS.out.params, - PREPARE_ALPHAFOLD2_DBS.out.bfd.ifEmpty([]).first(), - PREPARE_ALPHAFOLD2_DBS.out.small_bfd.ifEmpty([]).first(), + PREPARE_ALPHAFOLD2_DBS.out.bfd.first().ifEmpty([]), + PREPARE_ALPHAFOLD2_DBS.out.small_bfd.first().ifEmpty([]), PREPARE_ALPHAFOLD2_DBS.out.mgnify, PREPARE_ALPHAFOLD2_DBS.out.pdb70, PREPARE_ALPHAFOLD2_DBS.out.pdb_mmcif, @@ -131,17 +131,6 @@ workflow NFCORE_PROTEINFOLD { 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_msa) - // ALPHAFOLD2 - // .out - // .pdb - // .join(ALPHAFOLD2.out.msa) - // .map { it[0]["model"] = "alphafold2"; it } - // ) - // ALPHAFOLD2 - // .out - // .top_ranked_pdb - // .map { [ it[0]["id"], it[0], it[1] ] } - // .set { ch_alphafold2_out } } // @@ -181,20 +170,6 @@ workflow NFCORE_PROTEINFOLD { 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.out.pdb_msa) - // COLABFOLD - // .out - // .pdb - // .join(COLABFOLD.out.msa) - // .map { it[0]["model"] = "colabfold"; it } - // ) - // COLABFOLD - // .out - // .top_ranked_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} } // @@ -228,19 +203,6 @@ workflow NFCORE_PROTEINFOLD { 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_msa) - // ESMFOLD - // .out - // .pdb - // .combine(ch_dummy_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} } // @@ -263,16 +225,6 @@ workflow NFCORE_PROTEINFOLD { ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config ).first() : Channel.empty() ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo ).first() : 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) - //tendria que incluir la funcion aqui! - // quizá todo tendría que ir a post_processing incluido lo de arriba! - // ch_multiqc_methods_description = Channel.value( - // methodsDescriptionText( - // params.multiqc_methods_description - // ? file(params.multiqc_methods_description) - // : file("$projectDir/assets/methods_description_template.yml", checkIfExists: true) - // ) - // ).collectFile(name: 'methods_description_mqc.yaml') - ch_report_template = Channel.value(file("$projectDir/assets/report_template.html", checkIfExists: true)) ch_comparison_template = Channel.value(file("$projectDir/assets/comparison_template.html", checkIfExists: true)) diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index a7f8c8fe..645b3008 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -117,9 +117,7 @@ workflow POST_PROCESSING { summary_params = paramsSummaryMap(workflow, parameters_schema: "nextflow_schema.json") ch_workflow_summary = Channel.value(paramsSummaryMultiqc(summary_params)) ch_methods_description = Channel.value(methodsDescriptionText(ch_multiqc_methods_description)) - // 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')) diff --git a/workflows/alphafold2.nf b/workflows/alphafold2.nf index bd683322..e6ec906d 100644 --- a/workflows/alphafold2.nf +++ b/workflows/alphafold2.nf @@ -145,18 +145,19 @@ workflow ALPHAFOLD2 { } ch_top_ranked_pdb - .map { [ it[0]["id"], it[0], it[1] ] } // TODO think of passing just the map and not the id alone + .map { [ it[0]["id"], it[0], it[1] ] } .set { ch_top_ranked_pdb } ch_pdb .join(ch_msa) - .map { it[0]["model"] = "alphafold2"; it } + .map { + it[0]["model"] = "alphafold2" + it + } .set { ch_pdb_msa } emit: - top_ranked_pdb = ch_top_ranked_pdb // channel: /path/to/*.pdb - // pdb = ch_pdb // channel: /path/to/*.pdb - // msa = ch_msa // channel: /path/to/*msa.tsv + top_ranked_pdb = ch_top_ranked_pdb // channel: [ id, /path/to/*.pdb ] pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, /path/to/*_coverage.png ] multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] diff --git a/workflows/colabfold.nf b/workflows/colabfold.nf index 20b28076..8308ee9d 100644 --- a/workflows/colabfold.nf +++ b/workflows/colabfold.nf @@ -122,7 +122,6 @@ workflow COLABFOLD { .out .pdb .join(COLABFOLD_BATCH.out.msa) - //.view (assign instead meta, pdb, msa named in map instead of just it) .map { it[0]["model"] = "colabfold" it @@ -140,22 +139,17 @@ workflow COLABFOLD { COLABFOLD_BATCH .out .multiqc - .view() - ch_multiqc_report.view() COLABFOLD_BATCH .out .multiqc .collect() - .view() emit: - top_ranked_pdb = ch_top_ranked_pdb // channel: /path/to/*.pdb - // pdb = COLABFOLD_BATCH.out.pdb // channel: /path/to/*.pdb - // msa = COLABFOLD_BATCH.out.msa // channel: /path/to/*_coverage.png - pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, /path/to/*_coverage.png ] - multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html - versions = ch_versions // channel: [ path(versions.yml) ] + top_ranked_pdb = ch_top_ranked_pdb // channel: [ id, /path/to/*.pdb ] + pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, /path/to/*_coverage.png ] + multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html + versions = ch_versions // channel: [ path(versions.yml) ] } /* diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index fb16ad09..21f635ad 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -56,16 +56,13 @@ workflow ESMFOLD { ) ch_versions = ch_versions.mix(RUN_ESMFOLD.out.versions) } - - // ch_report_input.filter{it[0]["model"] == "esmfold"} - // .map{[it[0]["id"], it[0], it[1], it[2]]} - // .set{ch_esmfold_out} + RUN_ESMFOLD .out .pdb - .combine(Channel.fromPath("$projectDir/assets/NO_FILE")) + .combine(ch_dummy_file) .map { - it[0]["model"] = "esmfold"; + it[0]["model"] = "esmfold" [ it[0]["id"], it[0], it[1], it[2] ] } .set { ch_top_ranked_pdb } @@ -89,13 +86,12 @@ workflow ESMFOLD { .set { ch_pdb_msa } ch_pdb_msa - .map { [ it[0]["id"], it[0], it[1], it[2] ] } //TODO do we need all of them (structure different to the other modes) + .map { [ it[0]["id"], it[0], it[1], it[2] ] } .set { ch_top_ranked_pdb } emit: pdb_msa = ch_pdb_msa // channel: [ meta, /path/to/*.pdb, dummy_file ] - top_ranked_pdb = ch_top_ranked_pdb // channel: //TODO update structure - // pdb = RUN_ESMFOLD.out.pdb // channel: /path/to/*pdb + top_ranked_pdb = ch_top_ranked_pdb // channel: [ id, /path/to/*.pdb ] multiqc_report = ch_multiqc_report // channel: /path/to/multiqc_report.html versions = ch_versions // channel: [ path(versions.yml) ] } From 49d60f06622e446ed9955e4520658dee74d0d5a9 Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 14 Nov 2024 12:38:39 +0100 Subject: [PATCH 27/30] Revert change (will go in different PR) --- main.nf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.nf b/main.nf index 2cf3d6d5..722829ad 100644 --- a/main.nf +++ b/main.nf @@ -117,8 +117,8 @@ workflow NFCORE_PROTEINFOLD { params.alphafold2_mode, params.alphafold2_model_preset, PREPARE_ALPHAFOLD2_DBS.out.params, - PREPARE_ALPHAFOLD2_DBS.out.bfd.first().ifEmpty([]), - PREPARE_ALPHAFOLD2_DBS.out.small_bfd.first().ifEmpty([]), + PREPARE_ALPHAFOLD2_DBS.out.bfd.ifEmpty([]).first(), + PREPARE_ALPHAFOLD2_DBS.out.small_bfd.ifEmpty([]).first(), PREPARE_ALPHAFOLD2_DBS.out.mgnify, PREPARE_ALPHAFOLD2_DBS.out.pdb70, PREPARE_ALPHAFOLD2_DBS.out.pdb_mmcif, From 5c84a2a81b0af141f135e71a4865017018b46f9b Mon Sep 17 00:00:00 2001 From: JoseEspinosa Date: Thu, 14 Nov 2024 12:50:51 +0100 Subject: [PATCH 28/30] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25051396..bdb35127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [[#179](https://github.com/nf-core/proteinfold/issues/179)]- Produce an interactive html report for the predicted structures. - [[#180](https://github.com/nf-core/proteinfold/issues/180)]- Implement Fooldseek. - [[#188](https://github.com/nf-core/proteinfold/issues/188)]- Fix colabfold image to run in gpus. +- [[PR ##205](https://github.com/nf-core/proteinfold/pull/205)] - Change input schema from `sequence,fasta` to `id,fasta`. +- [[PR #210](https://github.com/nf-core/proteinfold/pull/210)]- Moving post-processing logic to a subworkflow, change wave images pointing to oras to point to https and refactor module to match nf-core folder structure. ## [[1.1.1](https://github.com/nf-core/proteinfold/releases/tag/1.1.1)] - 2025-07-30 @@ -72,7 +74,6 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements - [[PR ##163](https://github.com/nf-core/proteinfold/pull/163)] - Fix full test CI. - [[#150]](https://github.com/nf-core/proteinfold/issues/150)] - Add thanks to the AWS Open Data Sponsorship program in `README.md`. - [[PR ##166](https://github.com/nf-core/proteinfold/pull/166)] - Create 2 different parameters for Colabfold and ESMfold number of recycles. -- [[PR ##205](https://github.com/nf-core/proteinfold/pull/205)] - Change input schema from `sequence,fasta` to `id,fasta`. ### Parameters From 654293e4205e202f48431685b1d713fedcd8f449 Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Thu, 14 Nov 2024 12:23:03 +0000 Subject: [PATCH 29/30] Making lint very happy --- modules/local/combine_uniprot/environment.yml | 2 +- modules/local/compare_structures/environment.yml | 12 ++++++------ modules/local/download_pdbmmcif/environment.yml | 8 ++++---- modules/local/generate_report/environment.yml | 12 ++++++------ modules/local/multifasta_to_csv/environment.yml | 2 +- .../local/multifasta_to_singlefasta/environment.yml | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/local/combine_uniprot/environment.yml b/modules/local/combine_uniprot/environment.yml index ba4697d0..a5702139 100644 --- a/modules/local/combine_uniprot/environment.yml +++ b/modules/local/combine_uniprot/environment.yml @@ -5,4 +5,4 @@ channels: dependencies: - conda-forge::grep=3.11 - conda-forge::sed=4.8 - - conda-forge::tar=1.34 \ No newline at end of file + - conda-forge::tar=1.34 diff --git a/modules/local/compare_structures/environment.yml b/modules/local/compare_structures/environment.yml index 6cce8226..9f657a6f 100644 --- a/modules/local/compare_structures/environment.yml +++ b/modules/local/compare_structures/environment.yml @@ -1,9 +1,9 @@ name: compare_structures channels: -- conda-forge -- bioconda + - conda-forge + - bioconda dependencies: -- conda-forge::biopython=1.84 -- conda-forge::matplotlib=3.9.2 -- conda-forge::pip=24.2 -- conda-forge::plotly=5.24.1 + - conda-forge::biopython=1.84 + - conda-forge::matplotlib=3.9.2 + - conda-forge::pip=24.2 + - conda-forge::plotly=5.24.1 diff --git a/modules/local/download_pdbmmcif/environment.yml b/modules/local/download_pdbmmcif/environment.yml index 760a631e..4a53be04 100644 --- a/modules/local/download_pdbmmcif/environment.yml +++ b/modules/local/download_pdbmmcif/environment.yml @@ -1,7 +1,7 @@ name: download_pdbmmcif channels: -- conda-forge -- bioconda + - conda-forge + - bioconda dependencies: -- conda-forge::aria2=1.36.0 -- conda-forge::rsync=3.3.0 \ No newline at end of file + - conda-forge::aria2=1.36.0 + - conda-forge::rsync=3.3.0 diff --git a/modules/local/generate_report/environment.yml b/modules/local/generate_report/environment.yml index 5ae9f601..07a5b9f1 100644 --- a/modules/local/generate_report/environment.yml +++ b/modules/local/generate_report/environment.yml @@ -1,9 +1,9 @@ name: generate_report channels: -- conda-forge -- bioconda + - conda-forge + - bioconda dependencies: -- conda-forge::biopython=1.84 -- conda-forge::matplotlib=3.9.2 -- conda-forge::pip=24.2 -- conda-forge::plotly=5.24.1 + - conda-forge::biopython=1.84 + - conda-forge::matplotlib=3.9.2 + - conda-forge::pip=24.2 + - conda-forge::plotly=5.24.1 diff --git a/modules/local/multifasta_to_csv/environment.yml b/modules/local/multifasta_to_csv/environment.yml index 244151a8..d92aa27d 100644 --- a/modules/local/multifasta_to_csv/environment.yml +++ b/modules/local/multifasta_to_csv/environment.yml @@ -4,4 +4,4 @@ name: multifasta_to_csv dependencies: - conda-forge::grep=3.11 - conda-forge::sed=4.8 - - conda-forge::tar=1.34 \ No newline at end of file + - conda-forge::tar=1.34 diff --git a/modules/local/multifasta_to_singlefasta/environment.yml b/modules/local/multifasta_to_singlefasta/environment.yml index c133cc0f..273e53dd 100644 --- a/modules/local/multifasta_to_singlefasta/environment.yml +++ b/modules/local/multifasta_to_singlefasta/environment.yml @@ -5,4 +5,4 @@ channels: dependencies: - conda-forge::grep=3.11 - conda-forge::sed=4.8 - - conda-forge::tar=1.34 \ No newline at end of file + - conda-forge::tar=1.34 From 12e35258ce0ea02532e0f7c4d6ca845b5162aa3f Mon Sep 17 00:00:00 2001 From: Jose Espinosa-Carrasco Date: Thu, 14 Nov 2024 12:52:06 +0000 Subject: [PATCH 30/30] Are you happy now? --- main.nf | 6 +++--- modules/local/download_pdbmmcif/main.nf | 2 +- subworkflows/local/post_processing.nf | 6 +++--- workflows/alphafold2.nf | 4 ++-- workflows/colabfold.nf | 14 ++++++++------ workflows/esmfold.nf | 4 ++-- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/main.nf b/main.nf index 722829ad..d1ec1a6b 100644 --- a/main.nf +++ b/main.nf @@ -56,7 +56,7 @@ params.colabfold_alphafold2_params_path = getColabfoldAlphafold2ParamsPath() ch_dummy_file = Channel.fromPath("$projectDir/assets/NO_FILE") workflow NFCORE_PROTEINFOLD { - + take: samplesheet // channel: samplesheet read in from --input @@ -210,7 +210,7 @@ workflow NFCORE_PROTEINFOLD { // // TODO: we need to validate the rest of foldseek parameters if foldseek is set to run // TODO: maybe create a parameter that is run_foldseek or skip_foldsee instead as there are no more mode than can be use now - + // TODO move it to pdb.config? asign as in prepare dbs if (params.foldseek_search == "easysearch"){ ch_foldseek_db = channel.value([ @@ -221,7 +221,7 @@ workflow NFCORE_PROTEINFOLD { ]) } - ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true).first() + ch_multiqc_config = Channel.fromPath("$projectDir/assets/multiqc_config.yml", checkIfExists: true).first() ch_multiqc_custom_config = params.multiqc_config ? Channel.fromPath( params.multiqc_config ).first() : Channel.empty() ch_multiqc_logo = params.multiqc_logo ? Channel.fromPath( params.multiqc_logo ).first() : 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) diff --git a/modules/local/download_pdbmmcif/main.nf b/modules/local/download_pdbmmcif/main.nf index df289391..a8a12963 100644 --- a/modules/local/download_pdbmmcif/main.nf +++ b/modules/local/download_pdbmmcif/main.nf @@ -10,7 +10,7 @@ process DOWNLOAD_PDBMMCIF { container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3c/3c2e1079a0721851248bd2aa45f3d4cd32bfdb7395d609132567d772150965cc/data' : 'community.wave.seqera.io/library/aria2_rsync:1627a7e9b559cfa0' }" - + input: val source_url_pdb_mmcif val source_url_pdb_obsolete diff --git a/subworkflows/local/post_processing.nf b/subworkflows/local/post_processing.nf index 645b3008..45d2f0b6 100644 --- a/subworkflows/local/post_processing.nf +++ b/subworkflows/local/post_processing.nf @@ -73,13 +73,13 @@ workflow POST_PROCESSING { COMPARE_STRUCTURES( ch_comparison_report_input - .map { - it[1][0]["models"] = requested_modes.toLowerCase(); + .map { + it[1][0]["models"] = requested_modes.toLowerCase(); [ it[1][0], it[2] ] }, ch_comparison_report_input .map{ - it[1][0]["models"] = requested_modes.toLowerCase(); + it[1][0]["models"] = requested_modes.toLowerCase(); [ it[1][0], it[3] ] }, ch_comparison_template diff --git a/workflows/alphafold2.nf b/workflows/alphafold2.nf index e6ec906d..1f5344f5 100644 --- a/workflows/alphafold2.nf +++ b/workflows/alphafold2.nf @@ -150,9 +150,9 @@ workflow ALPHAFOLD2 { ch_pdb .join(ch_msa) - .map { + .map { it[0]["model"] = "alphafold2" - it + it } .set { ch_pdb_msa } diff --git a/workflows/colabfold.nf b/workflows/colabfold.nf index 8308ee9d..adfa24b6 100644 --- a/workflows/colabfold.nf +++ b/workflows/colabfold.nf @@ -106,14 +106,16 @@ workflow COLABFOLD { ) ch_versions = ch_versions.mix(COLABFOLD_BATCH.out.versions) } - + COLABFOLD_BATCH .out .top_ranked_pdb .map { [ it[0]["id"], it[0], it[1] ] } .join( - COLABFOLD_BATCH.out.msa - .map { [ it[0]["id"], it[1] ] }, + COLABFOLD_BATCH + .out + .msa + .map { [ it[0]["id"], it[1] ] }, remainder:true ) .set { ch_top_ranked_pdb } @@ -123,8 +125,8 @@ workflow COLABFOLD { .pdb .join(COLABFOLD_BATCH.out.msa) .map { - it[0]["model"] = "colabfold" - it + it[0]["model"] = "colabfold" + it } .set { ch_pdb_msa } @@ -135,7 +137,7 @@ workflow COLABFOLD { .toSortedList() .map { [ [ "model":"colabfold"], it.flatten() ] } .set { ch_multiqc_report } - + COLABFOLD_BATCH .out .multiqc diff --git a/workflows/esmfold.nf b/workflows/esmfold.nf index 21f635ad..c93c869a 100644 --- a/workflows/esmfold.nf +++ b/workflows/esmfold.nf @@ -62,7 +62,7 @@ workflow ESMFOLD { .pdb .combine(ch_dummy_file) .map { - it[0]["model"] = "esmfold" + it[0]["model"] = "esmfold" [ it[0]["id"], it[0], it[1], it[2] ] } .set { ch_top_ranked_pdb } @@ -84,7 +84,7 @@ workflow ESMFOLD { it } .set { ch_pdb_msa } - + ch_pdb_msa .map { [ it[0]["id"], it[0], it[1], it[2] ] } .set { ch_top_ranked_pdb }