Skip to content

Commit fc363bb

Browse files
authored
Merge pull request #604 from MaLLLiYA/isobaric_workflow
add IsobaricWorkflow to TMT workflow
2 parents c482ab1 + e7d22b1 commit fc363bb

5 files changed

Lines changed: 130 additions & 26 deletions

File tree

conf/modules/modules.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ process {
6464
}
6565

6666
// Result tables from multiple pipelines including LFQ, TMT, DIA, DDA
67-
withName: '.*:PROTEOMICSLFQ|PROTEIN_QUANTIFIER|MSSTATS_CONVERTER|FINAL_QUANTIFICATION|CONVERT_RESULTS' {
67+
withName: '.*:PROTEOMICSLFQ|PROTEIN_QUANTIFIER|MSSTATS_CONVERTER|FINAL_QUANTIFICATION|CONVERT_RESULTS|ISOBARIC_WORKFLOW' {
6868
publishDir = [
6969
path: { "${params.outdir}/quant_tables" },
7070
mode: 'copy',
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
process ISOBARIC_WORKFLOW {
2+
tag "${expdes.baseName}"
3+
label 'process_high'
4+
label 'openms'
5+
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'oras://ghcr.io/bigbio/openms-tools-thirdparty-sif:2025.04.14' :
8+
'ghcr.io/bigbio/openms-tools-thirdparty:2025.04.14' }"
9+
10+
input:
11+
path(mzmls)
12+
path(id_files)
13+
path(expdes)
14+
15+
output:
16+
path "${expdes.baseName}_openms.mzTab", emit: out_mztab
17+
path "${expdes.baseName}_openms.consensusXML", emit: out_consensusXML
18+
path "*.log", emit: log
19+
path "versions.yml", emit: versions
20+
21+
script:
22+
def args = task.ext.args ?: ''
23+
def extractBaseName = { filename ->
24+
def name = filename.toString()
25+
name = name.replaceAll(/\.mzML$/, '')
26+
27+
if (name.endsWith('.idXML')) {
28+
name = name.replaceAll(/\.idXML$/, '')
29+
name = name.replaceAll(/_(comet|msgf|sage|consensus)(_perc)?(_filter)?(_fdr)?$/, '')
30+
}
31+
return name
32+
}
33+
34+
def mzml_sorted = mzmls.collect().sort{ a, b ->
35+
extractBaseName(a.name) <=> extractBaseName(b.name)
36+
}
37+
def id_sorted = id_files.collect().sort{ a, b ->
38+
extractBaseName(a.name) <=> extractBaseName(b.name)
39+
}
40+
41+
"""
42+
IsobaricWorkflow \\
43+
-threads ${task.cpus} \\
44+
-in ${mzml_sorted.join(' ')} \\
45+
-in_id ${id_sorted.join(' ')} \\
46+
-exp_design ${expdes} \\
47+
-type ${params.type} \\
48+
-inference_method ${params.protein_inference_method} \\
49+
-protein_quantification ${params.protein_quant} \\
50+
-psmFDR ${params.psm_level_fdr_cutoff} \\
51+
-proteinFDR ${params.protein_level_fdr_cutoff} \\
52+
-picked_fdr ${params.picked_fdr} \\
53+
-picked_decoy_string ${params.decoy_string} \\
54+
-out ${expdes.baseName}_openms.consensusXML \\
55+
-out_mzTab ${expdes.baseName}_openms.mzTab \\
56+
$args \\
57+
2>&1 | tee isobaricworkflow.log
58+
59+
cat <<-END_VERSIONS > versions.yml
60+
"${task.process}":
61+
IsobaricWorkflow: \$(IsobaricWorkflow 2>&1 | grep -E '^Version(.*)' | sed 's/Version: //g' | cut -d ' ' -f 1)
62+
END_VERSIONS
63+
"""
64+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: isobaric_workflow
2+
description: Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment.
3+
keywords:
4+
- OpenMS
5+
- quantification
6+
tools:
7+
- IsobaricWorkflow:
8+
description: |
9+
Extracts and normalizes isobaric labeling information from an LC-MS/MS experiment.
10+
homepage: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html
11+
documentation: https://abibuilder.cs.uni-tuebingen.de/archive/openms/Documentation/release/latest/html/TOPP_IsobaricWorkflow.html
12+
- mzmls:
13+
type: file
14+
description: Input Spectra in mzML format
15+
pattern: "*.mzML"
16+
- id_files:
17+
type: file
18+
description: Identifications in idXML or mzIdentML format with posterior error probabilities as score type.
19+
pattern: "*.idXML"
20+
- expdes:
21+
type: file
22+
description: An experimental design file
23+
pattern: "*.tsv"
24+
output:
25+
- out_mztab:
26+
type: file
27+
description: mzTab file with analysis results
28+
pattern: "*.mzTab"
29+
- out_consensusXML:
30+
type: file
31+
description: ConsensusXML file for visualization and further processing in OpenMS.
32+
pattern: "*.consensusXML"
33+
- log:
34+
type: file
35+
description: log file
36+
pattern: "*.log"
37+
- version:
38+
type: file
39+
description: File containing software version
40+
pattern: "versions.yml"
41+
authors:
42+
- "@MaLLLiYA"

nextflow.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ params {
178178
add_triqler_output = false
179179
quantify_decoys = false
180180

181+
// IsobaricWorkflow flags
182+
type = 'itraq4plex'
183+
181184
// ProteomicsLFQ MBR parameters
182185
targeted_only = true // If false MBR will be applied for quantification of all proteins
183186
feature_with_id_min_score = 0.10

workflows/tmt.nf

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
//
88
// MODULES: Local to the pipeline
99
//
10-
include { FILE_MERGE } from '../modules/local/openms/file_merge/main'
1110
include { MSSTATS_TMT } from '../modules/local/msstats/msstats_tmt/main'
11+
include { ISOBARIC_WORKFLOW } from '../modules/local/openms/isobaric_workflow/main'
12+
include { MSSTATS_CONVERTER } from '../modules/local/openms/msstats_converter/main'
1213

1314
//
1415
// SUBWORKFLOWS: Consisting of a mix of local and nf-core/modules
1516
//
16-
include { FEATURE_MAPPER } from '../subworkflows/local/feature_mapper/main'
17-
include { PROTEIN_INFERENCE } from '../subworkflows/local/protein_inference/main'
18-
include { PROTEIN_QUANT } from '../subworkflows/local/protein_quant/main'
1917
include { ID } from '../subworkflows/local/id/main'
2018

2119
/*
@@ -41,35 +39,32 @@ workflow TMT {
4139
ch_software_versions = ch_software_versions.mix(ID.out.versions)
4240

4341
//
44-
// SUBWORKFLOW: FEATUREMAPPER
42+
// SUBWORKFLOW: ISOBARIC_WORKFLOW
4543
//
46-
FEATURE_MAPPER(ch_file_preparation_results, ID.out.id_results)
47-
ch_software_versions = ch_software_versions.mix(FEATURE_MAPPER.out.versions)
44+
ch_file_preparation_results.join(ID.out.id_results)
45+
.multiMap { it ->
46+
mzmls: pmultiqc_mzmls: it[1]
47+
ids: it[2]
48+
}
49+
.set{ ch_iso_workflow }
50+
ISOBARIC_WORKFLOW(ch_iso_workflow.mzmls.collect(),
51+
ch_iso_workflow.ids.collect(),
52+
ch_expdesign
53+
)
54+
ch_software_versions = ch_software_versions.mix(ISOBARIC_WORKFLOW.out.versions)
4855

4956
//
50-
// MODULE: FILEMERGE
57+
// MODULE: MSSTATS_CONVERTER
5158
//
52-
FILE_MERGE(FEATURE_MAPPER.out.id_map.collect())
53-
ch_software_versions = ch_software_versions.mix(FILE_MERGE.out.versions)
54-
55-
//
56-
// SUBWORKFLOW: PROTEININFERENCE
57-
//
58-
PROTEIN_INFERENCE(FILE_MERGE.out.id_merge)
59-
ch_software_versions = ch_software_versions.mix(PROTEIN_INFERENCE.out.versions)
60-
61-
//
62-
// SUBWORKFLOW: PROTEINQUANT
63-
//
64-
PROTEIN_QUANT(PROTEIN_INFERENCE.out.epi_idfilter, ch_expdesign)
65-
ch_software_versions = ch_software_versions.mix(PROTEIN_QUANT.out.versions)
59+
MSSTATS_CONVERTER(ISOBARIC_WORKFLOW.out.out_consensusXML, ch_expdesign, "ISO")
60+
ch_software_versions = ch_software_versions.mix(MSSTATS_CONVERTER.out.versions)
6661

6762
//
6863
// MODULE: MSSTATSTMT
6964
//
7065
ch_msstats_out = Channel.empty()
7166
if(!params.skip_post_msstats){
72-
MSSTATS_TMT(PROTEIN_QUANT.out.msstats_csv)
67+
MSSTATS_TMT(MSSTATS_CONVERTER.out.out_msstats)
7368
ch_msstats_out = MSSTATS_TMT.out.msstats_csv
7469
ch_software_versions = ch_software_versions.mix(MSSTATS_TMT.out.versions)
7570
}
@@ -85,8 +80,8 @@ workflow TMT {
8580
emit:
8681
ch_pmultiqc_ids = ch_pmultiqc_ids
8782
ch_pmultiqc_consensus = ch_pmultiqc_consensus
88-
final_result = PROTEIN_QUANT.out.out_mztab
89-
msstats_in = PROTEIN_QUANT.out.msstats_csv
83+
final_result = ISOBARIC_WORKFLOW.out.out_mztab
84+
msstats_in = MSSTATS_CONVERTER.out.out_msstats
9085
msstats_out = ch_msstats_out
9186
versions = ch_software_versions
9287
}

0 commit comments

Comments
 (0)