Commit 16c0b3a7 authored by Etienne Rifa's avatar Etienne Rifa
Browse files

Debug crash with first modal input

close #6
parent 3b938309
......@@ -110,21 +110,23 @@ mod_boxplots_server <- function(id, r = r, session = session){
req(r$mt1(), r$fdata_melt())
r_values$subsetds_final_melt <- r$fdata_melt()
r_values$metadata_final <- r$mt1()
updateSelectInput(session, "feat1",
choices = unique(r_values$subsetds_final_melt[,"features"]),
selected = unique(r_values$subsetds_final_melt[,"features"])[1])
updateSelectInput(session, "fact2",
choices = names(r_values$metadata_final),
selected = names(r_values$metadata_final)[2])
updatePickerInput(session, "fact3",
choices = names(r_values$metadata_final),
selected = names(r_values$metadata_final)[2],
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"
)
)
if(is.data.frame(r$fdata_melt())){
updateSelectInput(session, "feat1",
choices = unique(r_values$subsetds_final_melt[,"features"]),
selected = unique(r_values$subsetds_final_melt[,"features"])[1])
updateSelectInput(session, "fact2",
choices = names(r_values$metadata_final),
selected = names(r_values$metadata_final)[2])
updatePickerInput(session, "fact3",
choices = names(r_values$metadata_final),
selected = names(r_values$metadata_final)[2],
options = list(
`actions-box` = TRUE,
size = 10,
`selected-text-format` = "count > 3"
)
)
}
})
......
......@@ -124,7 +124,9 @@ mod_inputs_server <- function(id, r = r, session = session){
moduleServer( id, function(input, output, session){
ns <- session$ns
r_values <- reactiveValues(subsetds_final = NULL, metadata_final = NULL, features_final = NULL, subsetds_final_melt = NULL)
r_values <- reactiveValues(merged = NULL, imported = NULL, imported2 = NULL,
subsetds_final = NULL, metadata_final = NULL,
features_final = NULL, subsetds_final_melt = NULL)
imported <- NULL
......@@ -133,10 +135,11 @@ mod_inputs_server <- function(id, r = r, session = session){
observeEvent(input$launch_modal, {
r_values$subsetds_final <- "emptytable" # for shinyalert acp / boxplot
r_values$subsetds_final_melt <- "emptytable"
r_values$merged <- NULL
import_modal(
id = ns("myid"),
from = c("file", "env", "copypaste", "googlesheets", "url"),
from = c("file"), #, "env", "copypaste", "googlesheets", "url"
title = "Import data to be used in application"
)
})
......@@ -158,8 +161,8 @@ mod_inputs_server <- function(id, r = r, session = session){
data <- reactive({
imported$data()
r_values$imported <- imported$data()
imported$data()
# dev
# read.csv("~/repository/graphstatsr/data_test/metabo_all_data_special.csv", sep ="\t")
})
......@@ -206,6 +209,8 @@ mod_inputs_server <- function(id, r = r, session = session){
# Input metadata dev
observeEvent(input$launch_modal2, {
r_values$merged <- NULL
import_modal(
id = ns("myid2"),
from = c("file", "env", "copypaste", "googlesheets", "url"),
......@@ -230,6 +235,7 @@ mod_inputs_server <- function(id, r = r, session = session){
data2 <- reactive({
r_values$imported2 <- imported2$data()
imported2$data()
# dev
......@@ -267,8 +273,8 @@ mod_inputs_server <- function(id, r = r, session = session){
)
output$table2 <- DT::renderDT({
print(class(res_filter2$filtered()))
print(str(res_filter2$filtered()))
# print(class(res_filter2$filtered()))
# print(str(res_filter2$filtered()))
res_filter2$filtered()
},
options = list(
......@@ -314,6 +320,11 @@ mod_inputs_server <- function(id, r = r, session = session){
r$mergetable <- mergetable <- eventReactive(input$mergebutton, {
print("merge")
if(is.null(r_values$imported) | is.null(r_values$imported2)){
showNotification("Please use modules for input files...", type="message", duration = 5)
}
metadata1 <- res_filter2$filtered()
row.names(metadata1) <- metadata1[,"sample.id"]
feat1 <- res_filter$filtered()
......@@ -403,6 +414,10 @@ mod_inputs_server <- function(id, r = r, session = session){
output$mergetable_DT <- DT::renderDataTable({
# req(mergetable())
if(is.null(r_values$merged)){validate('\t\t\t\t\t\t\t\t\t\tValidate each step.')}
# print("rendermergeDT")
mergetable()
},
options = list(
......@@ -419,6 +434,11 @@ mod_inputs_server <- function(id, r = r, session = session){
)
observe({
r_values$merged <- mergetable()
})
r$fdata <- reactive({
print("reactive r")
req(r_values$subsetds_final)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment