Skip to content

Commit

Permalink
validation on time inputs in woods plot tab
Browse files Browse the repository at this point in the history
  • Loading branch information
werpuc committed May 11, 2020
1 parent 8250b96 commit 2e06f8c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion inst/HaDeX/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ server <- function(input, output, session) {

observe({

if(input[["calc_type"]] == "relative"){
if(input[["calc_type"]] == "relative" & !input[["theory"]]){
show(id = "out_time_part")
}

Expand Down Expand Up @@ -864,6 +864,13 @@ server <- function(input, output, session) {

all_dat <- reactive({

if(!input[["theory"]]){
validate(need(as.numeric(input[["in_time"]]) < as.numeric(input[["chosen_time"]]), "In time must be smaller than chosen time."))
validate(need(as.numeric(input[["chosen_time"]]) < as.numeric(input[["out_time"]]), "Out time must be bigger than chosen time."))
}



bind_rows(lapply(states_from_file(), function(i) calculate_state_deuteration(dat(),
protein = input[["chosen_protein"]],
state = i,
Expand Down Expand Up @@ -1137,6 +1144,12 @@ server <- function(input, output, session) {
validate(need(input[["compare_states"]], "Please select at least one state."))
validate(need(length(unique(filter(dat(), !is.na("Modification"), Protein == input[["chosen_protein"]])[["State"]])) > 1, "Not sufficient number of states without modifications."))

if(!input[["theory"]]){
validate(need(as.numeric(input[["in_time"]]) < as.numeric(input[["chosen_time"]]), "In time must be smaller than chosen time."))
validate(need(as.numeric(input[["chosen_time"]]) < as.numeric(input[["out_time"]]), "Out time must be bigger than chosen time."))
}


tmp <- bind_rows(lapply(c(input[["state_first"]], input[["state_second"]]), function(i) calculate_state_deuteration(dat(),
protein = input[["chosen_protein"]],
state = i,
Expand Down

0 comments on commit 2e06f8c

Please sign in to comment.