feat(plotting): Refactor QC plot headings to be compatible for protein turnover#194
feat(plotting): Refactor QC plot headings to be compatible for protein turnover#194tonywu1999 merged 6 commits intodevelfrom
Conversation
📝 WalkthroughWalkthroughThe PR refactors label and group handling logic across two utility files. Changes simplify Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
PR Type
Bug fix, Enhancement
Description
Preserve original turnover groups
Use
is_labeled_refin plotsSupport
Heavy/Lightlabel fallbackFix QC group axis handling
Diagram Walkthrough
File Walkthrough
dataProcessPlots.R
Improve turnover label and group plottingR/dataProcessPlots.R
is_labeled_refforLABELmappingHeavy/Lightlabel handlingGROUPvalues in axesutils_checks.R
Retain original grouping in validationR/utils_checks.R
GROUP_ORIGINALasGROUPSUBJECT_ORIGINALasSUBJECT"0"turnover assignmentsMotivation and Context
This PR adjusts plotting functions to properly handle protein turnover experiments, which differ from SRM (Selected Reaction Monitoring) experiments in their use of isotope labels. In protein turnover studies, both heavy (H) and light (L) labeled channels represent independent biological measurements and are processed independently. The PR refactors data preparation and plotting logic to support this distinction through the introduction of an
is_labeled_refcolumn that marks whether a row represents a labeled reference (used in SRM) versus endogenous labeled channels (used in turnover studies).Detailed Changes
R/utils_checks.R - Data Column Preparation
GROUPandSUBJECTbased onLABEL == "L", using a hardcoded sentinel value"0"for non-"L" labelsGROUPandSUBJECTfrom their original values (GROUP_ORIGINALandSUBJECT_ORIGINALrespectively)"0"sentinel value that was preventing proper group numbering in downstream processingR/dataProcessPlots.R - Profile and QC Plotting Functions
is_labeled_refcolumn detection: Both.plotProfileand.plotQCfunctions now check for the presence of theis_labeled_refcolumn"Reference"(for TRUE values) and"Endogenous"(for FALSE values) with appropriate color codinglength(unique(processed$LABEL)) == 2andGROUP == '0'; now always orders by RUN before deriving group levels and factoring GROUPUnit Tests
Existing tests in
inst/tinytest/test_dataProcess.Rvalidate theis_labeled_refcolumn behavior:is_labeled_ref=TRUEis present, protein summarization uses the labeled reference path (via.runTukeywithis_labeled_reference=TRUE)Coding Guidelines
No coding guideline violations detected. The changes maintain consistency with the existing codebase patterns for data manipulation using
data.table, conditional column operations, and factor level assignments.