Skip to content

Suppress protein inference warning in PRELIMINARY_ANALYSIS - #29

Merged
ypriverol merged 4 commits into
devfrom
fix/suppress-prot-inf-warning
Apr 3, 2026
Merged

ypriverol merged 4 commits into
devfrom
fix/suppress-prot-inf-warning

Conversation

@ypriverol

Copy link
Copy Markdown
Contributor

Summary

  • Add --no-prot-inf flag to the DIA-NN command in PRELIMINARY_ANALYSIS to suppress the misleading "protein inference is enabled but no FASTA provided" warning, since this step only performs calibration using the spectral library and does not need protein inference.
  • Add '--no-prot-inf' to the blocked list so users cannot accidentally double-pass it via diann_extra_args.

Closes #26

Test plan

  • Run the pipeline with a spectral library input and verify the warning no longer appears in the PRELIMINARY_ANALYSIS log
  • Verify that passing --no-prot-inf via --diann_extra_args triggers the blocked-flag warning and is stripped

🤖 Generated with Claude Code

ypriverol and others added 2 commits April 3, 2026 07:43
…ce warning

PRELIMINARY_ANALYSIS only performs calibration using the spectral library
and does not need protein inference. Adding --no-prot-inf suppresses the
misleading "protein inference is enabled but no FASTA provided" warning.
The flag is also added to the blocked list so users cannot double-pass it
via diann_extra_args.

Closes #26

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Document DIA-NN's recommendation to manually fix MS1/MS2 mass accuracy
to 10-15 ppm for timsTOF datasets instead of using automatic calibration.
Adds a new "Bruker/timsTOF Data" section to usage docs with example command.

Closes #26

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

coderabbitai Bot commented Apr 3, 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: ec7dab2b-6b80-4149-887e-d2bf0f23d179

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 fix/suppress-prot-inf-warning

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.

@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Suppress protein inference warning and document timsTOF mass accuracy

✨ Enhancement 📝 Documentation

Grey Divider

Walkthroughs

Description
• Add --no-prot-inf flag to PRELIMINARY_ANALYSIS to suppress protein inference warning
• Block --no-prot-inf from user-provided arguments to prevent conflicts
• Add warning for Bruker/timsTOF datasets with automatic mass accuracy calibration
• Document recommended mass accuracy settings for timsTOF data in usage guide
Diagram
flowchart LR
  A["PRELIMINARY_ANALYSIS Process"] -->|Add flag| B["--no-prot-inf"]
  A -->|Block from args| C["diann_extra_args"]
  D[".d file detected"] -->|Check auto-calibration| E["Emit warning"]
  F["Usage Documentation"] -->|Add section| G["Bruker/timsTOF Data"]
  G -->|Include example| H["Mass accuracy parameters"]
Loading

Grey Divider

File Changes

1. modules/local/diann/preliminary_analysis/main.nf ✨ Enhancement +9/-1

Add protein inference suppression and timsTOF calibration warning

• Add --no-prot-inf flag to the DIA-NN command to suppress protein inference warning
• Add --no-prot-inf to the blocked flags list to prevent user override via diann_extra_args
• Add warning detection for Bruker/timsTOF .d files with automatic mass accuracy calibration
 enabled
• Warn users to manually set MS1/MS2 mass accuracy to 10-15 ppm for timsTOF datasets

modules/local/diann/preliminary_analysis/main.nf


2. docs/usage.md 📝 Documentation +20/-0

Document Bruker/timsTOF mass accuracy configuration

• Add new "Bruker/timsTOF Data" section documenting DIA-NN recommendations
• Provide example command with manual mass accuracy settings (10-15 ppm) for timsTOF data
• Document --diann_tims_sum flag for Synchro-PASEF data
• Add note about pipeline warning for .d files with automatic calibration

docs/usage.md


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Apr 3, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Remediation recommended

1. Bruker warning misses fallback 🐞 Bug ✧ Quality
Description
PRELIMINARY_ANALYSIS warns about auto mass-accuracy calibration for .d inputs only when
params.mass_acc_automatic is true, but the step can still force auto-calibration by setting
mass_acc="" when SDRF tolerance units are not ppm. In that fallback case, auto-calibration is
still in effect but the warning won’t trigger, contradicting the usage docs note and reducing
observability for timsTOF runs.
Code

modules/local/diann/preliminary_analysis/main.nf[R57-62]

+    // Warn about auto-calibration with Bruker/timsTOF data
+    if (params.mass_acc_automatic && ms_file.name.toString().toLowerCase().endsWith('.d')) {
+        log.warn "Bruker/timsTOF .d file detected (${ms_file.name}) with automatic mass accuracy calibration enabled. " +
+            "DIA-NN recommends manually fixing MS1 and MS2 mass accuracy to 10-15 ppm for timsTOF datasets. " +
+            "Consider using: --mass_acc_automatic false --mass_acc_ms1 10 --mass_acc_ms2 10"
+    }
Evidence
mass_acc is cleared not only when params.mass_acc_automatic is true, but also in the
non-ppm-unit fallback path, meaning DIA-NN will still run with auto-calibration. The new Bruker
warning checks only the param, so it won’t fire when the fallback path clears mass_acc while
params.mass_acc_automatic is false; this also conflicts with the docs statement that the warning
is emitted for .d files with auto calibration enabled.

modules/local/diann/preliminary_analysis/main.nf[48-62]
docs/usage.md[32-51]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The Bruker/timsTOF warning checks `params.mass_acc_automatic`, but the process can still end up using DIA-NN auto-calibration when it clears `mass_acc` due to SDRF tolerance units not being ppm. In that case, the warning should still fire.

### Issue Context
`mass_acc` is the effective indicator of whether explicit tolerances are passed; when it is empty, DIA-NN will auto-determine tolerances.

### Fix Focus Areas
- modules/local/diann/preliminary_analysis/main.nf[48-62]

### Suggested change
After computing `mass_acc`, derive a boolean like `auto_mass_acc_effective = (mass_acc == '')` (or set it during the conditional branches), and use that in the warning condition, e.g.:

- `if (auto_mass_acc_effective && ms_file.name.toLowerCase().endsWith('.d')) { ... }`

This aligns behavior with the documented note and ensures the warning appears whenever auto-calibration is actually in effect.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@ypriverol ypriverol linked an issue Apr 3, 2026 that may be closed by this pull request
@ypriverol
ypriverol requested review from Copilot and yueqixuan April 3, 2026 06:58

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

Suppresses DIA-NN’s protein inference warning during PRELIMINARY_ANALYSIS and adds guidance for Bruker/timsTOF mass accuracy calibration.

Changes:

  • Add --no-prot-inf to the DIA-NN invocation in PRELIMINARY_ANALYSIS.
  • Block --no-prot-inf from being passed via diann_extra_args.
  • Add a Bruker/timsTOF calibration recommendation and emit a warning when .d inputs are used with automatic calibration.

Reviewed changes

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

File Description
modules/local/diann/preliminary_analysis/main.nf Adds --no-prot-inf and emits a timsTOF-specific warning during preliminary calibration.
docs/usage.md Documents recommended mass accuracy settings for Bruker/timsTOF datasets and the new warning behavior.

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

Comment thread docs/usage.md Resolved
@ypriverol
ypriverol merged commit 616ea92 into dev Apr 3, 2026
8 checks passed
@ypriverol
ypriverol deleted the fix/suppress-prot-inf-warning branch April 9, 2026 09:13
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.

BIGBIO_QUANTMS:QUANTMS:DIA:PRELIMINARY_ANALYSIS

3 participants