Skip to content

Fix build#46

Open
tonywu1999 wants to merge 2 commits intodevelfrom
fix-build
Open

Fix build#46
tonywu1999 wants to merge 2 commits intodevelfrom
fix-build

Conversation

@tonywu1999
Copy link
Contributor

@tonywu1999 tonywu1999 commented Mar 5, 2026

Motivation and Context

Please include relevant motivation and context of the problem along with a short summary of the solution.

Changes

Please provide a detailed bullet point list of your changes.

Testing

Please describe any unit tests you added or modified to verify your changes.

Checklist Before Requesting a Review

  • I have read the MSstats contributing guidelines
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have run the devtools::document() command after my changes and committed the added files

Motivation and Context

This PR fixes a critical build issue related to how msstatsLiP invokes the groupComparisonPTM function from the MSstatsPTM package. The previous invocation used positional arguments which could lead to parameter misalignment or compatibility issues with the upstream MSstatsPTM package. By refactoring the call to use explicit named parameters, the code becomes more maintainable and compatible with the MSstatsPTM API contract.

Changes

  • Package Version Update: Bumped version from 1.17.0 to 1.17.1 in DESCRIPTION file
  • RoxygenNote Update: Incremented RoxygenNote from 7.3.2 to 7.3.3 in DESCRIPTION file
  • Refactored groupComparisonPTM Invocation in R/groupComparisonLiP.R (lines 87-100):
    • Changed from positional argument form to fully named parameter form
    • Explicitly specified ptm_label_type = "LF" and protein_label_type = "LF" parameters
    • Added explicit moderated = FALSE and adj.method = "BH" parameters
    • Retained and properly mapped log_base parameter
    • Added explicit save_fitted_models = TRUE parameter to preserve fitted model objects
    • Renamed and mapped path variable to log_file_path parameter for clarity
    • Maintained existing log file control parameters: use_log_file, append, verbose
  • Documentation Updates in R/groupComparisonLiP.R:
    • Added @inheritParams MSstatsPTM::groupComparisonPTM to inherit parameter documentation from the upstream package
  • Documentation Updates in man/groupComparisonLiP.Rd:
    • Clarified log_base parameter description to specify it applies only to non-TMT experiments
    • Updated description to define its role as "the base of the logarithm used in summarization"
  • No API Changes: The public function signature of groupComparisonLiP remains unchanged; only internal implementation details were modified

Testing

The existing comprehensive test suite in inst/tinytest/test_groupComparisonLiP.R validates the functionality:

  • Tests for error handling with missing or invalid input data (null LiP data raises error; null TrP data is allowed)
  • Tests verify silent execution with valid input data
  • Tests confirm function returns a list with expected structure containing LiP.Model, TrP.Model, and Adjusted.LiP.Model as data.tables
  • Tests validate expected column names in each returned model output:
    • LiP.Model: FULL_PEPTIDE, Label, log2FC, SE, Tvalue, DF, pvalue, adj.pvalue, issue, MissingPercentage, ImputationPercentage, ProteinName, PeptideSequence
    • TrP.Model: Protein, Label, log2FC, SE, Tvalue, DF, pvalue, adj.pvalue, issue, MissingPercentage, ImputationPercentage
    • Adjusted.LiP.Model: FULL_PEPTIDE, Label, log2FC, SE, Tvalue, DF, pvalue, adj.pvalue, GlobalProtein, Adjusted, ProteinName, PeptideSequence, issue
  • No new tests were added for this PR; existing tests remain unchanged and functional

Coding Guidelines

No coding guideline violations were detected. The refactoring to use named parameters is a best practice that improves code maintainability and reduces the risk of argument ordering errors when interfacing with external package functions. This change aligns with R package development best practices for calling functions with multiple parameters.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

Package version bumped to 1.17.1 with RoxygenNote updated to 7.3.3. Internal function call to groupComparisonPTM refactored from positional to keyword arguments in groupComparisonLiP.R. Documentation clarified for the log_base parameter.

Changes

Cohort / File(s) Summary
Package Metadata
DESCRIPTION
Version bumped from 1.17.0 to 1.17.1; RoxygenNote updated from 7.3.2 to 7.3.3.
Function Implementation
R/groupComparisonLiP.R
Internal call to groupComparisonPTM refactored to use keyword arguments with explicit parameters (ptm_label_type, protein_label_type, moderated, adj.method, save_fitted_models) replacing previous positional argument form.
Documentation
man/groupComparisonLiP.Rd
log_base parameter description clarified to specify non-TMT experiments only and its role in logarithm base during summarization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit hops through version vines,
With keywords neat and arguments aligned,
The code now speaks in clearer tones,
Each parameter in its rightful zone. 🐰
From 1.17.0 to 1.17.1 we shine,
Small bumps and docs make all just fine! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Fix build' is extremely vague and does not accurately reflect the actual changes, which involve fixing MSstatsPTM invocation and version bumps. Replace with a more specific title like 'Fix groupComparisonLiP invocation of MSstatsPTM and bump version' to clearly convey the primary changes.
Description check ⚠️ Warning The description is incomplete; all substantive sections (Motivation and Context, Changes, Testing) contain only template placeholders with no actual content filled in. Fill in Motivation and Context with the problem being addressed, add detailed bullet points in Changes describing the invocation fix and version bump, and describe any testing performed.
✅ Passed checks (1 passed)
Check name Status Explanation
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 unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-build

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@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 `@DESCRIPTION`:
- Line 4: Add an explicit version bound for MSstatsPTM in the DESCRIPTION
Imports to require MSstatsPTM (>= 2.10.0) so runtime calls to groupComparisonPTM
from groupComparisonLiP that pass the new ptm_label_type and protein_label_type
parameters won't fail on older installs; update the Imports entry to include
"MSstatsPTM (>= 2.10.0)" ensuring the package dependency is enforced at install
time.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ec82cf01-98ee-4c75-9b51-8c3863aaaff3

📥 Commits

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

📒 Files selected for processing (3)
  • DESCRIPTION
  • R/groupComparisonLiP.R
  • man/groupComparisonLiP.Rd

Package: MSstatsLiP
Title: LiP Significance Analysis in shotgun mass spectrometry-based proteomic experiments
Version: 1.17.0
Version: 1.17.1
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

git ls-files | head -20

Repository: Vitek-Lab/MSstatsLiP

Length of output: 518


🏁 Script executed:

cat -n DESCRIPTION | head -40

Repository: Vitek-Lab/MSstatsLiP

Length of output: 2352


🏁 Script executed:

fd -t f "groupComparisonLiP" -x cat -n {}

Repository: Vitek-Lab/MSstatsLiP

Length of output: 13499


🌐 Web query:

MSstatsPTM groupComparisonPTM function parameters ptm_label_type protein_label_type version history

💡 Result:

groupComparisonPTM() parameters: ptm_label_type, protein_label_type

  • ptm_label_type: labeling type for the PTM dataset; must be "LF" or "TMT" (default "LF"). [1,2]
  • protein_label_type: labeling type for the PROTEIN (global proteome) dataset; must be "LF" or "TMT" (default "LF"). [1,2]

These parameters let MSstatsPTM run group comparisons even when the PTM and global-protein datasets use different labeling types (e.g., PTM is TMT but the proteome is label-free). [3]

Version / history (what changed, and when)

  • Older MSstatsPTM (e.g., v2.0.3; Bioconductor 3.16, published 2023-04-10): groupComparisonPTM() used data.type (no ptm_label_type / protein_label_type). [4]
  • Current MSstatsPTM (v2.13.0; Bioconductor 3.23, published 2026-03-03): groupComparisonPTM() includes ptm_label_type and protein_label_type, and notes that data.type “will be deprecated” in favor of the two new parameters. [1]
  • The planned backwards-incompatible change was announced 2025-03-19, stating data.type would be replaced by ptm_label_type + protein_label_type, and advising for backward compatibility to set both new parameters to the old data.type value. [3]

Practical migration rule: if you previously did data.type = "LF" (or "TMT"), now do ptm_label_type="LF", protein_label_type="LF" (or both "TMT"), unless you intentionally want them to differ. [1,3]

References:
[1] Bioconductor MSstatsPTM 2.13.0 PDF manual (Bioc 3.23; published 2026-03-03). (bioconductor.posit.co)
[2] MSstatsPTM reference manual (HTML) documenting allowed values for ptm_label_type / protein_label_type. (bioc.r-universe.dev)
[3] MSstats Google Group announcement (2025-03-19) describing the parameter change and rationale. (groups.google.com)
[4] Bioconductor MSstatsPTM 2.0.3 PDF manual (Bioc 3.16; published 2023-04-10). (bioconductor.statistik.uni-dortmund.de)

Citations:


🏁 Script executed:

# Check if there are any version constraints in the codebase that reference MSstatsPTM versions
rg "MSstatsPTM.*>=" --type r
rg "MSstatsPTM.*version" --type r

Repository: Vitek-Lab/MSstatsLiP

Length of output: 46


🏁 Script executed:

# Check NAMESPACE file for any hints about MSstatsPTM
cat NAMESPACE

Repository: Vitek-Lab/MSstatsLiP

Length of output: 2530


🏁 Script executed:

# Check if there are any recent git commits or documentation that reference MSstatsPTM version requirements
rg "2\.[0-9]+\.[0-9]+" --type text DESCRIPTION README* 2>/dev/null | head -20

Repository: Vitek-Lab/MSstatsLiP

Length of output: 46


🌐 Web query:

MSstatsPTM version 2.1 2.2 2.3 ptm_label_type protein_label_type introduced when release date

💡 Result:

When were ptm_label_type / protein_label_type introduced?

They replaced the old single data.type parameter for groupComparisonPTM() as part of the Bioconductor 3.21 cycle; MSstatsPTM 2.10.0 (Date/Publication: 2025-04-15) is documented in Bioconductor materials for that release series. [1] (The change was announced ahead of time for the “upcoming MSstats 3.21 bioconductor release”.) [2]

You can see the old interface (data.type) in MSstatsPTM 2.0.3 examples. [2]
You can see the new interface (ptm_label_type, protein_label_type) in current manuals (e.g., dataProcessPTM() and groupComparisonPTM()). [3]


Release dates for MSstatsPTM 2.1 / 2.2 / 2.3 (Bioconductor evidence)

From the Bioconductor package archives I could access:

Version Release date (archive timestamp / Date/Publication) Source
2.2.0 2023-06-26 Bioc 3.17 archive listing [4]
2.2.2 2023-06-28 Bioc 3.17 archive listing [4]
2.1.x Not found in the Bioconductor archives I checked (no Bioc archive entry located)
2.3.x Not found in the Bioconductor archives I checked (no Bioc archive entry located)

If you want, tell me whether you mean Bioconductor releases specifically (recommended for “release date”), or GitHub tags/releases—and I can look up whether 2.1.x / 2.3.x exist as GitHub-only versions.


🌐 Web query:

MSstatsPTM changelog release notes ptm_label_type protein_label_type

💡 Result:

  • Where this change is documented (release notes / changelog context):

    • In the MSstats community announcement for the upcoming Bioconductor MSstats 3.21 release (posted Mar 19, 2025): groupComparisonPTM()’s data.type parameter is being replaced by two new parameters: ptm_label_type and protein_label_type, to support cases where PTM and proteome data use different label types (e.g., PTM=TMT, protein=LF). Back-compat guidance: set both new parameters to the old data.type value. [1]
  • What the current MSstatsPTM docs say:

    • In the MSstatsPTM reference manual, groupComparisonPTM() still lists data.type but states it “will be deprecated in favor of ptm_label_type and protein_label_type, and documents both new args as accepting LF or TMT. [2]
    • The manual also documents dataProcessPTM() as taking ptm_label_type and protein_label_type explicitly (same allowed values: LF/TMT). [2]

Sources:
[1] MSstats Google Group announcement (Mar 19, 2025): “Upcoming Backwards-Incompatible Changes in MSstats 3.21 – Action Required”
[2] Bioconductor MSstatsPTM manual (PDF), sections for groupComparisonPTM and dataProcessPTM


Add MSstatsPTM (>= 2.10.0) version constraint in Imports before releasing.

groupComparisonLiP() calls groupComparisonPTM() with ptm_label_type and protein_label_type parameters, which were introduced in MSstatsPTM 2.10.0 (Bioconductor 3.21, released ~April 2025). Without a version bound, installations with older MSstatsPTM versions will fail at runtime.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@DESCRIPTION` at line 4, Add an explicit version bound for MSstatsPTM in the
DESCRIPTION Imports to require MSstatsPTM (>= 2.10.0) so runtime calls to
groupComparisonPTM from groupComparisonLiP that pass the new ptm_label_type and
protein_label_type parameters won't fail on older installs; update the Imports
entry to include "MSstatsPTM (>= 2.10.0)" ensuring the package dependency is
enforced at install time.

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