Merge Metamorpheus to MSstatsFormat Converter into Development#154
Merge Metamorpheus to MSstatsFormat Converter into Development#154tonywu1999 merged 5 commits intodevelfrom
Conversation
📝 WalkthroughWalkthroughAdds Metamorpheus ("meta") support across the load page: UI option, server enable/disable and filetype logic, getData/getDataCode handling via MetamorpheusToMSstatsFormat (using data.table::fread), NAMESPACE import, and tests. No public function signatures changed. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI as Shiny UI
participant Server as Shiny Server
participant Utils as getData / MetamorpheusToMSstatsFormat
User->>UI: select filetype = "meta" and upload QuantifiedPeaks.tsv
UI->>Server: input$filetype, infile$datapath, options
Server->>Utils: call getData(input)
Utils->>Utils: fread(datapath) -> MetamorpheusToMSstatsFormat(annotation, options)
Utils-->>Server: return MSstats-formatted data
Server-->>UI: render results / enable proceed
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
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 |
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@R/utils.R`:
- Around line 626-635: getDataCode lacks a branch for filetype 'meta' so the
generated R code omits loading and converting Metamorpheus files; add an else if
(input$filetype == 'meta') branch in the getDataCode function mirroring the
getData logic: call data.table::fread on infile$datapath and then invoke
MetamorpheusToMSstatsFormat(..., annotation = getAnnot(input), useUniquePeptide
= input$unique_peptides, removeFewMeasurements = FALSE,
removeProtein_with1Feature = input$remove, use_log_file = FALSE) so the
downloadable code reproduces the same data-loading and conversion steps as
getData.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@R/utils.R`:
- Around line 626-635: The generated code in getDataCode hardcodes
useUniquePeptide = TRUE for the Metamorpheus branch, but the runtime getData
uses input$unique_peptides; update the getDataCode branch that constructs the
MetamorpheusToMSstatsFormat call so that useUniquePeptide is set from the same
reactive (use input$unique_peptides or the variable name used when rendering
code) instead of TRUE; locate the MetamorpheusToMSstatsFormat call in
getDataCode and replace the hardcoded TRUE with the dynamic input reference to
ensure reproducibility code matches getData behavior.
| } | ||
| else if(input$filetype == 'meta') { | ||
| cat(file=stderr(), "Reached in metamorpheus\n") | ||
| data = data.table::fread(infile$datapath) |
| conditionalPanel( | ||
| condition = "input['loadpage-filetype'] && input['loadpage-DDA_DIA'] == 'LType' && input['loadpage-filetype'] != 'sample' && input['loadpage-filetype'] != 'MRF' && (input['loadpage-filetype'] != 'spec' || !input['loadpage-big_file_spec'])", | ||
| h4("Select the options for pre-processing"), | ||
| checkboxInput(ns("unique_peptides"), "Use unique peptides", value = TRUE), | ||
| checkboxInput(ns("remove"), "Remove proteins with 1 peptide and charge", value = FALSE) | ||
| ), | ||
|
|
||
| conditionalPanel( | ||
| condition = "input['loadpage-filetype'] && input['loadpage-DDA_DIA'] == 'LType' && input['loadpage-filetype'] != 'sample' && (input['loadpage-filetype'] != 'spec' || !input['loadpage-big_file_spec'])", | ||
| checkboxInput(ns("remove"), "Remove proteins with 1 feature", value = FALSE), | ||
|
|
||
| # Quality filtering options | ||
| create_quality_filtering_options(ns) | ||
| ), |
There was a problem hiding this comment.
Can you consolidate this code to just one conditional panel
conditionalPanel(
condition = "input['loadpage-filetype'] && input['loadpage-DDA_DIA'] == 'LType' && input['loadpage-filetype'] != 'sample' && (input['loadpage-filetype'] != 'spec' || !input['loadpage-big_file_spec'])",
h4("Select the options for pre-processing"),
checkboxInput(ns("unique_peptides"), "Use unique peptides", value = TRUE),
checkboxInput(ns("remove"), "Remove proteins with 1 feature", value = FALSE),
# Quality filtering options
create_quality_filtering_options(ns)
),
I noticed there were duplicate checkboxes with the same namespace 'remove'. After thinking about it, I can confirm there should only been one checkbox.
Motivation & context
Short solution summary
Detailed list of changes
R/module-loadpage-ui.R
R/module-loadpage-server.R
R/utils.R
NAMESPACE and R/MSstatsShiny.R
Tests
Unit tests added or modified
Coding guidelines check