-
Notifications
You must be signed in to change notification settings - Fork 10
Add big file diann #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Add big file diann #151
Changes from 8 commits
affd611
7ec3938
e07c645
983265e
2feabd1
ee99a00
8ced47e
1fc981c
bd4d39a
cf54d43
5c7c74b
f03f003
76933e3
6d06c88
b86880d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,15 +5,143 @@ | |
| #' | ||
| #' @param id namespace prefix for the module | ||
| #' @param parent_session session of the main calling module | ||
| #' @param is_web_server boolean indicating if the app is running on a web server | ||
| #' | ||
| #' @return input object with user selected options | ||
| #' | ||
| #' @export | ||
| #' @examples | ||
| #' NA | ||
| #' | ||
| loadpageServer <- function(id, parent_session) { | ||
| loadpageServer <- function(id, parent_session, is_web_server = FALSE) { | ||
| moduleServer(id, function(input, output, session) { | ||
|
|
||
| # == shinyFiles LOGIC FOR LOCAL FILE BROWSER ================================= | ||
| # Define volumes for the file selection. | ||
| if (!is_web_server) { | ||
| volumes <- shinyFiles::getVolumes()() | ||
|
|
||
| # Server-side logic for the shinyFiles button | ||
| shinyFiles::shinyFileChoose(input, "big_file_browse", roots = volumes, session = session) | ||
|
|
||
| # Reactive to parse and store the full file information (path, name, etc.) | ||
| # This is efficient because parseFilePaths is only called once. | ||
| local_file_info <- reactive({ | ||
| req(is.list(input$big_file_browse)) | ||
| shinyFiles::parseFilePaths(volumes, input$big_file_browse) | ||
| }) | ||
|
|
||
| # Reactive to get just the full datapath, for use in backend processing. | ||
| local_big_file_path <- reactive({ | ||
| path_info <- local_file_info() | ||
| if (nrow(path_info) > 0) path_info$datapath else NULL | ||
| }) | ||
|
|
||
| # Render just the filename for user feedback in the UI. | ||
| output$big_file_path <- renderPrint({ | ||
| req(nrow(local_file_info()) > 0) | ||
| cat(local_file_info()$name) | ||
| }) | ||
| } | ||
| else { | ||
| local_big_file_path <- reactive({ NULL }) | ||
| } | ||
|
|
||
| output$spectronaut_header_ui <- renderUI({ | ||
| req(input$filetype == 'spec', input$BIO != 'PTM') | ||
| create_spectronaut_header() | ||
| }) | ||
|
|
||
| output$spectronaut_file_selection_ui <- renderUI({ | ||
| req(input$filetype == 'spec', input$BIO != 'PTM') | ||
|
|
||
| ui_elements <- tagList() | ||
|
|
||
| if (!is_web_server) { | ||
| ui_elements <- tagList(ui_elements, create_spectronaut_mode_selector(session$ns, isTRUE(input$big_file_spec))) | ||
|
|
||
| if (isTRUE(input$big_file_spec)) { | ||
| ui_elements <- tagList(ui_elements, create_spectronaut_large_file_ui(session$ns)) | ||
| } else { | ||
| ui_elements <- tagList(ui_elements, create_spectronaut_standard_ui(session$ns)) | ||
| } | ||
| } else { | ||
| ui_elements <- tagList(ui_elements, create_spectronaut_standard_ui(session$ns)) | ||
| } | ||
|
|
||
| tagList(ui_elements, create_separator_buttons(session$ns, "sep_specdata")) | ||
| }) | ||
|
|
||
| output$diann_header_ui <- renderUI({ | ||
| req(input$filetype == 'diann', input$BIO != 'PTM') | ||
| create_diann_header() | ||
| }) | ||
|
|
||
| output$diann_file_selection_ui <- renderUI({ | ||
| req(input$filetype == 'diann', input$BIO != 'PTM') | ||
|
|
||
| ui_elements <- tagList() | ||
|
|
||
| if (!is_web_server) { | ||
| ui_elements <- tagList(ui_elements, create_diann_mode_selector(session$ns, isTRUE(input$big_file_diann))) | ||
|
|
||
| if (isTRUE(input$big_file_diann)) { | ||
| ui_elements <- tagList(ui_elements, create_diann_large_file_ui(session$ns)) | ||
| } else { | ||
| ui_elements <- tagList(ui_elements, create_diann_standard_ui(session$ns)) | ||
| } | ||
| } else { | ||
| ui_elements <- tagList(ui_elements, create_diann_standard_ui(session$ns)) | ||
| } | ||
|
|
||
| ui_elements | ||
| }) | ||
|
|
||
| output$diann_options_ui <- renderUI({ | ||
| req(input$filetype == 'diann', input$BIO != 'PTM') | ||
|
|
||
| if (!is_web_server && isTRUE(input$big_file_diann)) { | ||
| mbr_def <- if (is.null(input$diann_MBR)) TRUE else input$diann_MBR | ||
| quant_col_def <- if (is.null(input$diann_quantificationColumn)) "Fragment.Quant.Corrected" else input$diann_quantificationColumn | ||
|
|
||
| max_feature_def <- if (is.null(input$max_feature_count)) 100 else input$max_feature_count | ||
| unique_peps_def <- if (is.null(input$filter_unique_peptides)) FALSE else input$filter_unique_peptides | ||
| agg_psms_def <- if (is.null(input$aggregate_psms)) FALSE else input$aggregate_psms | ||
| few_obs_def <- if (is.null(input$filter_few_obs)) FALSE else input$filter_few_obs | ||
|
|
||
| tagList( | ||
| create_diann_large_filter_options(session$ns, mbr_def, quant_col_def), | ||
| create_diann_large_bottom_ui(session$ns, max_feature_def, unique_peps_def, agg_psms_def, few_obs_def) | ||
| ) | ||
| } else { | ||
| NULL | ||
| } | ||
| }) | ||
|
|
||
| output$spectronaut_options_ui <- renderUI({ | ||
| req(input$filetype == 'spec', input$BIO != 'PTM') | ||
|
|
||
| if (!is_web_server && isTRUE(input$big_file_spec)) { | ||
| qval_def <- if (is.null(input$filter_by_qvalue)) TRUE else input$filter_by_qvalue | ||
| excluded_def <- if (is.null(input$filter_by_excluded)) FALSE else input$filter_by_excluded | ||
| identified_def <- if (is.null(input$filter_by_identified)) FALSE else input$filter_by_identified | ||
| cutoff_def <- if (is.null(input$qvalue_cutoff)) 0.01 else input$qvalue_cutoff | ||
|
|
||
| max_feature_def <- if (is.null(input$max_feature_count)) 20 else input$max_feature_count | ||
| unique_peps_def <- if (is.null(input$filter_unique_peptides)) FALSE else input$filter_unique_peptides | ||
| agg_psms_def <- if (is.null(input$aggregate_psms)) FALSE else input$aggregate_psms | ||
| few_obs_def <- if (is.null(input$filter_few_obs)) FALSE else input$filter_few_obs | ||
|
|
||
| tagList( | ||
| create_spectronaut_large_filter_options(session$ns, excluded_def, identified_def, qval_def), | ||
| if (qval_def) create_spectronaut_qvalue_cutoff_ui(session$ns, cutoff_def), | ||
| create_spectronaut_large_bottom_ui(session$ns, max_feature_def, unique_peps_def, agg_psms_def, few_obs_def) | ||
| ) | ||
| } else { | ||
| NULL | ||
| } | ||
| }) | ||
|
Comment on lines
+100
to
+143
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Find the definitions of the bottom UI functions
fd -t f -e R . | xargs rg -l "create_diann_large_bottom_ui|create_spectronaut_large_bottom_ui"Repository: Vitek-Lab/MSstatsShiny Length of output: 156 🏁 Script executed: #!/bin/bash
# Search for these function definitions
rg -n "create_diann_large_bottom_ui\s*<-|create_diann_large_bottom_ui\s*=" R/ --type=r -A 30Repository: Vitek-Lab/MSstatsShiny Length of output: 2591 🏁 Script executed: #!/bin/bash
# Search for spectronaut function
rg -n "create_spectronaut_large_bottom_ui\s*<-|create_spectronaut_large_bottom_ui\s*=" R/ --type=r -A 30Repository: Vitek-Lab/MSstatsShiny Length of output: 2487 Shared input IDs between DIANN and Spectronaut large-file options cause stale defaults when switching file types. Both While this is a minor UX issue in practice (switching between file types is an uncommon workflow), consider isolating the input IDs per file type (e.g., 🤖 Prompt for AI Agents |
||
|
|
||
| # toggle ui (DDA DIA SRM) | ||
| observe({ | ||
| print("bio") | ||
|
|
@@ -103,15 +231,19 @@ loadpageServer <- function(id, parent_session) { | |
| enable("proceed1") | ||
| } | ||
| } else if (input$filetype == "spec") { | ||
| if(!is.null(input$specdata) && !is.null(input$sep_specdata)) { # && !is.null(input$annot) | ||
| spec_regular_file_ok <- !isTRUE(input$big_file_spec) && !is.null(input$specdata) | ||
| spec_big_file_ok <- isTRUE(input$big_file_spec) && length(local_big_file_path()) > 0 | ||
| if((spec_regular_file_ok || spec_big_file_ok) && !is.null(input$sep_specdata)) { | ||
| enable("proceed1") | ||
| } | ||
| } else if (input$filetype == "ump") { | ||
| if(!is.null(input$fragSummary) && !is.null(input$peptideSummary) && !is.null(input$protSummary)) { #&& !is.null(input$annot2) | ||
| enable("proceed1") | ||
| } | ||
| } else if (input$filetype == "diann") { | ||
| if(!is.null(input$dianndata) && !is.null(input$sep_dianndata)) { # && !is.null(input$annot) | ||
| diann_regular_file_ok <- !isTRUE(input$big_file_diann) && !is.null(input$dianndata) && !is.null(input$sep_dianndata) | ||
| diann_big_file_ok <- isTRUE(input$big_file_diann) && length(local_big_file_path()) > 0 | ||
| if(diann_regular_file_ok || diann_big_file_ok) { | ||
| enable("proceed1") | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.