Skip to content

refactor(groupComparisonLiP): Use ptm_label_type and protein_label_type for groupComparisonPTM dependency#47

Merged
tonywu1999 merged 2 commits into
develfrom
fix-tests
Apr 7, 2026
Merged

refactor(groupComparisonLiP): Use ptm_label_type and protein_label_type for groupComparisonPTM dependency#47
tonywu1999 merged 2 commits into
develfrom
fix-tests

Conversation

@tonywu1999
Copy link
Copy Markdown
Contributor

@tonywu1999 tonywu1999 commented Apr 7, 2026

Motivation and Context

The refactor makes the internal call from groupComparisonLiP to MSstatsPTM::groupComparisonPTM explicit and more maintainable by passing all parameters as named arguments and by specifying label types for PTM and protein data. This clarifies that both PTM and protein data are label-free (ptm_label_type = "LF", protein_label_type = "LF") and reduces reliance on positional argument ordering when delegating to groupComparisonPTM.

Detailed Changes

  • R/groupComparisonLiP.R

    • Replaced a prior positional-style call to groupComparisonPTM with an explicit named-argument call.
    • Added ptm_label_type = "LF" and protein_label_type = "LF" to the groupComparisonPTM call.
    • Passed contrast.matrix via contrast.matrix = contrast.matrix.
    • Set moderated = FALSE and adj.method = "BH" explicitly in the call.
    • Converted log-related parameters to named arguments in the call: log_base, use_log_file, append, verbose, log_file_path (uses computed path variable), base.
    • Kept existing upstream formatting, lookup_table construction, tryptic labeling, and result post-processing logic unchanged.
    • Ensured model.data$ADJUSTED.Model rows with NA Protein are removed as before.
  • DESCRIPTION

    • Bumped package Version from 1.17.0 → 1.17.1.
    • Tightened MSstatsPTM import constraint to MSstatsPTM (>= 2.12.0).

Unit Tests

  • inst/tinytest/test_groupComparisonLiP.R remains present and unchanged; tests exercise:
    • Error handling for missing inputs.
    • Silent handling when TrP is NULL.
    • Output structure and types for LiP.Model, TrP.Model, and Adjusted.LiP.Model (data.table).
    • Exact column-name expectations for the three result tables.
  • Existing tests continue to validate backward compatibility of the refactor (no new tests were added or modified in this PR).

Coding Guidelines Violations

  • None detected in the changed files: changes are limited to refactoring an internal function call and metadata updates; no exported function signatures were altered and existing tests remain unmodified.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

📝 Walkthrough

Walkthrough

Refactored groupComparisonLiP to call groupComparisonPTM with explicit named arguments; bumped package version and tightened MSstatsPTM import to >= 2.12.0 in DESCRIPTION.

Changes

Cohort / File(s) Summary
Function Call Refactoring
R/groupComparisonLiP.R
Replaced positional groupComparisonPTM call with named arguments: ptm_label_type = "LF", protein_label_type = "LF", contrast.matrix = ..., moderated = FALSE, adj.method = "BH", and explicitly mapped log-related parameters (log_base, use_log_file, append, verbose, log_file_path, base).
Package Metadata
DESCRIPTION
Incremented package version from 1.17.0 to 1.17.1 and tightened MSstatsPTM import constraint to >= 2.12.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through code with a curious sniff,
Named arguments placed, no more positional rift.
A version bumped, a tidy little fix,
I nibble carrots, then vanish in a mix. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is entirely empty with no substantive content provided in any required section. Add comprehensive description including: Motivation and Context explaining the refactor rationale, detailed Changes list documenting the modifications to groupComparisonLiP and DESCRIPTION version/dependencies, Testing section describing validation steps, and confirm all checklist items are addressed.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main refactor: updating groupComparisonLiP to use explicit ptm_label_type and protein_label_type parameters when calling groupComparisonPTM.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-tests

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@R/groupComparisonLiP.R`:
- Around line 95-108: The package calls groupComparisonPTM() with the
ptm_label_type and protein_label_type arguments (used in lines where
groupComparisonPTM is invoked), which require MSstatsPTM >= 2.12.0; update the
DESCRIPTION Imports entry for MSstatsPTM to "MSstatsPTM (>= 2.12.0)" so older
MSstatsPTM releases won't cause unused argument runtime errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 70ae1018-7313-4f93-a4bd-b1b5269e259e

📥 Commits

Reviewing files that changed from the base of the PR and between 092a538 and ae6ce45.

📒 Files selected for processing (1)
  • R/groupComparisonLiP.R

Comment thread R/groupComparisonLiP.R
@tonywu1999 tonywu1999 merged commit 7131096 into devel Apr 7, 2026
2 checks passed
@tonywu1999 tonywu1999 deleted the fix-tests branch April 7, 2026 15:01
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