From 66080bb6a1288f78d66704a9535e6316687ce623 Mon Sep 17 00:00:00 2001 From: Ma Li <1542307217@qq.com> Date: Thu, 23 Oct 2025 14:34:43 +0800 Subject: [PATCH 1/6] add IsobaricWorkflow to TMT workflow --- .../local/openms/isobaric_workflow/main.nf | 47 +++++++++++++++++++ .../local/openms/isobaric_workflow/meta.yml | 42 +++++++++++++++++ workflows/tmt.nf | 45 ++++++++---------- 3 files changed, 109 insertions(+), 25 deletions(-) create mode 100644 modules/local/openms/isobaric_workflow/main.nf create mode 100644 modules/local/openms/isobaric_workflow/meta.yml diff --git a/modules/local/openms/isobaric_workflow/main.nf b/modules/local/openms/isobaric_workflow/main.nf new file mode 100644 index 00000000..2d57de65 --- /dev/null +++ b/modules/local/openms/isobaric_workflow/main.nf @@ -0,0 +1,47 @@ +process ISOBARIC_WORKFLOW { + tag "${expdes.baseName}" + label 'process_high' + label 'openms' + + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'oras://ghcr.io/bigbio/openms-tools-thirdparty-sif:2025.04.14' : + 'ghcr.io/bigbio/openms-tools-thirdparty:2025.04.14' }" + + input: + path(mzmls) + path(id_files) + path(expdes) + + output: + path "${expdes.baseName}_openms.mzTab", emit: out_mztab + path "${expdes.baseName}_openms.consensusXML", emit: out_consensusXML + path "*.log", emit: log + path "versions.yml", emit: versions + + script: + def args = task.ext.args ?: '' + def mzml_sorted = mzmls.collect().sort{ a, b -> a.name <=> b.name} + def id_sorted = id_files.collect().sort{ a, b -> a.name <=> b.name} + + """ + IsobaricWorkflow \\ + -threads ${task.cpus} \\ + -in ${mzml_sorted.join(' ')} \\ + -in_id ${id_sorted.join(' ')} \\ + -exp_design ${expdes} \\ + -inference_method ${params.protein_inference_method} \\ + -protein_quantification ${params.protein_quant} \\ + -psmFDR ${params.psm_level_fdr_cutoff} \\ + -proteinFDR ${params.protein_level_fdr_cutoff} \\ + -picked_fdr ${params.picked_fdr} \\ + -out ${expdes.baseName}_openms.consensusXML \\ + -out_mzTab ${expdes.baseName}_openms.mzTab \\ + $args \\ + 2>&1 | tee isobaricworkflow.log + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + IsobaricWorkflow: \$(IsobaricWorkflow 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1) + END_VERSIONS + """ +} \ No newline at end of file diff --git a/modules/local/openms/isobaric_workflow/meta.yml b/modules/local/openms/isobaric_workflow/meta.yml new file mode 100644 index 00000000..a73537c5 --- /dev/null +++ b/modules/local/openms/isobaric_workflow/meta.yml @@ -0,0 +1,42 @@ +name: isobaric_workflow +description: Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment. +keywords: + - OpenMS + - quantification +tools: + - IsobaricWorkflow: + description: | + Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment. + homepage: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html + documentation: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html + - mzmls: + type: file + description: Input Spectra in mzML format + pattern: "*.mzML" + - id_files: + type: file + description: Identifications in idXML or mzIdentML format with posterior error probabilities as score type. + pattern: "*.idXML" + - expdes: + type: file + description: An experimental design file + pattern: "*.tsv" +output: + - out_mztab: + type: file + description: mzTab file with analysis results + pattern: "*.mzTab" + - out_consensusXML: + type: file + description: ConsensusXML file for visualization and further processing in OpenMS. + pattern: "*.consensusXML" + - log: + type: file + description: log file + pattern: "*.log" + - version: + type: file + description: File containing software version + pattern: "versions.yml" +authors: + - "@MaLLLiYA" diff --git a/workflows/tmt.nf b/workflows/tmt.nf index 6ddc0631..e8b07b09 100644 --- a/workflows/tmt.nf +++ b/workflows/tmt.nf @@ -7,15 +7,13 @@ // // MODULES: Local to the pipeline // -include { FILE_MERGE } from '../modules/local/openms/file_merge/main' include { MSSTATS_TMT } from '../modules/local/msstats/msstats_tmt/main' +include { ISOBARIC_WORKFLOW } from '../modules/local/openms/isobaric_workflow/main' +include { MSSTATS_CONVERTER } from '../modules/local/openms/msstats_converter/main' // // SUBWORKFLOWS: Consisting of a mix of local and nf-core/modules // -include { FEATURE_MAPPER } from '../subworkflows/local/feature_mapper/main' -include { PROTEIN_INFERENCE } from '../subworkflows/local/protein_inference/main' -include { PROTEIN_QUANT } from '../subworkflows/local/protein_quant/main' include { ID } from '../subworkflows/local/id/main' /* @@ -41,35 +39,32 @@ workflow TMT { ch_software_versions = ch_software_versions.mix(ID.out.versions.ifEmpty(null)) // - // SUBWORKFLOW: FEATUREMAPPER + // SUBWORKFLOW: ISOBARIC_WORKFLOW // - FEATURE_MAPPER(ch_file_preparation_results, ID.out.id_results) - ch_software_versions = ch_software_versions.mix(FEATURE_MAPPER.out.versions.ifEmpty(null)) + ch_file_preparation_results.join(ID.out.id_results) + .multiMap { it -> + mzmls: pmultiqc_mzmls: it[1] + ids: it[2] + } + .set{ ch_iso_workflow } + ISOBARIC_WORKFLOW(ch_iso_workflow.mzmls.collect(), + ch_iso_workflow.ids.collect(), + ch_expdesign + ) + ch_software_versions = ch_software_versions.mix(ISOBARIC_WORKFLOW.out.versions.ifEmpty(null)) // - // MODULE: FILEMERGE + // MODULE: MSSTATS_CONVERTER // - FILE_MERGE(FEATURE_MAPPER.out.id_map.collect()) - ch_software_versions = ch_software_versions.mix(FILE_MERGE.out.versions.ifEmpty(null)) - - // - // SUBWORKFLOW: PROTEININFERENCE - // - PROTEIN_INFERENCE(FILE_MERGE.out.id_merge) - ch_software_versions = ch_software_versions.mix(PROTEIN_INFERENCE.out.versions.ifEmpty(null)) - - // - // SUBWORKFLOW: PROTEINQUANT - // - PROTEIN_QUANT(PROTEIN_INFERENCE.out.epi_idfilter, ch_expdesign) - ch_software_versions = ch_software_versions.mix(PROTEIN_QUANT.out.versions.ifEmpty(null)) + MSSTATS_CONVERTER(ISOBARIC_WORKFLOW.out.out_consensusXML, ch_expdesign, "ISO") + ch_version = ch_version.mix(MSSTATS_CONVERTER.out.versions.ifEmpty(null)) // // MODULE: MSSTATSTMT // ch_msstats_out = Channel.empty() if(!params.skip_post_msstats){ - MSSTATS_TMT(PROTEIN_QUANT.out.msstats_csv) + MSSTATS_TMT(MSSTATS_CONVERTER.out.out_msstats) ch_msstats_out = MSSTATS_TMT.out.msstats_csv ch_software_versions = ch_software_versions.mix(MSSTATS_TMT.out.versions.ifEmpty(null)) } @@ -85,8 +80,8 @@ workflow TMT { emit: ch_pmultiqc_ids = ch_pmultiqc_ids ch_pmultiqc_consensus = ch_pmultiqc_consensus - final_result = PROTEIN_QUANT.out.out_mztab - msstats_in = PROTEIN_QUANT.out.msstats_csv + final_result = ISOBARIC_WORKFLOW.out.out_mztab + msstats_in = MSSTATS_CONVERTER.out.out_msstats msstats_out = ch_msstats_out versions = ch_software_versions } From 3ec6c72c3a6bf50719c68af89ae2b21c7847963c Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Thu, 30 Oct 2025 21:43:58 +0000 Subject: [PATCH 2/6] Update workflows/tmt.nf Co-authored-by: Julianus Pfeuffer <8102638+jpfeuffer@users.noreply.github.com> --- workflows/tmt.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/tmt.nf b/workflows/tmt.nf index 8126eac3..9096ef32 100644 --- a/workflows/tmt.nf +++ b/workflows/tmt.nf @@ -57,7 +57,7 @@ workflow TMT { // MODULE: MSSTATS_CONVERTER // MSSTATS_CONVERTER(ISOBARIC_WORKFLOW.out.out_consensusXML, ch_expdesign, "ISO") - ch_version = ch_version.mix(MSSTATS_CONVERTER.out.versions.ifEmpty(null)) + ch_software_versions = ch_software_versions.mix(MSSTATS_CONVERTER.out.versions) // // MODULE: MSSTATSTMT From f369833920897d439b4a0584866d533e06825c4c Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Tue, 4 Nov 2025 07:26:22 +0000 Subject: [PATCH 3/6] Update workflows/tmt.nf Co-authored-by: Julianus Pfeuffer <8102638+jpfeuffer@users.noreply.github.com> --- workflows/tmt.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflows/tmt.nf b/workflows/tmt.nf index 9096ef32..79585575 100644 --- a/workflows/tmt.nf +++ b/workflows/tmt.nf @@ -51,7 +51,7 @@ workflow TMT { ch_iso_workflow.ids.collect(), ch_expdesign ) - ch_software_versions = ch_software_versions.mix(ISOBARIC_WORKFLOW.out.versions.ifEmpty(null)) + ch_software_versions = ch_software_versions.mix(ISOBARIC_WORKFLOW.out.versions) // // MODULE: MSSTATS_CONVERTER From 2a331018b5c2687474a3cfb681be4fa2f6334293 Mon Sep 17 00:00:00 2001 From: Ma Li <1542307217@qq.com> Date: Tue, 4 Nov 2025 15:53:16 +0800 Subject: [PATCH 4/6] pre-commit --- .../local/openms/isobaric_workflow/main.nf | 4 +- .../local/openms/isobaric_workflow/meta.yml | 84 +++++++++---------- workflows/tmt.nf | 2 +- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/modules/local/openms/isobaric_workflow/main.nf b/modules/local/openms/isobaric_workflow/main.nf index 2d57de65..20b8f76c 100644 --- a/modules/local/openms/isobaric_workflow/main.nf +++ b/modules/local/openms/isobaric_workflow/main.nf @@ -11,7 +11,7 @@ process ISOBARIC_WORKFLOW { path(mzmls) path(id_files) path(expdes) - + output: path "${expdes.baseName}_openms.mzTab", emit: out_mztab path "${expdes.baseName}_openms.consensusXML", emit: out_consensusXML @@ -44,4 +44,4 @@ process ISOBARIC_WORKFLOW { IsobaricWorkflow: \$(IsobaricWorkflow 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1) END_VERSIONS """ -} \ No newline at end of file +} diff --git a/modules/local/openms/isobaric_workflow/meta.yml b/modules/local/openms/isobaric_workflow/meta.yml index a73537c5..3400e6a4 100644 --- a/modules/local/openms/isobaric_workflow/meta.yml +++ b/modules/local/openms/isobaric_workflow/meta.yml @@ -1,42 +1,42 @@ -name: isobaric_workflow -description: Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment. -keywords: - - OpenMS - - quantification -tools: - - IsobaricWorkflow: - description: | - Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment. - homepage: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html - documentation: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html - - mzmls: - type: file - description: Input Spectra in mzML format - pattern: "*.mzML" - - id_files: - type: file - description: Identifications in idXML or mzIdentML format with posterior error probabilities as score type. - pattern: "*.idXML" - - expdes: - type: file - description: An experimental design file - pattern: "*.tsv" -output: - - out_mztab: - type: file - description: mzTab file with analysis results - pattern: "*.mzTab" - - out_consensusXML: - type: file - description: ConsensusXML file for visualization and further processing in OpenMS. - pattern: "*.consensusXML" - - log: - type: file - description: log file - pattern: "*.log" - - version: - type: file - description: File containing software version - pattern: "versions.yml" -authors: - - "@MaLLLiYA" +name: isobaric_workflow +description: Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment. +keywords: + - OpenMS + - quantification +tools: + - IsobaricWorkflow: + description: | + Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment. + homepage: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html + documentation: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html + - mzmls: + type: file + description: Input Spectra in mzML format + pattern: "*.mzML" + - id_files: + type: file + description: Identifications in idXML or mzIdentML format with posterior error probabilities as score type. + pattern: "*.idXML" + - expdes: + type: file + description: An experimental design file + pattern: "*.tsv" +output: + - out_mztab: + type: file + description: mzTab file with analysis results + pattern: "*.mzTab" + - out_consensusXML: + type: file + description: ConsensusXML file for visualization and further processing in OpenMS. + pattern: "*.consensusXML" + - log: + type: file + description: log file + pattern: "*.log" + - version: + type: file + description: File containing software version + pattern: "versions.yml" +authors: + - "@MaLLLiYA" diff --git a/workflows/tmt.nf b/workflows/tmt.nf index 79585575..d4405e4e 100644 --- a/workflows/tmt.nf +++ b/workflows/tmt.nf @@ -54,7 +54,7 @@ workflow TMT { ch_software_versions = ch_software_versions.mix(ISOBARIC_WORKFLOW.out.versions) // - // MODULE: MSSTATS_CONVERTER + // MODULE: MSSTATS_CONVERTER // MSSTATS_CONVERTER(ISOBARIC_WORKFLOW.out.out_consensusXML, ch_expdesign, "ISO") ch_software_versions = ch_software_versions.mix(MSSTATS_CONVERTER.out.versions) From d560a372a1b9c4767c6a43a3a7406311d0ee1047 Mon Sep 17 00:00:00 2001 From: Ma Li <1542307217@qq.com> Date: Thu, 18 Dec 2025 09:35:52 +0800 Subject: [PATCH 5/6] Improvement of IsobaricWorkflow --- conf/modules/modules.config | 2 +- .../local/openms/isobaric_workflow/main.nf | 23 ++++++++++++++++--- nextflow.config | 3 +++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/conf/modules/modules.config b/conf/modules/modules.config index 54265862..4657f7fb 100644 --- a/conf/modules/modules.config +++ b/conf/modules/modules.config @@ -64,7 +64,7 @@ process { } // Result tables from multiple pipelines including LFQ, TMT, DIA, DDA - withName: '.*:PROTEOMICSLFQ|PROTEIN_QUANTIFIER|MSSTATS_CONVERTER|FINAL_QUANTIFICATION|CONVERT_RESULTS' { + withName: '.*:PROTEOMICSLFQ|PROTEIN_QUANTIFIER|MSSTATS_CONVERTER|FINAL_QUANTIFICATION|CONVERT_RESULTS|ISOBARIC_WORKFLOW' { publishDir = [ path: { "${params.outdir}/quant_tables" }, mode: 'copy', diff --git a/modules/local/openms/isobaric_workflow/main.nf b/modules/local/openms/isobaric_workflow/main.nf index 20b8f76c..b4aa0e3d 100644 --- a/modules/local/openms/isobaric_workflow/main.nf +++ b/modules/local/openms/isobaric_workflow/main.nf @@ -20,8 +20,23 @@ process ISOBARIC_WORKFLOW { script: def args = task.ext.args ?: '' - def mzml_sorted = mzmls.collect().sort{ a, b -> a.name <=> b.name} - def id_sorted = id_files.collect().sort{ a, b -> a.name <=> b.name} + def extractBaseName = { filename -> + def name = filename.toString() + name = name.replaceAll(/\.mzML$/, '') + + if (name.endsWith('.idXML')) { + name = name.replaceAll(/\.idXML$/, '') + name = name.replaceAll(/_(comet|msgf|sage|consensus)(_perc)?(_filter)?(_fdr)?$/, '') + } + return name + } + + def mzml_sorted = mzmls.collect().sort{ a, b -> + extractBaseName(a.name) <=> extractBaseName(b.name) + } + def id_sorted = id_files.collect().sort{ a, b -> + extractBaseName(a.name) <=> extractBaseName(b.name) + } """ IsobaricWorkflow \\ @@ -29,11 +44,13 @@ process ISOBARIC_WORKFLOW { -in ${mzml_sorted.join(' ')} \\ -in_id ${id_sorted.join(' ')} \\ -exp_design ${expdes} \\ + -type ${params.type} \\ -inference_method ${params.protein_inference_method} \\ -protein_quantification ${params.protein_quant} \\ -psmFDR ${params.psm_level_fdr_cutoff} \\ -proteinFDR ${params.protein_level_fdr_cutoff} \\ -picked_fdr ${params.picked_fdr} \\ + -picked_decoy_string ${params.decoy_string} \\ -out ${expdes.baseName}_openms.consensusXML \\ -out_mzTab ${expdes.baseName}_openms.mzTab \\ $args \\ @@ -44,4 +61,4 @@ process ISOBARIC_WORKFLOW { IsobaricWorkflow: \$(IsobaricWorkflow 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1) END_VERSIONS """ -} +} diff --git a/nextflow.config b/nextflow.config index 25c9a963..7849ca39 100644 --- a/nextflow.config +++ b/nextflow.config @@ -178,6 +178,9 @@ params { add_triqler_output = false quantify_decoys = false + // IsobaricWorkflow flags + type = 'itraq4plex' + // ProteomicsLFQ MBR parameters targeted_only = true // If false MBR will be applied for quantification of all proteins feature_with_id_min_score = 0.10 From 881a69aea2578984c50aa1f738dad8e2c8c05974 Mon Sep 17 00:00:00 2001 From: Ma Li <1542307217@qq.com> Date: Thu, 18 Dec 2025 10:20:18 +0800 Subject: [PATCH 6/6] pre-commit --- modules/local/openms/isobaric_workflow/main.nf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/local/openms/isobaric_workflow/main.nf b/modules/local/openms/isobaric_workflow/main.nf index b4aa0e3d..3cb033b8 100644 --- a/modules/local/openms/isobaric_workflow/main.nf +++ b/modules/local/openms/isobaric_workflow/main.nf @@ -23,18 +23,18 @@ process ISOBARIC_WORKFLOW { def extractBaseName = { filename -> def name = filename.toString() name = name.replaceAll(/\.mzML$/, '') - + if (name.endsWith('.idXML')) { name = name.replaceAll(/\.idXML$/, '') name = name.replaceAll(/_(comet|msgf|sage|consensus)(_perc)?(_filter)?(_fdr)?$/, '') } return name } - - def mzml_sorted = mzmls.collect().sort{ a, b -> + + def mzml_sorted = mzmls.collect().sort{ a, b -> extractBaseName(a.name) <=> extractBaseName(b.name) } - def id_sorted = id_files.collect().sort{ a, b -> + def id_sorted = id_files.collect().sort{ a, b -> extractBaseName(a.name) <=> extractBaseName(b.name) }