From 5d43fcce9389c59581e5ad4218bf4b8c43c9d1c3 Mon Sep 17 00:00:00 2001 From: Daniel Claborne Date: Mon, 2 Dec 2024 14:45:04 -0800 Subject: [PATCH] Handle data.tables in MAP project objects --- DESCRIPTION | 2 +- Observers/startup_observers.R | 9 +++++++++ ui.R | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9527e32..27ab484 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: FREDA Title: An app for the processing and visualization of Fourier-transform mass spectrometry data. -Version: 1.2.2 +Version: 1.2.3 Authors@R: c(person("Lisa", "Bramer", "lisa.bramer@pnnl.gov", role = "aut", "cre"), person("Daniel", "Claborne", "daniel.claborne@pnnl.gov", role = c("aut"))) Description: A frontend application which exposes functionality of the ftmsRanalysis R package. See diff --git a/Observers/startup_observers.R b/Observers/startup_observers.R index 901a076..0631a52 100644 --- a/Observers/startup_observers.R +++ b/Observers/startup_observers.R @@ -81,6 +81,15 @@ observe({ ) } else { # store in some reactive variable that e_data and e_meta....essentially check exists and use if so. + # convert the data in ftms_obj into data.frame if it is in data.table format. + if (inherits(ftms_obj$Data$e_data, "data.table")) { + ftms_obj$Data$e_data <- as.data.frame(ftms_obj$Data$e_data) + } + + if (inherits(ftms_obj$Data$e_meta, "data.table")) { + ftms_obj$Data$e_meta <- as.data.frame(ftms_obj$Data$e_meta) + } + revals$map_project <- ftms_obj } } diff --git a/ui.R b/ui.R index 373849c..97b2df2 100644 --- a/ui.R +++ b/ui.R @@ -15,7 +15,7 @@ ui <- tagList(useShinyjs(), ), navbarPage( - title = tags$div("FREDA", tags$span(style = "font-size:small", "v1.2.2")), + title = tags$div("FREDA", tags$span(style = "font-size:small", "v1.2.3")), windowTitle = 'FREDA', id = "top_page", theme = "yeti.css",