Skip to content

feat(diann): add --strip_unknown_mods to recover hydroxyproline / non-standard PTMs - #108

Merged
ypriverol merged 1 commit into
devfrom
feat/strip-unknown-mods
Jun 10, 2026
Merged

ypriverol merged 1 commit into
devfrom
feat/strip-unknown-mods

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

Problem

Some variable modifications declared in the SDRF are not built into the DIA-NN deep-learning predictor — most notably Oxidation on proline (hydroxyproline), which is ubiquitous in collagen/ECM samples. During in-silico library generation (--fasta-search --predictor), DIA-NN silently skips those peptidoforms:

WARNING: skipping N precursors, unrecognised modifications? If these precursors are important,
consider forcing prediction of spectra/RTs/IMs for these precursors anyway, using the --strip-unknown-mods option

Because the pipeline never passes --strip-unknown-mods, those precursors never enter the predicted library and are never identified — even though they are correctly declared in the SDRF (NT=Oxidation;MT=Variable;TA=P;AC=UNIMOD:35). Methionine oxidation (which the predictor does know) comes through normally, so the loss is silent and PTM-specific.

Evidence

On a collagen/ECM lung GPF dataset (DIA-NN 1.8.1), the in-silico step skipped ~10 M precursors (the hydroxyproline ones) and the final report contained 0 oxidized-proline precursors. Re-running the same data with --strip-unknown-mods (matching a reference desktop DIA-NN GUI run that uses the flag): the in-silico step generated 13.97 M precursors with no skipping, and the analysis recovered 1,567 oxidized-proline precursors. This is also the DIA-NN author's documented remedy for modifications the predictor does not recognise in 1.8.x.

Change

  • New first-class boolean parameter strip_unknown_mods (default false). When enabled, --strip-unknown-mods is prepended to every DIA-NN step (via conf/modules/dia.config), forcing DIA-NN to predict spectra/RTs/IMs for the unrecognised-mod peptidoforms so they are retained and searchable. It is a no-op when every declared modification is already recognised by the predictor.
  • nextflow_schema.json: parameter definition (with help text and the skip-warning explanation).
  • docs/usage.md: a row in the "Where each GUI flag goes" mapping table and a "Common pitfalls" entry (how to spot skipping N precursors, unrecognised modifications in the INSILICO_LIBRARY_GENERATION log).
  • CHANGELOG.md.

Notes

  • --strip-unknown-mods is not in BlockedFlags, so it passes through ext.args unchanged.
  • For collagen specifically, a complementary SDRF-side setting helps: declare the enzyme as Trypsin/P (MS:1001313), which sdrf-pipelines maps to --cut K*,R* (trypsin cleaves before proline). That is configured in the SDRF, not in this pipeline, and is documented in the same table.
  • End-to-end pipeline validation on the collagen GPF data is running; I'll add the recovered P(UniMod:35) count from the pipeline output once it completes.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d14d98af-8d0a-495e-bbf1-efd35c45361f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/strip-unknown-mods

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 10, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 470282d

+| ✅ 108 tests passed       |+
#| ❔  18 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗   4 tests had warnings |!
Details

❗ Test warnings:

  • files_exist - File not found: conf/igenomes.config
  • files_exist - File not found: conf/igenomes_ignored.config
  • files_exist - File not found: .github/workflows/awstest.yml
  • files_exist - File not found: .github/workflows/awsfulltest.yml

❔ Tests ignored:

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 4.0.2
  • Run at 2026-06-10 08:18:13

@ypriverol
ypriverol force-pushed the feat/strip-unknown-mods branch from 1de1952 to aab409b Compare June 10, 2026 07:53
@ypriverol

Copy link
Copy Markdown
Contributor Author

Reworked per design feedback: strip_unknown_mods is no longer injected through extra_args/ext.args. It is now a first-class parameter assembled directly in each DIA-NN module's command (strip_unknown_mods = params.strip_unknown_mods ? "--strip-unknown-mods" : "" → ${strip_unknown_mods}), consistent with how met_excision, aa_eq, etc. are handled. conf/modules/dia.config is unchanged. Applied to all five DIA-NN steps.

…-standard PTMs

Some declared variable modifications are not recognised by the DIA-NN
deep-learning predictor — most notably Oxidation on proline (hydroxyproline),
ubiquitous in collagen/ECM. During in-silico library generation DIA-NN
silently SKIPS those precursors (log: 'skipping N precursors, unrecognised
modifications'), so they never enter the library and are never identified.

Add a first-class boolean param 'strip_unknown_mods' (default false). It is
assembled into each DIA-NN module's command (like met_excision/aa_eq) rather
than injected via extra_args, matching the pipeline's design. When enabled,
--strip-unknown-mods is added to all DIA-NN steps, forcing DIA-NN to predict
spectra/RTs/IMs for the unrecognised-mod peptidoforms so they are retained
and searchable. No-op when every declared modification is recognised.

- nextflow.config + nextflow_schema.json: new strip_unknown_mods param.
- modules/local/diann/*: INSILICO_LIBRARY_GENERATION, PRELIMINARY_ANALYSIS,
  ASSEMBLE_EMPIRICAL_LIBRARY, INDIVIDUAL_ANALYSIS, FINAL_QUANTIFICATION all
  add ${strip_unknown_mods} to the diann command.
- docs/usage.md: GUI-flag mapping row + Common pitfalls note (incl. the
  Trypsin/P enzyme for --cut K*,R*, declared in the SDRF, for collagen).
- CHANGELOG.
@ypriverol
ypriverol force-pushed the feat/strip-unknown-mods branch from aab409b to 470282d Compare June 10, 2026 08:16
@ypriverol
ypriverol merged commit a83b70e into dev Jun 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant