From 22b30ddf0ea701832f7d27fa34b58cf672aec434 Mon Sep 17 00:00:00 2001 From: tonywu1999 Date: Fri, 17 Jan 2025 17:57:56 -0500 Subject: [PATCH] converter(DIANN): Enable q-value filtering accounting for MBR --- R/module-loadpage-ui.R | 3 +++ R/utils.R | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/R/module-loadpage-ui.R b/R/module-loadpage-ui.R index a20de78..7f1ba42 100644 --- a/R/module-loadpage-ui.R +++ b/R/module-loadpage-ui.R @@ -298,6 +298,9 @@ loadpageUI <- function(id) { conditionalPanel(condition = "input['loadpage-filetype'] == 'sky' || input['loadpage-filetype'] == 'spec'|| input['loadpage-filetype'] == 'diann' ", checkboxInput(ns("q_val"), "Filter with Q-value"), conditionalPanel(condition = "input['loadpage-q_val']", + conditionalPanel(condition = "input['loadpage-filetype'] == 'diann'", + checkboxInput(ns("MBR"), "MBR Enabled", value = FALSE) + ), numericInput(ns("q_cutoff"), "Q-value cutoff", 0.01, 0, 1, 0.01))), conditionalPanel(condition = "input['loadpage-filetype'] == 'open'", checkboxInput(ns("m_score"), "Filter with M-score"), diff --git a/R/utils.R b/R/utils.R index 12634a1..50fbd91 100644 --- a/R/utils.R +++ b/R/utils.R @@ -518,17 +518,20 @@ getData <- function(input) { print(input$dianndata$datapath) qvalue_cutoff = 0.01 + MBR = FALSE if (input$q_val) { qvalue_cutoff = input$q_cutoff + MBR = input$MBR } mydata = DIANNtoMSstatsFormat(data, annotation = getAnnot(input), qvalue_cutoff = qvalue_cutoff, + MBR = MBR, removeProtein_with1Feature = TRUE, removeFewMeasurements = FALSE, - use_log_file = FALSE, - MBR = FALSE) + use_log_file = FALSE + ) print("Mydata from mstats") print(mydata) }