Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### `Added`

- New `--strip_unknown_mods` parameter (default `false`) that adds `--strip-unknown-mods` to the DIA-NN steps. Some declared variable modifications are not built into the DIA-NN deep-learning predictor — for example **Oxidation on proline**. During in-silico library generation DIA-NN **silently skips** those precursors (logged as `skipping N precursors, unrecognised modifications`), so they never enter the library and are never identified. Enabling `--strip_unknown_mods` forces DIA-NN to predict spectra/RTs/IMs for them so they are retained and searchable; it is a no-op when every declared modification is already recognised. Documented under [Where each GUI flag goes](docs/usage.md) and [Common pitfalls](docs/usage.md).
- New protein-inference parameters `relaxed_prot_inf` and `no_prot_inf` (both default `false`, mutually exclusive). By default the pipeline now uses DIA-NN's **standard** protein inference (no flag) in INDIVIDUAL_ANALYSIS + FINAL_QUANTIFICATION, matching DIA-NN's documented default. `relaxed_prot_inf` adds `--relaxed-prot-inf` (FragPipe/Spectronaut-style grouping); `no_prot_inf` adds `--no-prot-inf` (reuse the empirical-library inference). This replaces the previously hardcoded `--relaxed-prot-inf` (INDIVIDUAL_ANALYSIS) and `--no-prot-inf` (FINAL_QUANTIFICATION).
- DIA-NN **2.5.1** (academic) version profile `-profile diann_v2_5_1` (container `ghcr.io/bigbio/diann:2.5.1`).
- **DIA-NN Enterprise (2.5.1) support** via `-profile diann_v2_5_1_enterprise` (container `ghcr.io/bigbio/diann-enterprise:2.5.1`). New `--enable_kb` flag adds the Enterprise Knowledge Base (`--kb`) to the first-pass search to boost identifications (mainly human data); it is gated to the Enterprise build and **on by default** under the `diann_v2_5_1_enterprise` profile (disable with `--enable_kb false`). New `--diann_license <file>` stages the Enterprise license key into each DIA-NN step as `--license`, with fallback to a key bundled next to the binary when unset. The license key is a per-user secret and is never committed or bundled into the shared image.

Expand Down
65 changes: 45 additions & 20 deletions docs/usage.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions lib/BlockedFlags.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class BlockedFlags {
'--channel-run-norm', '--channel-spec-norm',
// Pipeline-managed: Enterprise Knowledge Base, gated by params.enable_kb
'--kb',
// Pipeline-managed: preliminary step disables protein inference (--no-prot-inf)
'--no-prot-inf',
// Calibration pass: protein inference off (--no-prot-inf hard-coded)
'--no-prot-inf', '--relaxed-prot-inf',
],
ASSEMBLE_EMPIRICAL_LIBRARY: [
// Pipeline-managed: set from params and calibration results
Expand All @@ -95,7 +95,7 @@ class BlockedFlags {
'--use-quant', '--gen-spec-lib', '--out-lib', '--matrices', '--out', '--rt-profiling',
'--mass-acc', '--mass-acc-ms1', '--window',
'--no-ifs-removal', '--no-main-report',
// Pipeline-managed: protein inference set by pipeline (--relaxed-prot-inf --pg-level)
// Protein inference (relaxed_prot_inf / no_prot_inf) and --pg-level (pg_level)
'--relaxed-prot-inf', '--pg-level',
'--min-pr-mz', '--max-pr-mz', '--min-fr-mz', '--max-fr-mz',
'--channel-run-norm', '--channel-spec-norm',
Expand All @@ -107,8 +107,7 @@ class BlockedFlags {
// Pipeline-managed: set from params for final report generation
'--no-main-report', '--gen-spec-lib', '--out-lib', '--no-ifs-removal',
'--use-quant', '--matrices', '--out',
// Pipeline-managed: protein inference is --no-prot-inf (blocked below); --relaxed-prot-inf
// also blocked so extra_args can't re-enable relaxed inference, plus --pg-level.
// Protein inference (relaxed_prot_inf / no_prot_inf) and --pg-level (pg_level)
'--relaxed-prot-inf', '--pg-level',
// Pipeline-managed: QuantUMS quantification (params.quantums and quantums_* params)
'--direct-quant', '--quant-sel-runs', '--quant-train-runs', '--quant-params',
Expand Down
2 changes: 0 additions & 2 deletions modules/local/diann/assemble_empirical_library/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ process ASSEMBLE_EMPIRICAL_LIBRARY {
def args = task.ext.args ?: ''
// DIA-NN Enterprise license; falls back to a key next to the binary when no path is provided
def license_arg = diann_license ? "--license ${diann_license}" : ""
// DIA-NN Enterprise: Knowledge Base (--kb) on the first-pass search that builds the
// empirical library — this is the main identification pass, so --kb belongs here.
def kb = params.enable_kb ? "--kb" : ""
// Strip flags managed by the pipeline from extra_args to prevent silent conflicts.
// Blocked flags are defined centrally in lib/BlockedFlags.groovy — edit there, not here.
Expand Down
7 changes: 2 additions & 5 deletions modules/local/diann/final_quantification/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,12 @@ process FINAL_QUANTIFICATION {

scan_window = params.scan_window_automatic ? "--individual-windows" : "--window $params.scan_window"
species_genes = params.species_genes ? "--species-genes": ""
prot_inf = params.relaxed_prot_inf ? "--relaxed-prot-inf" : (params.no_prot_inf ? "--no-prot-inf" : "")
no_norm = params.normalize ? "" : "--no-norm"
report_decoys = params.report_decoys ? "--report-decoys": ""
diann_export_xic = params.export_xic ? "--xic": ""
// QuantUMS is DIA-NN's recommended quant for >= 1.9.2; --direct-quant opts out to legacy quant.
quantums_on = params.quantums && VersionUtils.versionAtLeast(params.diann_version, '1.9.2')
quantums = params.quantums ? "" : (VersionUtils.versionAtLeast(params.diann_version, '1.9.2') ? "--direct-quant" : "")
// QuantUMS tuning flags only apply when QuantUMS is active — older versions don't support them.
// --quant-sel-runs caps QuantUMS parameter optimisation to N auto-selected runs, which keeps
// QuantUMS fast on large cohorts (thousands of runs) where optimising over every run is very slow.
quantums_train_runs = (quantums_on && params.quantums_train_runs) ? "--quant-train-runs $params.quantums_train_runs": ""
quantums_sel_runs = (quantums_on && params.quantums_sel_runs) ? "--quant-sel-runs $params.quantums_sel_runs": ""
quantums_params = (quantums_on && params.quantums_params) ? "--quant-params $params.quantums_params": ""
Expand Down Expand Up @@ -92,7 +89,7 @@ process FINAL_QUANTIFICATION {
--threads ${task.cpus} \\
--verbose $params.debug_level \\
--temp ./quant/ \\
--no-prot-inf \\
${prot_inf} \\
--pg-level $params.pg_level \\
${species_genes} \\
${no_norm} \\
Expand Down
5 changes: 2 additions & 3 deletions modules/local/diann/individual_analysis/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ process INDIVIDUAL_ANALYSIS {
no_main_report = VersionUtils.versionLessThan(params.diann_version, '2.3') ? "--no-main-report" : ""
// DIA-NN Enterprise license; falls back to a key next to the binary when no path is provided
license_arg = diann_license ? "--license ${diann_license}" : ""
// DIA-NN Enterprise: Knowledge Base (--kb) boosts identifications (mainly human data).
// Must be on the actual per-file search, not just the preliminary calibration pass.
prot_inf = params.relaxed_prot_inf ? "--relaxed-prot-inf" : (params.no_prot_inf ? "--no-prot-inf" : "")
kb = params.enable_kb ? "--kb" : ""

// Per-file scan ranges from SDRF (empty = no flag, DIA-NN auto-detects)
Expand Down Expand Up @@ -112,7 +111,7 @@ process INDIVIDUAL_ANALYSIS {
${no_main_report} \\
${license_arg} \\
${kb} \\
--relaxed-prot-inf \\
${prot_inf} \\
--pg-level $params.pg_level \\
${min_pr_mz} \\
${max_pr_mz} \\
Expand Down
3 changes: 0 additions & 3 deletions modules/local/diann/preliminary_analysis/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ process PRELIMINARY_ANALYSIS {
// Performance flags for preliminary analysis calibration step
quick_mass_acc = params.quick_mass_acc ? "--quick-mass-acc" : ""
performance_flags = params.performance_mode ? "--min-corr 2 --corr-diff 1 --time-corr-only" : ""
// DIA-NN Enterprise: Knowledge Base (--kb) on the mass-accuracy calibration pass
// (boosts IDs, mainly human data). Also applied to the search passes
// (ASSEMBLE_EMPIRICAL_LIBRARY, INDIVIDUAL_ANALYSIS) where identification happens.
kb = params.enable_kb ? "--kb" : ""
// DIA-NN Enterprise license; falls back to a key next to the binary when no path is provided
license_arg = diann_license ? "--license ${diann_license}" : ""
Expand Down
4 changes: 4 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ params {
// DIA-NN: FINAL_QUANTIFICATION — summarization & output
pg_level = 2 // protein-group inference level (2 = gene-level). Correct for UniProt FASTAs with gene names; gene-less FASTAs (e.g. ProteoBench HYE) are unaffected (DIA-NN falls back), so kept at 2 by default.
species_genes = false
// Protein inference for INDIVIDUAL_ANALYSIS + FINAL_QUANTIFICATION. Default (both false) = DIA-NN
// standard inference (no flag). The two opt-ins are mutually exclusive (validated at startup):
relaxed_prot_inf = false // add '--relaxed-prot-inf' (FragPipe/Spectronaut-style grouping)
no_prot_inf = false // add '--no-prot-inf' (reuse the empirical-library inference)
normalize = true
report_decoys = false
export_xic = false
Expand Down
12 changes: 12 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,18 @@
"description": "Instructs DIA-NN to add the organism identifier to the gene names",
"fa_icon": "far fa-check-square"
},
"relaxed_prot_inf": {
"type": "boolean",
"description": "Opt-in: add --relaxed-prot-inf (FragPipe/Spectronaut-style protein grouping) to INDIVIDUAL_ANALYSIS + FINAL_QUANTIFICATION. Mutually exclusive with no_prot_inf. Default off = DIA-NN standard inference.",
"fa_icon": "far fa-check-square",
"default": false
},
"no_prot_inf": {
"type": "boolean",
"description": "Opt-in: add --no-prot-inf (reuse the empirical-library protein inference) to INDIVIDUAL_ANALYSIS + FINAL_QUANTIFICATION. Mutually exclusive with relaxed_prot_inf. Default off = DIA-NN standard inference.",
"fa_icon": "far fa-check-square",
"default": false
},
"speclib": {
"type": "string",
"description": "The spectral library to use for DIA-NN",
Expand Down
5 changes: 5 additions & 0 deletions workflows/dia.nf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ workflow DIA {
error("Model fine-tuning requires DIA-NN >= 2.3.2. Current version: ${params.diann_version}. Use -profile diann_v2_3_2 or later")
}

// Protein inference opt-ins are mutually exclusive; default (both off) = DIA-NN standard inference.
if (params.relaxed_prot_inf && params.no_prot_inf) {
error("--relaxed_prot_inf and --no_prot_inf are mutually exclusive. Set at most one (default: neither = DIA-NN standard inference).")
}

// Enterprise guard: the Knowledge Base (--kb) is only available in the DIA-NN Enterprise build
if (params.enable_kb && !params.diann_enterprise) {
error("--enable_kb requires the DIA-NN Enterprise build. Use -profile diann_v2_5_1_enterprise.")
Expand Down
Loading