Skip to content

Commit

Permalink
additional descriptions added
Browse files Browse the repository at this point in the history
  • Loading branch information
werpuc committed Apr 5, 2024
1 parent 8d3ae3f commit 1196901
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 9 deletions.
46 changes: 41 additions & 5 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,20 @@ app_server <- function(input, output, session) {

})

output[["input_status"]] <- renderText({
fit_state_1 <- reactive({

unique(state_1_params()[["State"]])

})

fit_state_2 <- reactive({

unique(state_2_params()[["State"]])

})


output[["fit_data_status"]] <- renderText({

validate(need(!is.null(state_1_params()) & !is.null(state_2_params()), ""))

Expand All @@ -99,6 +112,27 @@ app_server <- function(input, output, session) {

})

output[["uc_data_status"]] <- renderText({

validate(need(!is.null(state_1_uc()) & !is.null(state_2_uc()), ""))

msg <- "States consistent with fit results."

if(fit_state_1() != unique(state_1_uc()[["State"]])){

msg <- "States from UC data not consistent with those from fit results."
}

if(fit_state_2() != unique(state_2_uc()[["State"]])){

msg <- "States from UC data not consistent with those from fit results."

}

msg

})

## hires calc

state_1_hires_params <- reactive({
Expand Down Expand Up @@ -252,7 +286,7 @@ app_server <- function(input, output, session) {

output[["plot_peptides_coverage_1"]] <- ggiraph::renderGirafe({

validate(need(!is.null(state_1_params()), ""))
validate(need(!is.null(state_1_params()), "Please upload necessary files."))

HRaDeX::plot_cov_class(state_1_params(),
fractional = fractional(),
Expand All @@ -264,7 +298,7 @@ app_server <- function(input, output, session) {

output[["plot_peptides_coverage_2"]] <- ggiraph::renderGirafe({

validate(need(!is.null(state_2_params()), ""))
validate(need(!is.null(state_2_params()), "Please upload necessary files."))

HRaDeX::plot_cov_class(state_2_params(),
fractional = fractional(),
Expand All @@ -276,7 +310,9 @@ app_server <- function(input, output, session) {

peptide_list <- reactive({

# browser()
validate(need(!is.null(state_1_uc()), "Please upload necessary files."))
validate(need(!is.null(state_2_uc()), "Please upload necessary files."))

HRaDeX::get_peptide_list_v2(state_1_uc(), state_2_uc())

})
Expand Down Expand Up @@ -327,7 +363,7 @@ app_server <- function(input, output, session) {
state_1_params(),
state_2_params(),
fractional = fractional(),
interactive = F)
interactive = T)

ggiraph::girafe_options(plt,
ggiraph::opts_zoom(min = .7, max = 2) )
Expand Down
18 changes: 14 additions & 4 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
#' @noRd
app_ui <- function(request) {
tagList(

# Leave this function for adding external resources
golem_add_external_resources(),
# Your application UI logic
fluidPage(
tags$style(type='text/css', '#txt_out {white-space: pre-wrap;}'),
br(),
br(),
sidebarLayout(
Expand All @@ -19,26 +21,28 @@ app_ui <- function(request) {
img(src='./www/logo_2.png', width = "40%", align = "center"),
br(),
br(),
p("Compare fit results from HRaDeX for two biological states:"),
collapsible_card(
title = "Input data",
p("Tip: Fit results can be found in the `Params` tab in HRaDeX."),
fileInput(inputId = "file_state_1_params",
label = "Provide fit results for the first state:"),
fileInput(inputId = "file_state_2_params",
label = "Provide fit results for the second state:"),
verbatimTextOutput("input_status"),
verbatimTextOutput("fit_data_status"),
p("Tip: UC data can be found in the `UC data` tab in HRaDeX."),
fileInput(inputId = "file_state_1_uc",
label = "Provide uc data for the first state:"),
fileInput(inputId = "file_state_2_uc",
label = "Provide uc data for the second state:"),
verbatimTextOutput("uc_data_status"),
fancy_icon = "cogs"
),
br(),
collapsible_card(
init_collapsed = T,
title = "UC data",
p("See the uptake curve for selected peptide in tab `Uptake Curves`"),
p("See the uptake curve for selected peptide in tab `Uptake Curves`."),
dataTableOutput_h("peptide_list_data"),
actionButton(inputId = "reset_peptide_list",
label = "Reset chosen peptides"),
Expand All @@ -53,6 +57,7 @@ app_ui <- function(request) {
fileInput(inputId = "pdb_file",
label = "PDB file: ",
accept = c(".pdb", ".cif")),
p("The structure is to be found in the tab `Structure`."),
h3("Which values should be presented on the structure?"),
fluidRow(
column(
Expand Down Expand Up @@ -125,7 +130,7 @@ app_ui <- function(request) {
ggiraph::girafeOutput("uc_diff_plot_2"),
checkboxInput(inputId = "is_diff_plot_2_fractional",
label = "See fractional data?",
value = F),
value = T),
checkboxInput(inputId = "is_diff_plot_2_squared",
label = "See squared data?",
value = F),
Expand All @@ -138,7 +143,7 @@ app_ui <- function(request) {
ggiraph::girafeOutput("uc_diff_plot"),
checkboxInput(inputId = "is_diff_fractional",
label = "See fractional data?",
value = F),
value = T),
checkboxInput(inputId = "is_diff_plot_squared",
label = "See squared data?",
value = F),
Expand All @@ -160,9 +165,14 @@ app_ui <- function(request) {
),
tabPanel(
"Classification",
br(),
p("Classification results for the first state:"),
ggiraph::girafeOutput("plot_peptides_coverage_1"),
p("Classification results for the second state:"),
ggiraph::girafeOutput("plot_peptides_coverage_2"),
p("Classification components for the first state:"),
ggiraph::girafeOutput("state_1_class_components"),
p("Classification components for the second state:"),
ggiraph::girafeOutput("state_2_class_components")
),
tabPanel(
Expand Down

0 comments on commit 1196901

Please sign in to comment.