Skip to content

feat: add DIA-NN scoring mode parameter (Generic/Proteoforms/Peptidoforms) - #45

Merged
ypriverol merged 5 commits into
devfrom
feat/scoring-mode
Apr 10, 2026
Merged

ypriverol merged 5 commits into
devfrom
feat/scoring-mode

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

Summary

  • Add diann_scoring_mode parameter with enum: generic (default), proteoforms, peptidoforms
  • Flag passed to all 5 DIA-NN modules (insilico_library_generation, preliminary_analysis, assemble_empirical_library, individual_analysis, final_quantification)
  • --proteoforms and --peptidoforms added to blocked flags in all modules
  • Version guard: proteoforms mode requires DIA-NN >= 2.0

Why

For proteogenomics with variant databases (e.g., COSMIC missense mutations), the default Generic scoring mode generates fully shuffled decoys that don't model single-residue differences between canonical and variant peptides. Proteoforms mode generates single-residue mutation decoys, providing proper FDR estimation for variant-specific peptides.

Usage

# Standard proteomics (default)
nextflow run quantmsdiann --diann_scoring_mode generic

# Proteogenomics / variant detection
nextflow run quantmsdiann --diann_scoring_mode proteoforms -profile diann_v2_1_0

# PTM analysis
nextflow run quantmsdiann --diann_scoring_mode peptidoforms

Closes #43

Test plan

  • Run with default generic — verify no --proteoforms/--peptidoforms in DIA-NN commands
  • Run with proteoforms + DIA-NN 2.x — verify --proteoforms appears in all steps
  • Run with proteoforms + DIA-NN 1.8.1 — verify version guard error
  • Run with peptidoforms — verify --peptidoforms appears in all steps

🤖 Generated with Claude Code

Add diann_scoring_mode parameter with three options:
- 'generic' (default): standard scoring, maximizes protein IDs
- 'proteoforms': single-residue mutation decoys, recommended for
  proteogenomics/variant detection (requires DIA-NN >= 2.0)
- 'peptidoforms': extra peptidoform q-values for PTM analysis

The flag is passed to all 5 DIA-NN steps and added to each
module's blocked flags list. Version validation ensures
proteoforms mode is only used with DIA-NN >= 2.0.

Closes #43

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 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: ea3a0e97-b5c5-42c9-b614-409bf3ff24af

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/scoring-mode

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 Apr 10, 2026 •

Copy link
Copy Markdown

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

Posted for pipeline commit 2ef3138

+| ✅ 106 tests passed       |+
#| ❔  19 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 3.5.2
  • Run at 2026-04-10 12:36:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new pipeline-level DIA-NN scoring-mode knob to support proteogenomics (variant detection) and PTM-focused analyses by exposing DIA-NN’s --proteoforms / --peptidoforms modes and enforcing a minimum DIA-NN version where required.

Changes:

  • Introduces diann_scoring_mode (generic default, proteoforms, peptidoforms) in config, schema, and docs.
  • Threads the scoring-mode flag through all DIA-NN execution steps and blocks manual override via diann_extra_args.
  • Adds a workflow-level version guard requiring DIA-NN >= 2.0 for proteoforms.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
workflows/dia.nf Adds DIA-NN version guard for proteoforms scoring mode.
nextflow.config Defines default params.diann_scoring_mode = 'generic'.
nextflow_schema.json Adds schema entry for diann_scoring_mode with enum + help text.
modules/local/diann/insilico_library_generation/main.nf Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args.
modules/local/diann/preliminary_analysis/main.nf Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args.
modules/local/diann/assemble_empirical_library/main.nf Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args.
modules/local/diann/individual_analysis/main.nf Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args.
modules/local/diann/final_quantification/main.nf Adds scoring-mode flag injection and blocks --proteoforms/--peptidoforms in extra args.
docs/parameters.md Documents --diann_scoring_mode in the parameter table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread workflows/dia.nf

// Version guard for scoring mode
if (params.diann_scoring_mode == 'proteoforms' && VersionUtils.versionLessThan(params.diann_version, '2.0')) {
error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later")

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version-guard error message references "--proteoforms scoring mode", but users enable this behavior via the pipeline parameter --diann_scoring_mode proteoforms. Consider updating the message to reference the pipeline param/value (and optionally list allowed values) to reduce confusion when the guard triggers.

Suggested change
error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later")
error("--diann_scoring_mode proteoforms requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later")

Copilot uses AI. Check for mistakes.
Comment thread workflows/dia.nf
if (params.diann_scoring_mode == 'proteoforms' && VersionUtils.versionLessThan(params.diann_version, '2.0')) {
error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later")
}

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diann_scoring_mode can be set to peptidoforms while diann_no_peptidoforms is also true, which will cause the modules to pass both --peptidoforms and --no-peptidoforms in the same DIA-NN invocation. Add a validation/guard (e.g., error out or explicitly ignore one of the settings) to prevent conflicting flags.

Suggested change
// Guard against conflicting peptidoform flags
if (params.diann_scoring_mode == 'peptidoforms' && params.diann_no_peptidoforms) {
error("Conflicting DIA-NN settings: --diann_scoring_mode peptidoforms cannot be used together with --diann_no_peptidoforms, as they would pass both --peptidoforms and --no-peptidoforms in the same DIA-NN invocation.")
}

Copilot uses AI. Check for mistakes.
Comment thread workflows/dia.nf
Comment on lines +48 to 55
// Version guard for scoring mode
if (params.diann_scoring_mode == 'proteoforms' && VersionUtils.versionLessThan(params.diann_version, '2.0')) {
error("--proteoforms scoring mode requires DIA-NN >= 2.0. Current version: ${params.diann_version}. Use -profile diann_v2_1_0 or later")
}

// Version guard for DIA-NN 2.0+ features
if ((params.diann_light_models || params.diann_export_quant || params.diann_site_ms1_quant) && VersionUtils.versionLessThan(params.diann_version, '2.0')) {
def enabled = []

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR adds new runtime behavior (conditional injection of --proteoforms/--peptidoforms across all DIA-NN steps plus a DIA-NN version guard), but there are no new nf-test cases covering these branches. Add at least one test that exercises --diann_scoring_mode proteoforms (with a DIA-NN 2.x profile) and one that asserts a failure for proteoforms with DIA-NN 1.8.1, so regressions in command construction/guards are caught automatically.

Copilot uses AI. Check for mistakes.
ypriverol and others added 4 commits April 10, 2026 09:18
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Since quantmsdiann is a DIA-NN-only pipeline, the diann_ prefix on
parameters is redundant. Renamed all user-facing params:
  diann_debug -> debug_level
  diann_speclib -> speclib
  diann_extra_args -> extra_args
  diann_dda -> dda
  diann_light_models -> light_models
  diann_export_quant -> export_quant
  diann_site_ms1_quant -> site_ms1_quant
  diann_pre_select -> pre_select
  diann_report_decoys -> report_decoys
  diann_export_xic -> export_xic
  diann_normalize -> normalize
  diann_use_quant -> use_quant
  diann_tims_sum -> tims_sum
  diann_im_window -> im_window
  diann_channel_run_norm -> channel_run_norm
  diann_channel_spec_norm -> channel_spec_norm

Removed diann_no_peptidoforms entirely — superseded by the new
scoring_mode parameter (generic/proteoforms/peptidoforms).
--no-peptidoforms remains in blocked flags lists.

Note: diann_version is NOT renamed (used in profile names).

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@ypriverol
ypriverol merged commit b2c9219 into dev Apr 10, 2026
19 checks passed
@ypriverol
ypriverol deleted the feat/scoring-mode branch April 12, 2026 08:07
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.

Add DIA-NN scoring mode parameter (Generic/Proteoforms/Peptidoforms) for proteogenomics support

2 participants