diff --git a/.gitignore b/.gitignore index 114452d..10bcc4e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,4 @@ null/ .cursor/rules/codacy.mdc .codacy/ .github/instructions/codacy.instructions.md -docs/superpowers/ \ No newline at end of file +docs/superpowers/ diff --git a/docs/usage.md b/docs/usage.md index 8eb8a7d..a9b652a 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -95,49 +95,50 @@ The pipeline passes parameters to DIA-NN at different steps. Some parameters com ### Parameter sources Parameters are resolved in this priority order: + 1. **SDRF metadata** (per-file, from `convert-diann` design file) — highest priority 2. **Pipeline parameters** (`--param_name` on command line or params file) 3. **Nextflow defaults** (`nextflow.config`) — lowest priority ### Pipeline steps -| Step | Description | -|------|-------------| +| Step | Description | +| ------------------------------- | ------------------------------------------------------------------- | | **INSILICO_LIBRARY_GENERATION** | Predicts a spectral library from FASTA using DIA-NN's deep learning | -| **PRELIMINARY_ANALYSIS** | Per-file calibration and mass accuracy estimation (first pass) | -| **ASSEMBLE_EMPIRICAL_LIBRARY** | Builds consensus empirical library from preliminary results | -| **INDIVIDUAL_ANALYSIS** | Per-file quantification with the empirical library (second pass) | -| **FINAL_QUANTIFICATION** | Aggregates all files into protein/peptide matrices | +| **PRELIMINARY_ANALYSIS** | Per-file calibration and mass accuracy estimation (first pass) | +| **ASSEMBLE_EMPIRICAL_LIBRARY** | Builds consensus empirical library from preliminary results | +| **INDIVIDUAL_ANALYSIS** | Per-file quantification with the empirical library (second pass) | +| **FINAL_QUANTIFICATION** | Aggregates all files into protein/peptide matrices | ### Per-file parameters from SDRF These parameters are extracted per-file from the SDRF via `convert-diann` and stored in `diann_design.tsv`: -| DIA-NN flag | SDRF column | Design column | Steps | Notes | -|---|---|---|---|---| -| `--mass-acc-ms1` | `comment[precursor mass tolerance]` | `PrecursorMassTolerance` | PRELIMINARY, INDIVIDUAL | Falls back to auto-detect if missing or not ppm | -| `--mass-acc` | `comment[fragment mass tolerance]` | `FragmentMassTolerance` | PRELIMINARY, INDIVIDUAL | Falls back to auto-detect if missing or not ppm | -| `--min-pr-mz` | `comment[ms1 scan range]` or `comment[ms min mz]` | `MS1MinMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | -| `--max-pr-mz` | `comment[ms1 scan range]` or `comment[ms max mz]` | `MS1MaxMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | -| `--min-fr-mz` | `comment[ms2 scan range]` or `comment[ms2 min mz]` | `MS2MinMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | -| `--max-fr-mz` | `comment[ms2 scan range]` or `comment[ms2 max mz]` | `MS2MaxMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | +| DIA-NN flag | SDRF column | Design column | Steps | Notes | +| ---------------- | -------------------------------------------------- | ------------------------ | ----------------------- | ----------------------------------------------- | +| `--mass-acc-ms1` | `comment[precursor mass tolerance]` | `PrecursorMassTolerance` | PRELIMINARY, INDIVIDUAL | Falls back to auto-detect if missing or not ppm | +| `--mass-acc` | `comment[fragment mass tolerance]` | `FragmentMassTolerance` | PRELIMINARY, INDIVIDUAL | Falls back to auto-detect if missing or not ppm | +| `--min-pr-mz` | `comment[ms1 scan range]` or `comment[ms min mz]` | `MS1MinMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | +| `--max-pr-mz` | `comment[ms1 scan range]` or `comment[ms max mz]` | `MS1MaxMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | +| `--min-fr-mz` | `comment[ms2 scan range]` or `comment[ms2 min mz]` | `MS2MinMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | +| `--max-fr-mz` | `comment[ms2 scan range]` or `comment[ms2 max mz]` | `MS2MaxMz` | PRELIMINARY, INDIVIDUAL | Per-file for GPF; global broadest for INSILICO | ### Global parameters from config These parameters apply globally across all files. They are set in `diann_config.cfg` (from SDRF) or as pipeline parameters: -| DIA-NN flag | Pipeline parameter | Default | Steps | Notes | -|---|---|---|---|---| -| `--cut` | (from SDRF enzyme) | — | ALL | Enzyme cut rule, derived from `comment[cleavage agent details]` | -| `--fixed-mod` | (from SDRF) | — | ALL | Fixed modifications from `comment[modification parameters]` | -| `--var-mod` | (from SDRF) | — | ALL | Variable modifications from `comment[modification parameters]` | -| `--monitor-mod` | `--enable_mod_localization` + `--mod_localization` | `false` / `Phospho (S),Phospho (T),Phospho (Y)` | PRELIMINARY, ASSEMBLE, INDIVIDUAL, FINAL | PTM site localization scoring (DIA-NN 1.8.x only) | -| `--window` | `--scan_window` | `8` | PRELIMINARY, ASSEMBLE, INDIVIDUAL | Scan window; auto-detected when `--scan_window_automatic=true` | -| `--quick-mass-acc` | `--quick_mass_acc` | `true` | PRELIMINARY | Fast mass accuracy calibration | -| `--min-corr 2 --corr-diff 1 --time-corr-only` | `--performance_mode` | `true` | PRELIMINARY | High-speed, low-RAM mode | -| `--pg-level` | `--pg_level` | `2` | INDIVIDUAL, FINAL | Protein grouping level | -| `--species-genes` | `--species_genes` | `false` | FINAL | Use species-specific gene names | -| `--no-norm` | `--diann_normalize` | `true` | FINAL | Disable normalization when `false` | +| DIA-NN flag | Pipeline parameter | Default | Steps | Notes | +| --------------------------------------------- | -------------------------------------------------- | ----------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------- | +| `--cut` | (from SDRF enzyme) | — | ALL | Enzyme cut rule, derived from `comment[cleavage agent details]` | +| `--fixed-mod` | (from SDRF) | — | ALL | Fixed modifications from `comment[modification parameters]` | +| `--var-mod` | (from SDRF) | — | ALL | Variable modifications from `comment[modification parameters]` | +| `--monitor-mod` | `--enable_mod_localization` + `--mod_localization` | `false` / `Phospho (S),Phospho (T),Phospho (Y)` | PRELIMINARY, ASSEMBLE, INDIVIDUAL, FINAL | PTM site localization scoring (DIA-NN 1.8.x only) | +| `--window` | `--scan_window` | `8` | PRELIMINARY, ASSEMBLE, INDIVIDUAL | Scan window; auto-detected when `--scan_window_automatic=true` | +| `--quick-mass-acc` | `--quick_mass_acc` | `true` | PRELIMINARY | Fast mass accuracy calibration | +| `--min-corr 2 --corr-diff 1 --time-corr-only` | `--performance_mode` | `true` | PRELIMINARY | High-speed, low-RAM mode | +| `--pg-level` | `--pg_level` | `2` | INDIVIDUAL, FINAL | Protein grouping level | +| `--species-genes` | `--species_genes` | `false` | FINAL | Use species-specific gene names | +| `--no-norm` | `--diann_normalize` | `true` | FINAL | Disable normalization when `false` | ### PTM site localization (`--monitor-mod`) @@ -161,19 +162,20 @@ nextflow run bigbio/quantmsdiann \ ``` The parameter accepts two formats: + - **Modification names** (quantms-compatible): `Phospho (S),Phospho (T),Phospho (Y)` — site info in parentheses is stripped, the base name is mapped to UniMod - **UniMod accessions** (direct): `UniMod:21,UniMod:1` Supported modification name mappings: -| Name | UniMod ID | Example | -|---|---|---| -| Phospho | `UniMod:21` | `Phospho (S),Phospho (T),Phospho (Y)` | -| GlyGly | `UniMod:121` | `GlyGly (K)` | -| Acetyl | `UniMod:1` | `Acetyl (Protein N-term)` | -| Oxidation | `UniMod:35` | `Oxidation (M)` | -| Deamidated | `UniMod:7` | `Deamidated (N),Deamidated (Q)` | -| Methylation | `UniMod:34` | `Methylation (K),Methylation (R)` | +| Name | UniMod ID | Example | +| ----------- | ------------ | ------------------------------------- | +| Phospho | `UniMod:21` | `Phospho (S),Phospho (T),Phospho (Y)` | +| GlyGly | `UniMod:121` | `GlyGly (K)` | +| Acetyl | `UniMod:1` | `Acetyl (Protein N-term)` | +| Oxidation | `UniMod:35` | `Oxidation (M)` | +| Deamidated | `UniMod:7` | `Deamidated (N),Deamidated (Q)` | +| Methylation | `UniMod:34` | `Methylation (K),Methylation (R)` | ## Optional outputs @@ -269,6 +271,7 @@ nextflow run main.nf \ ``` This config (`conf/tests/test_dia_local.config`) overrides: + - `SDRF_PARSING` → `local/sdrf-pipelines:dev` - `SAMPLESHEET_CHECK` → `local/quantms-utils:dev` - `DIANN_MSSTATS` → `local/quantms-utils:dev` diff --git a/modules/local/diann/assemble_empirical_library/main.nf b/modules/local/diann/assemble_empirical_library/main.nf index 034b95e..2bb3e37 100644 --- a/modules/local/diann/assemble_empirical_library/main.nf +++ b/modules/local/diann/assemble_empirical_library/main.nf @@ -19,6 +19,7 @@ process ASSEMBLE_EMPIRICAL_LIBRARY { path "empirical_library.*", emit: empirical_library path "assemble_empirical_library.log", emit: log path "versions.yml", emit: versions + path "diann_calibrated_params.csv", emit: calibrated_params when: task.ext.when == null || task.ext.when @@ -83,6 +84,14 @@ process ASSEMBLE_EMPIRICAL_LIBRARY { cp report.log.txt assemble_empirical_library.log + val_mass_acc_ms2=\$(grep "Averaged recommended settings" assemble_empirical_library.log | cut -d ' ' -f 11 | tr -cd "[0-9.]") + val_mass_acc_ms1=\$(grep "Averaged recommended settings" assemble_empirical_library.log | cut -d ' ' -f 15 | tr -cd "[0-9.]") + val_scan_window=\$(grep "Averaged recommended settings" assemble_empirical_library.log | cut -d ' ' -f 19 | tr -cd "[0-9.]") + if [ -z "\$val_mass_acc_ms2" ]; then val_mass_acc_ms2="0"; fi + if [ -z "\$val_mass_acc_ms1" ]; then val_mass_acc_ms1="0"; fi + if [ -z "\$val_scan_window" ]; then val_scan_window="0"; fi + echo "\${val_mass_acc_ms2},\${val_mass_acc_ms1},\${val_scan_window}" > diann_calibrated_params.csv + cat <<-END_VERSIONS > versions.yml "${task.process}": DIA-NN: \$(diann 2>&1 | grep "DIA-NN" | grep -oP "\\d+\\.\\d+(\\.\\w+)*(\\.[\\d]+)?") diff --git a/modules/local/diann/assemble_empirical_library/meta.yml b/modules/local/diann/assemble_empirical_library/meta.yml index 0d1f5b7..c6ad7ab 100644 --- a/modules/local/diann/assemble_empirical_library/meta.yml +++ b/modules/local/diann/assemble_empirical_library/meta.yml @@ -35,5 +35,9 @@ output: type: file description: File containing software version pattern: "versions.yml" + - calibrated_params: + type: file + description: A file containing mass_acc_ms2, mass_acc_ms1, and scan_window extracted from the DIA-NN log. + pattern: "diann_calibrated_params.csv" authors: - "@daichengxin" diff --git a/modules/local/diann/diann_msstats/main.nf b/modules/local/diann/diann_msstats/main.nf index b2e96ff..470309d 100644 --- a/modules/local/diann/diann_msstats/main.nf +++ b/modules/local/diann/diann_msstats/main.nf @@ -3,8 +3,8 @@ process DIANN_MSSTATS { label 'process_medium' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.27--pyh106432d_0' : - 'biocontainers/quantms-utils:0.0.27--pyh106432d_0' }" + 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.28--pyh106432d_0' : + 'biocontainers/quantms-utils:0.0.28--pyh106432d_0' }" input: path(report) diff --git a/modules/local/diann/generate_cfg/main.nf b/modules/local/diann/generate_cfg/main.nf index 7acf515..8377030 100644 --- a/modules/local/diann/generate_cfg/main.nf +++ b/modules/local/diann/generate_cfg/main.nf @@ -3,8 +3,8 @@ process GENERATE_CFG { label 'process_tiny' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.27--pyh106432d_0' : - 'biocontainers/quantms-utils:0.0.27--pyh106432d_0' }" + 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.28--pyh106432d_0' : + 'biocontainers/quantms-utils:0.0.28--pyh106432d_0' }" input: val(meta) diff --git a/modules/local/diann/individual_analysis/main.nf b/modules/local/diann/individual_analysis/main.nf index 0ba54e8..36502b5 100644 --- a/modules/local/diann/individual_analysis/main.nf +++ b/modules/local/diann/individual_analysis/main.nf @@ -8,7 +8,7 @@ process INDIVIDUAL_ANALYSIS { 'docker.io/biocontainers/diann:v1.8.1_cv1' }" input: - tuple val(meta), path(ms_file), path(fasta), path(diann_log), path(library) + tuple val(meta), path(ms_file), path(fasta), path(library) path(diann_config) output: @@ -44,19 +44,39 @@ process INDIVIDUAL_ANALYSIS { } } - scan_window = params.scan_window - - if (params.mass_acc_automatic | params.scan_window_automatic) { - mass_acc_ms2 = "\$(cat ${diann_log} | grep \"Averaged recommended settings\" | cut -d ' ' -f 11 | tr -cd \"[0-9]\")" - scan_window = "\$(cat ${diann_log} | grep \"Averaged recommended settings\" | cut -d ' ' -f 19 | tr -cd \"[0-9]\")" - mass_acc_ms1 = "\$(cat ${diann_log} | grep \"Averaged recommended settings\" | cut -d ' ' -f 15 | tr -cd \"[0-9]\")" - } else if (meta['precursormasstoleranceunit'].toLowerCase().endsWith('ppm') && meta['fragmentmasstoleranceunit'].toLowerCase().endsWith('ppm')) { + if (params.mass_acc_automatic || params.scan_window_automatic) { + if (meta.mass_acc_ms2 != "0" && meta.mass_acc_ms2 != null) { + mass_acc_ms2 = meta.mass_acc_ms2 + mass_acc_ms1 = meta.mass_acc_ms1 + scan_window = meta.scan_window + } + else if (meta['fragmentmasstolerance']) { + mass_acc_ms2 = meta['fragmentmasstolerance'] + mass_acc_ms1 = meta['precursormasstolerance'] + scan_window = params.scan_window + } + else { + mass_acc_ms2 = params.mass_acc_ms2 + mass_acc_ms1 = params.mass_acc_ms1 + scan_window = params.scan_window + } + } else if (meta['precursormasstoleranceunit']?.toLowerCase()?.endsWith('ppm') && meta['fragmentmasstoleranceunit']?.toLowerCase()?.endsWith('ppm')) { mass_acc_ms1 = meta["precursormasstolerance"] mass_acc_ms2 = meta["fragmentmasstolerance"] } else { - mass_acc_ms2 = "\$(cat ${diann_log} | grep \"Averaged recommended settings\" | cut -d ' ' -f 11 | tr -cd \"[0-9]\")" - scan_window = "\$(cat ${diann_log} | grep \"Averaged recommended settings\" | cut -d ' ' -f 19 | tr -cd \"[0-9]\")" - mass_acc_ms1 = "\$(cat ${diann_log} | grep \"Averaged recommended settings\" | cut -d ' ' -f 15 | tr -cd \"[0-9]\")" + if (meta.mass_acc_ms2 != "0" && meta.mass_acc_ms2 != null) { + mass_acc_ms2 = meta.mass_acc_ms2 + mass_acc_ms1 = meta.mass_acc_ms1 + scan_window = meta.scan_window + } else if (meta['fragmentmasstolerance']) { + mass_acc_ms2 = meta['fragmentmasstolerance'] + mass_acc_ms1 = meta['precursormasstolerance'] + scan_window = params.scan_window + } else { + mass_acc_ms2 = params.mass_acc_ms2 + mass_acc_ms1 = params.mass_acc_ms1 + scan_window = params.scan_window + } } diann_no_peptidoforms = params.diann_no_peptidoforms ? "--no-peptidoforms" : "" diff --git a/modules/local/diann/individual_analysis/meta.yml b/modules/local/diann/individual_analysis/meta.yml index 655a16f..f7ffe35 100644 --- a/modules/local/diann/individual_analysis/meta.yml +++ b/modules/local/diann/individual_analysis/meta.yml @@ -10,10 +10,6 @@ tools: homepage: https://github.com/vdemichev/DiaNN documentation: https://github.com/vdemichev/DiaNN input: - - diann_log: - type: file - description: DIA-NN log file - pattern: "assemble_empirical_library.log" - empirical_library: type: file description: An empirical spectral library from the .quant files. diff --git a/modules/local/pmultiqc/main.nf b/modules/local/pmultiqc/main.nf index af25267..f9d1964 100644 --- a/modules/local/pmultiqc/main.nf +++ b/modules/local/pmultiqc/main.nf @@ -2,8 +2,8 @@ process PMULTIQC { label 'process_high' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/pmultiqc:0.0.42--pyhdfd78af_0' : - 'biocontainers/pmultiqc:0.0.42--pyhdfd78af_0' }" + 'https://depot.galaxyproject.org/singularity/pmultiqc:0.0.43--pyhdfd78af_0' : + 'biocontainers/pmultiqc:0.0.43--pyhdfd78af_0' }" input: path 'results/*' diff --git a/modules/local/samplesheet_check/main.nf b/modules/local/samplesheet_check/main.nf index 09a1303..f2b7112 100644 --- a/modules/local/samplesheet_check/main.nf +++ b/modules/local/samplesheet_check/main.nf @@ -4,8 +4,8 @@ process SAMPLESHEET_CHECK { label 'process_tiny' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.27--pyh106432d_0' : - 'biocontainers/quantms-utils:0.0.27--pyh106432d_0' }" + 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.28--pyh106432d_0' : + 'biocontainers/quantms-utils:0.0.28--pyh106432d_0' }" input: path input_file diff --git a/modules/local/utils/mzml_statistics/main.nf b/modules/local/utils/mzml_statistics/main.nf index 86bd694..f6a96d4 100644 --- a/modules/local/utils/mzml_statistics/main.nf +++ b/modules/local/utils/mzml_statistics/main.nf @@ -4,8 +4,8 @@ process MZML_STATISTICS { label 'process_single' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.27--pyh106432d_0' : - 'biocontainers/quantms-utils:0.0.27--pyh106432d_0' }" + 'https://depot.galaxyproject.org/singularity/quantms-utils:0.0.28--pyh106432d_0' : + 'biocontainers/quantms-utils:0.0.28--pyh106432d_0' }" input: tuple val(meta), path(ms_file) diff --git a/nextflow.config b/nextflow.config index 79d8ec7..636562b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -85,6 +85,10 @@ params { random_preanalysis_seed = 42 empirical_assembly_ms_n = 200 + // DIA-NN: INDIVIDUAL_ANALYSIS + mass_acc_ms2 = 15 + mass_acc_ms1 = 15 + // DIA-NN: FINAL_QUANTIFICATION — summarization & output pg_level = 2 species_genes = false diff --git a/nextflow_schema.json b/nextflow_schema.json index d1215b4..383909c 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -302,6 +302,21 @@ "description": "Settings for DIA-NN - a universal software for data-independent acquisition (DIA) proteomics data processing.", "default": "", "properties": { + "diann_version": { + "type": "string", + "description": "Specify the DIA-NN version to be used in the workflow.", + "fa_icon": "fas fa-tag" + }, + "enable_mod_localization": { + "type": "boolean", + "description": "Enable or disable modification localization scoring in DIA-NN.", + "fa_icon": "fas fa-map-marker-alt" + }, + "mod_localization": { + "type": "string", + "description": "Specify the modification localization parameters for DIA-NN.", + "fa_icon": "fas fa-cogs" + }, "mass_acc_automatic": { "type": "boolean", "default": true, @@ -321,6 +336,20 @@ "help_text": " Ideally, should be approximately equal to the average number of data points per peak", "default": 8 }, + "mass_acc_ms2": { + "type": "number", + "description": "Set the MS2 mass accuracy (tolerance) to a specific value in ppm.", + "fa_icon": "fas fa-bullseye", + "help_text": "If specified, this overrides the automatic calibration. Corresponds to the --mass-acc parameter in DIA-NN.", + "default": 15 + }, + "mass_acc_ms1": { + "type": "number", + "description": "Set the MS1 mass accuracy (tolerance) to a specific value in ppm.", + "fa_icon": "fas fa-bullseye", + "help_text": "If specified, this overrides the automatic calibration. Corresponds to the --mass-acc-ms1 parameter in DIA-NN.", + "default": 15 + }, "performance_mode": { "type": "boolean", "description": "Set Low RAM & High Speed Mode for DIANN, including min-corr, corr-diff, and time-corr-only three parameters", diff --git a/workflows/dia.nf b/workflows/dia.nf index c35c7a3..5b66ee8 100644 --- a/workflows/dia.nf +++ b/workflows/dia.nf @@ -59,12 +59,30 @@ workflow DIA { } if (params.skip_preliminary_analysis) { - assembly_log = channel.fromPath(params.empirical_assembly_log) - empirical_library = channel.fromPath(params.diann_speclib) - indiv_fin_analysis_in = ch_file_preparation_results.combine(ch_searchdb) - .combine(assembly_log) - .combine(empirical_library) - empirical_lib = empirical_library + def log_file = params.empirical_assembly_log ? file(params.empirical_assembly_log) : null + def parsed_m2 = "0" + def parsed_m1 = "0" + def parsed_w = "0" + if (log_file && log_file.exists()) { + def matcher = log_file.text =~ /Mass accuracy = ([0-9.]+)ppm, MS1 accuracy = ([0-9.]+)ppm, Scan window = ([0-9.]+)/ + if (matcher) { + parsed_m2 = matcher[0][1] + parsed_m1 = matcher[0][2] + parsed_w = matcher[0][3] + } + } + indiv_fin_analysis_in = ch_file_preparation_results + .combine(ch_searchdb) + .combine(speclib) + .map { meta_map, ms_file, fasta, library -> + def new_meta = meta_map + [ + mass_acc_ms2 : parsed_m2, + mass_acc_ms1 : parsed_m1, + scan_window : parsed_w + ] + return [ new_meta, ms_file, fasta, library ] + } + empirical_lib = speclib } else { // // MODULE: PRELIMINARY_ANALYSIS @@ -102,9 +120,17 @@ workflow DIA { .mix(ASSEMBLE_EMPIRICAL_LIBRARY.out.versions) indiv_fin_analysis_in = ch_file_preparation_results .combine(ch_searchdb) - .combine(ASSEMBLE_EMPIRICAL_LIBRARY.out.log) .combine(ASSEMBLE_EMPIRICAL_LIBRARY.out.empirical_library) - + .combine(ASSEMBLE_EMPIRICAL_LIBRARY.out.calibrated_params) + .map { meta_map, ms_file, fasta, library, param_file -> + def values = param_file.text.trim().split(',') + def new_meta = meta_map + [ + mass_acc_ms2 : values[0], + mass_acc_ms1 : values[1], + scan_window : values[2] + ] + return [ new_meta, ms_file, fasta, library ] + } empirical_lib = ASSEMBLE_EMPIRICAL_LIBRARY.out.empirical_library }