Skip to content

Task 2 - #227

Merged
tonywu1999 merged 10 commits into
develfrom
feat/tracer-constants-file-upload
Aug 31, 2026
Merged

Task 2#227
tonywu1999 merged 10 commits into
develfrom
feat/tracer-constants-file-upload

Conversation

@Rudhik1904

@Rudhik1904 Rudhik1904 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

Protein turnover analyses require consistent tracer constants across validation, ratio calculation, generated scripts, and stored results. The previous per-condition input model could produce stale or mismatched values.

This change adds an optional tracer-constants CSV upload with validation, lifecycle tracking, provenance handling, and generated-script support.

Changes

  • Added tracer-constants UI identifiers and status constants.
  • Replaced per-condition tracer inputs with one optional CSV upload.
  • Added validation for file readability, schema, numeric ranges, condition mapping, timepoint compatibility, and misleading units.
  • Added upload states: absent, pending, rejected, and valid.
  • Snapshotted validated tracer constants when the user runs an analysis.
  • Cleared snapshots when the upload, template, or condition metadata became invalid.
  • Passed tracer constants from qcServer to statmodelServer.
  • Used the same tracer-constant snapshot for turnover calculations, displayed ratios, downloads, and generated scripts.
  • Added provenance comments and validation for generated turnover scripts.
  • Restored the complete MSstatsConvert import.
  • Updated package ignore rules for planning files, logs, root-level CSV files, and .github.
  • Updated qcServer and statmodelServer documentation.

Unit Tests

  • Added tests for tracer-constants upload validation and state transitions.
  • Added tests for range checks, condition matching, timepoint parsing, and misleading units.
  • Added tests for default and resolved tracer constants.
  • Added tests for tracer constants reaching turnover calculations.
  • Added tests for provenance comments in generated scripts.
  • Added lifecycle regression tests for snapshot clearing and consistency with calculated ratios.
  • Updated QC UI tests for tracer-constants controls.
  • Replaced legacy per-condition test inputs with snapshot-based inputs.
  • Removed outdated statmodel forwarding tests.

Coding Guidelines

No coding guideline violations were identified in the provided changes.

@Rudhik1904
Rudhik1904 requested a review from tonywu1999 August 30, 2026 01:23
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f272c023-4e4d-48a3-bf56-d6c5534fc85f

📥 Commits

Reviewing files that changed from the base of the PR and between c409f28 and 67e9157.

📒 Files selected for processing (1)
  • R/qc-server-turnover.R
💤 Files with no reviewable changes (1)
  • R/qc-server-turnover.R

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds optional tracer-constants CSV upload for protein turnover. It validates and snapshots constants, applies them to turnover calculations, exposes provenance to statistical-model code generation, and adds lifecycle and serialization tests.

Changes

Tracer constants workflow

Layer / File(s) Summary
Tracer contracts and validation
R/constants.R, R/qc-server-data-upload.R, tests/testthat/test-qc-data-upload.R
Defines tracer-constant states, bounds, schemas, condition matching, timepoint validation, defaults, and resolution behavior.
Upload and turnover lifecycle
R/qc-server-turnover.R, R/module-qc-server.R, R/module-qc-ui.R, tests/testthat/test-module-turnover.R
Adds upload states, validation observers, panel status, run-time gating, turnover integration, snapshot lifecycle handling, and UI tests.
Analysis-code propagation and provenance
R/module-statmodel-server.R, R/server.R, R/statmodel-server-download-code.R, tests/testthat/test-module-statmodel-server.R, tests/testthat/test-module-turnover.R
Passes tracer snapshots into analysis-code generation, validates serialized constants, and emits provenance comments.
Package wiring and API documentation
.Rbuildignore, .gitignore, NAMESPACE, man/*.Rd, tests/testthat/test-module-qc-ui.R
Updates package ignore rules, imports, module documentation, and UI structure tests.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 67e91

No actionable merge-blocking risk remains; the PR is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant register_qc_turnover
  participant qc_resolve_tracer_constants
  participant calculateTurnoverRatios
  participant generate_analysis_code
  User->>register_qc_turnover: Upload tracer constants and run
  register_qc_turnover->>qc_resolve_tracer_constants: Validate and resolve values
  register_qc_turnover->>calculateTurnoverRatios: Pass resolved constants
  calculateTurnoverRatios-->>register_qc_turnover: Return ratios
  register_qc_turnover->>generate_analysis_code: Pass snapshot and provenance
  generate_analysis_code-->>User: Provide turnover analysis script
Loading

Suggested reviewers: tonywu1999

Poem

A rabbit uploads constants with care
Validation checks each value there
Ratios run with names in line
Provenance marks the script design
Fresh snapshots keep results fair

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "Task 2" is too generic and does not identify the tracer-constants CSV upload or related protein-turnover changes. Replace the title with a concise, specific summary such as "Add tracer constants CSV upload for protein turnover".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tracer-constants-file-upload

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.

@tonywu1999
tonywu1999 merged commit 7ff8842 into devel Aug 31, 2026
2 checks passed
@tonywu1999
tonywu1999 deleted the feat/tracer-constants-file-upload branch August 31, 2026 14:36
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.

2 participants