Commit 4a08b25b authored by Loup's avatar Loup
Browse files

Edit texts, labels, tooltips, ...

parent 5a0e5117
......@@ -96,7 +96,7 @@ checkCroptypesTable <- function(data) {
shiny::removeUI(selector = "#croptypeIdError")
if( sum(is.na(as.numeric(data[,"croptypeID"]))) != 0 || length(unique(data[,"croptypeID"])) != length(data[,"croptypeID"]) ) {
showErrorMessage(id = "croptypeIdError", selectorafter= "#generateLandscape",
message = "Croptype Id have to be a unique numeric")
message = "Each croptype index must be a unique numeric")
isok <- FALSE
}
......@@ -105,7 +105,7 @@ checkCroptypesTable <- function(data) {
if( sum(as.character(data[,"croptypeName"]) == "") != 0 | sum(grepl("^\\s*$",as.character(data[,"croptypeName"]))) != 0) {
showErrorMessage(id = "croptypeNameError", selectorafter= "#generateLandscape",
message = "Croptype name have to be a string")
message = "Croptype names must be strings")
#shinyjs::disable(id = "generateLandscape")
}
......@@ -114,7 +114,7 @@ checkCroptypesTable <- function(data) {
## no cultivars
if( ncol(data) <= 2) {
showErrorMessage( id = "croptypeError", selectorafter = "#generateLandscape",
message = paste0("There is no cultivars defined in croptypes"))
message = paste0("No cultivar has been defined"))
isok <- FALSE
}
else{
......@@ -122,7 +122,7 @@ checkCroptypesTable <- function(data) {
if( sum(as.numeric(value) < 0.0) != 0 | sum(as.numeric(value) > 1.0) != 0 ) {
showErrorMessage( id = "croptypeError", selectorafter = "#generateLandscape",
message = paste0("The Cultivars proportions in a Croptype should be between 0 and 1 (0% and 100%)"))
message = paste0("The proportion of every cultivar within a croptype should be between 0 and 1 (0% and 100%)"))
isok <- FALSE
}
else {
......@@ -130,7 +130,7 @@ checkCroptypesTable <- function(data) {
#message(sum_prop)
if (sum(sum_prop) != 0 ) {
showErrorMessage(id = "croptypeError", selectorafter = "#generateLandscape",
message = paste0("The Cultivars proportions in a Croptype should be equal to 1 (100%)"))
message = paste0("The sum of the proportions of all cultivars composing a Croptype should be equal to 1 (100%)"))
isok <- FALSE
}
}
......@@ -152,7 +152,7 @@ checkCultivarsTable <- function(data) {
|| sum(grepl("^\\s*$",as.character(data[,"cultivarName"]))) != 0) {
showErrorMessage(id = "cultivarsNameError", selectorafter= "#generateLandscape",
message = "Cultivars name have to be a string")
message = "Cultivar names must be strings")
isok <- FALSE
}
......@@ -160,7 +160,7 @@ checkCultivarsTable <- function(data) {
if( sum(data[,-1] < 0) != 0 ) {
showErrorMessage(id = "cultivarsZeroError", selectorafter= "#generateLandscape",
message = "Cultivars values should be >=0")
message = "Values in the 'Cultivar' table should be >=0")
isok <- FALSE
}
......@@ -168,7 +168,7 @@ checkCultivarsTable <- function(data) {
if( sum(data[,"max_density"] <= 0) != 0 || sum(data[,"max_density"] > VALUEMAX) != 0) {
showErrorMessage(id = "cultivarsStricZeroError", selectorafter= "#generateLandscape",
message = paste0("Cultivars max_density values should be between >0 and ",VALUEMAX))
message = paste0("Cultivar max_density values should be between 0 and ",VALUEMAX))
isok <- FALSE
}
......@@ -176,7 +176,7 @@ checkCultivarsTable <- function(data) {
if( sum(data[,c("growth_rate","reproduction_rate","death_rate")] > 1) != 0) {
showErrorMessage(id = "cultivarsmaxvalueError", selectorafter= "#generateLandscape",
message = paste0("Cultivars growth_rate/reproduction_rate/death_rate values should be lower than 1"))
message = paste0("Cultivar 'growth_rate' / 'reproduction_rate' / 'death_rate' values should be lower than 1"))
isok <- FALSE
}
......@@ -185,7 +185,7 @@ checkCultivarsTable <- function(data) {
|| sum(data[,- which(c("cultivarName", "growth_rate","reproduction_rate","death_rate") %in% colnames(data))] > VALUEMAX) != 0) {
showErrorMessage(id = "cultivarsValueError", selectorafter= "#generateLandscape",
message = paste0("Cultivars values should be lower than ",VALUEMAX))
message = paste0("Values in the 'Cultivar' table should be lower than ",VALUEMAX))
isok <- FALSE
}
......@@ -205,7 +205,7 @@ checkCultivarsGenesTable <- function(data){
shiny::removeUI(selector = "#cultivarsGenesValueError")
if( sum(data != 0) + sum(data != 1) != nrow(data)*ncol(data) ) {
showErrorMessage(id = "cultivarsGenesValueError", selectorafter= "#generateLandscape",
message = paste0("Genes selection in Cultivars Genes should 0 or 1"))
message = paste0("Values in the 'Cultivars and Genes' table should be either 0 or 1"))
isok <- FALSE
}
......@@ -223,7 +223,7 @@ checkGenesTable <- function(data){
if( sum(as.character(data[,1]) == "") != 0 | sum(grepl("^\\s*$",as.character(data[,1]))) != 0) {
showErrorMessage(id = "GenesNameError", selectorafter= "#generateLandscape",
message = "Genes name have to be a string")
message = "Gene names must be strings")
isok <- FALSE
}
......@@ -231,7 +231,7 @@ checkGenesTable <- function(data){
if( sum(data[,- which(colnames(data) %in% c("genesName","target_trait"))] < 0) != 0 ) {
showErrorMessage(id = "GenesNegatifError", selectorafter= "#generateLandscape",
message = "Genes values should be > 0")
message = "Values in the 'Genes' table should be > 0")
isok <- FALSE
}
......@@ -239,7 +239,7 @@ checkGenesTable <- function(data){
if( sum(data[, c("time_to_activ_exp", "time_to_activ_var", "Nlevels_aggressiveness", "tradeoff_strength")] > VALUEMAX) != 0 ) {
showErrorMessage(id = "GenesValueMaxError", selectorafter= "#generateLandscape",
message = paste0("Genes values should lower than ",VALUEMAX))
message = paste0("Values in the 'Genes' table should be lower than ",VALUEMAX))
isok <- FALSE
}
......@@ -247,23 +247,24 @@ checkGenesTable <- function(data){
if( sum(data[, c("tradeoff_strength")] <= 0) != 0 ) {
showErrorMessage(id = "GenesStrictZeroError", selectorafter= "#generateLandscape",
message = paste0("Genes tradeoff_strength value should be greater than 0"))
message = paste0("Gene 'tradeoff_strength' values should be greater than 0"))
isok <- FALSE
}
shiny::removeUI(selector = "#GenesUpper1Error")
if( sum(data[, c("efficiency", "mutation_prob", "fitness_cost")] > 1) != 0) {
showErrorMessage(id = "GenesUpper1Error", selectorafter= "#generateLandscape",
message = paste0("Genes efficiency mutation_prob fitness_cost values should lower than 1"))
message = paste0("Gene 'efficiency' / 'mutation_prob' / 'fitness_cost' values should lower than 1"))
isok <- FALSE
}
shiny::removeUI(selector = "#GenesTraitError")
if( sum(data[, c("target_trait")] == "IR") +
sum(data[, c("target_trait")] == "LAT") +
sum(data[, c("target_trait")] == "PR") +
sum(data[, c("target_trait")] == "IP") != nrow(data)) {
showErrorMessage(id = "GenesTraitError", selectorafter= "#generateLandscape",
message = paste0("Genes target_trait values can be IR, LAT and IP"))
message = paste0("Gene 'target_trait' values can be either IR, LAT, PR, or IP"))
isok <- FALSE
}
......@@ -415,7 +416,7 @@ PercentageInput <- function(inputId, label, value) {
#################################################################
### Tooltip message
#################################################################
SIGMOID_SIGMA <- "Sigma parameter of the sigmoid contamination function"
SIGMOID_SIGMA <- "Sigma parameter of the sigmoid contamination function (0 to relax density-dependence, 1 for linear dependence)"
SIGMOID_KAPPA <- "Kappa parameter of the sigmoid contamination function"
INFECTIOUS_PERIOD_VAR <- "Variance of the infectious period duration"
INFECTIOUS_PERIOD_EXP <- "Maximal expected infectious period duration"
......@@ -424,12 +425,12 @@ LATENT_PERIOD_EXP <- "Minimal expected latent period duration"
PROPAGULE_PROD_RATE <- "Maximal expected effective propagule production rate per timestep and per infectious individual"
INFECTION_RATE <- "Maximal expected infection rate of a propagule on a healthy individual"
SURVIVAL_PROB <- "Off-season survival probability of a propagule"
INOCULUM <- "Initial probability for the first host (usually parameterised as a susceptible cultivar) to be infectious (state I) at the beginning of the simulation"
INOCULUM <- "Initial probability for the first susceptible host (usually indexed by 0) to be infectious (state I) at the beginning of the simulation"
GENERATE_LANDSCAPE <- "Generates a landscape composed of fields where croptypes are allocated with controlled proportions and spatio-temporal aggregation"
RUN_SIMULATION <- "Run the simulation, depending of the parameters it can be long"
RUN_SIMULATION <- "Run the simulation (depending of the parameters it can be long)"
STOP_SIMULATION <- "Force to stop the simulation"
EXPORT_SIMULATION <- "Download a GPKG containing most of the parameters"
ROTATION_PERIOD <- "Croptypes rotation period in years. Will switch between 0 and 1 croptypes and 0 and 2 croptypes each period time. 0 mean no rotation"
ROTATION_PERIOD <- "Rotation period, in years, between two configurations: (1) croptypes 0 and 1; and (2) croptypes 0 and 2. If Rotation period is 0, there is no rotation"
CULTIVARS_TOOLTIP <- c("Name of the cultivar",
"Host individuals density (in pure crop) per surface unit at the beginning of the cropping season",
......
......@@ -122,7 +122,7 @@ server <- function(input, output, session) {
is.na(sum_prop)) {
showErrorMessage(
id = "propError", selectorafter = "#generateLandscape",
message = "The croptypes total Proportions should be equal to 1 (100%)"
message = "The sum of the proportions of all croptypes must be equal to 1 (100%)"
)
return(invisible(FALSE))
}
......@@ -131,8 +131,8 @@ server <- function(input, output, session) {
## Print Rotation labels
setRotationText <- function(list_name=NULL) {
text <- paste0("<u>1st rotation</u> : 0 (<b>",list_name[1],"</b>) and 1 (<b>",list_name[2],"</b>) croptypes")
text <- paste0(text, "<br/><u>2nd rotation</u> : 0 (<b>",list_name[1],"</b>) and 2 (<b>",list_name[3],"</b>) croptypes")
text <- paste0("<u>1st configuration</u> : croptypes 0 (<b>",list_name[1],"</b>) and 1 (<b>",list_name[2],"</b>)")
text <- paste0(text, "<br/><u>2nd configuration</u> : croptypes 0 (<b>",list_name[1],"</b>) and 2 (<b>",list_name[3],"</b>)")
text
}
......@@ -313,7 +313,7 @@ server <- function(input, output, session) {
if (input$seed < 0 || input$seed > 99999 || is.na(input$seed)) {
showErrorMessage(
id = "seedError", selectorafter = "#generateLandscape",
message = "The seed should be between 0 and 99999"
message = "The seed value should be between 0 and 99999"
)
can_gen_landscape$seed <<- FALSE
can_run_simul$seed <<- FALSE
......@@ -352,7 +352,7 @@ server <- function(input, output, session) {
if (input$inoculum > 1 || input$inoculum < 0 || is.na(input$inoculum)) {
showErrorMessage(
id = "pathoInoculumError", selectorafter = "#generateLandscape",
message = "The probability of the inoculum should be between 0 and 1"
message = "The probability of initial infection should be between 0 and 1"
)
can_run_simul$inoculum <<- FALSE
}
......@@ -867,7 +867,7 @@ server <- function(input, output, session) {
}),
canRm = advanced_mode,
rownames = FALSE,
tooltips = c("Croptypes ID (start at 0)","Croptypes Name"),
tooltips = c("Croptype index (starts at 0)","Croptype name"),
row.default = simul_params@Croptypes[1,c(1,2)],
row.cols = 1:2,
row.inc = c(1,2)
......
......@@ -96,7 +96,7 @@ landscapeTab <- {
max = 99999
)
),
shinyBS::bsTooltip("seed",title="Random Number Generator Seed", placement = "bottom", trigger="hover"),
shinyBS::bsTooltip("seed",title="Seed value for Random Number Generator", placement = "bottom", trigger="hover"),
)
)
}
......@@ -120,7 +120,7 @@ pathogenTab <- {
shiny::div(
shiny::selectInput(
inputId = "defaultPathogen",
label = "Default Pathogens",
label = "Default Pathogen",
choices = list(
"Rust" = "Rust"
),
......@@ -131,7 +131,7 @@ pathogenTab <- {
shiny::fluidRow(
shiny::numericInput(
inputId = "inoculum",
label = "Initial Prob. for the first host to be infectious",
label = "Initial probability of infection for the first susceptible host",
value = 0.0001,
min = 0.0,
max = 1.0,
......@@ -161,7 +161,7 @@ pathogenTab <- {
# ),
shiny::numericInput(
inputId = "patho_infection_rate",
label = "Maximal : infection rate of a propagule",
label = "Infection rate",
value = 0.4,
min = 0.0,
max = 2.0,
......@@ -170,7 +170,7 @@ pathogenTab <- {
shinyBS::bsTooltip("patho_infection_rate",title=INFECTION_RATE, placement = "right", trigger="hover"),
shiny::numericInput(
inputId = "patho_propagule_prod_rate",
label = "Maximal : propagule production rate",
label = "Reproduction rate (clonal)",
value = 3.125,
min = 0.0,
step = 0.4
......@@ -181,7 +181,7 @@ pathogenTab <- {
width = 4,
shiny::numericInput(
inputId = "patho_latent_period_exp",
label = "Minimal : latent period duration",
label = "Latent period duration",
value = 10,
min = 0,
max = 100,
......@@ -190,7 +190,7 @@ pathogenTab <- {
shinyBS::bsTooltip("patho_latent_period_exp",title=LATENT_PERIOD_EXP, placement = "left", trigger="hover"),
shiny::numericInput(
inputId = "patho_latent_period_var",
label = "Variance : latent period duration",
label = "Variance of the latent period duration",
value = 9,
min = 0.0,
max = 100,
......@@ -199,7 +199,7 @@ pathogenTab <- {
shinyBS::bsTooltip("patho_latent_period_var",title=LATENT_PERIOD_VAR, placement = "left", trigger="hover"),
shiny::numericInput(
inputId = "patho_infectious_period_exp",
label = "Maximal : infectious period duration",
label = "Infectious period duration",
value = 24,
min = 0,
max = 365,
......@@ -208,7 +208,7 @@ pathogenTab <- {
shinyBS::bsTooltip("patho_infectious_period_exp",title=INFECTIOUS_PERIOD_EXP, placement = "left", trigger="hover"),
shiny::numericInput(
inputId = "patho_infectious_period_var",
label = "Variance : infectious period duration",
label = "Variance of the infectious period duration",
value = 105,
min = 0,
step = 1
......@@ -219,7 +219,7 @@ pathogenTab <- {
width = 4,
shiny::numericInput(
inputId = "patho_sigmoid_kappa",
label = "Kappa : sigmoid contamination function",
label = "Contamination function: Kappa",
value = 5.333,
min = 0.0001,
max = 10,
......@@ -228,7 +228,7 @@ pathogenTab <- {
shinyBS::bsTooltip("patho_sigmoid_kappa",title=SIGMOID_KAPPA, placement = "left", trigger="hover"),
shiny::numericInput(
inputId = "patho_sigmoid_sigma",
label = "Sigma : sigmoid contamination function",
label = "Contamination function: Sigma",
value = 3,
min = 0.0,
max = 100,
......
Markdown is supported
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