Skip to content

Commit 9492801

Browse files
pinin4fjordsclaude
andcommitted
Add ThermoRawFileParser support to DIA proteomics subworkflow
Adds automatic conversion of Thermo RAW files to mzML format before analysis: - Branch input files to detect .raw extensions - Convert RAW files using ThermoRawFileParser module - Reconstruct input channel with converted mzML files - Configure THERMORAWFILEPARSER to output mzML format (--format=1) - Update meta.yml to document RAW file support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a8ddb83 commit 9492801

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

subworkflows/nf-core/dia_proteomics_analysis/main.nf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
include { QUANTMSUTILS_DIANNCFG } from '../../../modules/nf-core/quantmsutils/dianncfg/main'
88
include { QUANTMSUTILS_MZMLSTATISTICS } from '../../../modules/nf-core/quantmsutils/mzmlstatistics/main'
99
include { QUANTMSUTILS_DIANN2MZTAB } from '../../../modules/nf-core/quantmsutils/diann2mztab/main'
10+
include { THERMORAWFILEPARSER } from '../../../modules/nf-core/thermorawfileparser/main'
1011

1112
include { DIANN as DIANN_INSILICOLIBRARYGENERATION } from '../../../modules/nf-core/diann/main'
1213
include { DIANN as DIANN_PRELIMINARYANALYSIS } from '../../../modules/nf-core/diann/main'
@@ -152,6 +153,33 @@ workflow DIA_PROTEOMICS_ANALYSIS {
152153
ch_versions = Channel.empty()
153154
(random_preanalysis, random_preanalysis_n, random_preanalysis_seed) = random_preanalysis ?: [false, null, null]
154155

156+
//
157+
// MODULE: Convert RAW files to mzML if needed
158+
//
159+
ch_input
160+
.branch {
161+
raw: it[1].toString().toLowerCase().endsWith('.raw')
162+
other: true
163+
}
164+
.set { ch_input_branched }
165+
166+
THERMORAWFILEPARSER(ch_input_branched.raw.map { meta, ms_file, enzyme, fixed_mods, variable_mods, precursor_tolerance, fragment_tolerance, precursor_tolerance_unit, fragment_tolerance_unit ->
167+
[meta, ms_file]
168+
})
169+
ch_versions = ch_versions.mix(THERMORAWFILEPARSER.out.versions)
170+
171+
// Reconstruct the input channel with converted files
172+
ch_input_converted = THERMORAWFILEPARSER.out.spectra
173+
.join(ch_input_branched.raw.map { meta, ms_file, enzyme, fixed_mods, variable_mods, precursor_tolerance, fragment_tolerance, precursor_tolerance_unit, fragment_tolerance_unit ->
174+
[meta, enzyme, fixed_mods, variable_mods, precursor_tolerance, fragment_tolerance, precursor_tolerance_unit, fragment_tolerance_unit]
175+
})
176+
.map { meta, mzml, enzyme, fixed_mods, variable_mods, precursor_tolerance, fragment_tolerance, precursor_tolerance_unit, fragment_tolerance_unit ->
177+
[meta, mzml, enzyme, fixed_mods, variable_mods, precursor_tolerance, fragment_tolerance, precursor_tolerance_unit, fragment_tolerance_unit]
178+
}
179+
180+
// Combine converted and non-RAW files
181+
ch_input = ch_input_branched.other.mix(ch_input_converted)
182+
155183
//
156184
// Generate all combinations of inputs and create channel views with appropriate metadata
157185
// This multiMap creates all necessary entity combinations up-front:

subworkflows/nf-core/dia_proteomics_analysis/meta.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ components:
3636
- quantmsutils/dianncfg
3737
- quantmsutils/mzmlstatistics
3838
- quantmsutils/diann2mztab
39+
- thermorawfileparser
3940
input:
4041
- ch_input:
4142
type: channel
@@ -45,7 +46,8 @@ input:
4546
fragment_tolerance, precursor_tolerance_unit, fragment_tolerance_unit]
4647
e.g. `[[id:'sample1'], file('sample1.mzML'), 'Trypsin', 'Carbamidomethyl (C)',
4748
'Oxidation (M)', 10, 20, 'ppm', 'ppm']`
48-
pattern: "*.{mzML,mzml}"
49+
Supports mzML and Thermo RAW files. RAW files are automatically converted to mzML using ThermoRawFileParser.
50+
pattern: "*.{mzML,mzml,raw,RAW}"
4951
- ch_searchdb:
5052
type: channel
5153
description: |

subworkflows/nf-core/dia_proteomics_analysis/nextflow.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212

1313
process {
1414

15+
// THERMORAWFILEPARSER - Convert RAW files to mzML
16+
withName: 'THERMORAWFILEPARSER' {
17+
ext.args = '--format=1' // Output format 1 = mzML
18+
}
19+
1520
// QUANTMSUTILS_GENERATECFG - Configuration generation
1621
withName: 'QUANTMSUTILS_DIANNCFG' {
1722
ext.args = ''

subworkflows/nf-core/dia_proteomics_analysis/tests/main.nf.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ nextflow_process {
1212
tag "quantmsutils/dianncfg"
1313
tag "quantmsutils/mzmlstatistics"
1414
tag "quantmsutils/diann2mztab"
15+
tag "thermorawfileparser"
1516
tag "proteomics"
1617
tag "dia_proteomics_analysis"
1718
tag "untar"

0 commit comments

Comments
 (0)