Commit b886ebd9 authored by Virgile Baudrot's avatar Virgile Baudrot
Browse files

update documentation along the simulation

parent 93b27048
......@@ -57,7 +57,11 @@ mod_tabItemDamage_ui <- function(id){
tabPanel(title = "Dose Response",
value = "DRsurvDAMAGE",
p("For LC50 (lethal concentration for 50% of the individuals), make sure the unit is the same as the one of exposure.
For the parameters provided by default, exposure is in squarred meter, so we convert LC50 in square meter (451*10000)."),
For the parameters provided by default, exposure is in squarred meter
so we convert LC50 in square meter (451*10000)."),
withMathJax(
helpText('$$\\Damage(x) = \\frac{1}{1 + (x/LC_{50})^\text{slope}}$$')
),
numericInput(inputId = ns("LC50DR"),
label = "LC50",
value = 451*10^4),
......@@ -109,6 +113,8 @@ mod_tabItemDamage_ui <- function(id){
onInitialize = I('function() { this.setValue(""); }')
)
),
p("Legend of damage units is the survival probability of larvae as provided by the histogram.
So here, damage is the daily probability of survival at each laying site."),
plotOutput(ns("mapDAMAGE"))
)
)
......
......@@ -55,10 +55,14 @@ mod_tabItemDevelopment_ui <- function(id){
selected = "devoFIX",
tabPanel(title = "Fixed",
value = "devoFIX",
p("All organisms have the same fixed life expectancy under the control situation (no exposure, no damage)"),
p("All organisms have a random life expectancy under the control situation (no exposure, no damage),
defined by a normal distribution:"),
numericInput(inputId = ns("indDevoFIX"),
label = "Fix lifespan",
value = 20)
label = "Mean of lifespan",
value = 17),
numericInput(inputId = ns("indDevoFIXsd"),
label = "Standard Deviation of lifespan",
value = 3)
),
tabPanel(title = "Degree Day",
value = "devoDD",
......@@ -103,6 +107,8 @@ mod_tabItemDevelopment_ui <- function(id){
onInitialize = I('function() { this.setValue(""); }')
)
),
p("Black dots are laying sites. A brown area around the dot is drawn when larvae emerge.
A green area around the black dot is drawn when the larvae is living."),
plotOutput(ns("mapINDIVIDUAL"))
)
)
......@@ -232,7 +238,7 @@ mod_tabItemDevelopment_server <- function(input, output, session, r){
larvaeEND <- do.call("c", lapply(DDtimeline_larvae, tail, n = 1L))
}
if(input$tabsetDEVO == "devoFIX"){
larvaeEND <- r$individualSITE[["DateEmergence"]] + input$indDevoFIX
larvaeEND <- r$individualSITE[["DateEmergence"]] + rnorm(1, input$indDevoFIX, input$indDevoFIXsd)
}
individualSITE_dev = brk_timeline( sf = st_sf(geometry = st_geometry(r$individualSITE)),
......
......@@ -235,15 +235,15 @@ mod_tabItemDispersal_ui <- function(id){
icon = icon("rocket"),
style="color: #fff; background-color: #dd4b39; border-color: #dd4b39")
),
box(title = iconed("Dispersal Probability", "cogs"),
box(title = iconed("Dispersal Probability of the source fields", "cogs"),
solidHeader = TRUE,
width = 6, status = "success",
p("For each source field uploaded previously in the item 'landscape',
the dispersal is computed according to the kernel which has been selected.
On the left, the picture represents the 9 (or less) first source fields,
the dispersal is computed according to the kernel which has been selected."),
p("On the left, the picture represents the 9 (or less) first source fields,
On the right, you can select a field to represent it."),
box(
label = "Plot only the 9 first fields",
label = "Plot only the 9 first source fields",
solidHeader = FALSE,
width = 8, status = "success",
plotOutput(ns("plotRunDISPERSAL"))
......@@ -261,7 +261,8 @@ mod_tabItemDispersal_ui <- function(id){
),
# plot the Figure
plotOutput(ns("plotDISPERSAL"))
)
),
p("Once graphics appears here, go to the Top of the page and click 'Next'.")
)
),
briskaRshinyApp::footerPage()
......
......@@ -61,13 +61,20 @@ mod_tabItemEmission_ui <- function(id){
selected = "GenerateEmission",
tabPanel(title = "Generate",
value = "GenerateEmission",
p("To generate the emission profiles, select a period of pollen emission, and define shape and scale of emission functions"),
p("To generate the emission profiles, select a period of pollen emission.
Then, define shape and scale of emission functions."),
dateRangeInput(inputId = ns("periodEMISSION"),
label = "Period - minimum 14 days",
start = "2006-06-15", # Sys.Date()-10,
end = "2006-08-15",# Sys.Date()+10,
format = "dd/mm/yyyy",
separator = " to "),
p("Pollen quantity is defined in pollen grain per square meter.
Pollen quantity = density * quantity * daily proportion."),
p("Density is a uniform law in[7,11].Daily proportion is provided by the following curve:"),
plotOutput(ns("plotEMISSIONprofile"), height = "100px"),
p("Quantity is define with shape and scale of a gamma distribution:
mean=shape*scale and variance=shape*scale^2"),
numericInput(inputId = ns("pollenSHAPE"),
label = "Pollen shape",
value = 1.6,
......@@ -107,11 +114,15 @@ mod_tabItemEmission_ui <- function(id){
solidHeader = TRUE,
width = 4,
status = "warning",
p("Adherence is the proportion of pollen in the air column over a leaf that is daily deposited on the leaf."),
numericInput(inputId = ns("betaSPREAD"),
label = "Adherence",
value = 0.2,
min = 0, max = 1),
h4("Loss rate at landscape scale:"),
p("Loss rate is the fraction of pollen deposited on the leaf that is removed every day.
This rate of removal is applied at the landscape scale. You can choose a fixed removal rate or
use a function of rainfall time serie."),
tabsetPanel(id = ns("tabsetRainfall"),
selected = "GenerateRainfall",
tabPanel(title = "Generate",
......@@ -124,17 +135,24 @@ mod_tabItemEmission_ui <- function(id){
tabPanel(title = "Load",
value = "LoadRainfall",
# ---
p("alpha(z) is the loss rate depending on a rainfall time serie z. In the following equation,
alpha_min and alpha_max are the minimum and maximum fractions of pollen that are lost and
z_alpha is the level of precipitation beyond which the loss saturates"),
withMathJax(
helpText('$$\\alpha(z) = \\max \\left( \\alpha_{min} + \\frac{\\alpha_{max} - \\alpha_{min}}{z_{\\alpha}} z ; \\alpha_{max} \\right) $$')
),
fileInput("timeserieRAINFALL",
'Choose CSV file - RAINFALL',
accept=c('text/csv', 'text/comma-separated-values,text/plain')),
numericInput(inputId = ns("lossSPREADload"),
label = "Loss rate to apply",
value = 0.1,
min = 0, max = 1),
sliderInput(inputId = ns("lossSPREADload"),
label = "Loss rate- [alpha_min,alpha_max]",
min = 0, max = 1,
value = c(0,1)),
numericInput(inputId = ns("lossThresholdSPREADload"),
label = "Thershold for 100% loss",
label = "Thershold for 100% loss - z_alpha",
value = 30,
min = 0),
hr(),
downloadButton(ns("download_timeserieRAINFALL"),
"Download Rainfall Profile",
......@@ -206,6 +224,14 @@ mod_tabItemEmission_server <- function(input, output, session, r){
readr::write_csv(briskaRshinyApp::sourceEMISSION, file)
}
)
output$plotEMISSIONprofile <- renderPlot({
ggplot() +
theme_minimal() +
labs(x = "Time step", y = "Daily proportion") +
geom_point(aes(x = 1:12,
y = c(0.0165, 0.0660, 0.1545, 0.1885, 0.1735, 0.1560, 0.1159, 0.0670, 0.0377, 0.0167, 0.0055, 0.0022)))
})
#### GENERATE
# eventReactive(input$goEmission,{
sourceEMISSION <- eventReactive(input$goEmission, {
......
......@@ -81,6 +81,9 @@ mod_tabItemExposure_ui <- function(id){
onInitialize = I('function() { this.setValue(""); }')
)
),
p("Legend of exposure units depends on emission units: default is number of pollen grain per square meter.
So here, exposure is in daily number of pollen grain per square meter.
If you provided emission profiles in another unit, then the exposure represented here will be in the same unit."),
plotOutput(ns("mapEXPOSURE"))
)
)
......
......@@ -106,6 +106,7 @@ mod_tabItemHost_ui <- function(id){
onInitialize = I('function() { this.setValue(""); }')
)
),
p("Black dots are laying sites, and a brown area is drawn when larvae emerge."),
plotOutput(ns("mapSITE"))
)
)
......@@ -168,19 +169,13 @@ mod_tabItemHost_server <- function(input, output, session, r){
updateSelectizeInput( session, "ctrlDATEemergence", selected = min(ctrlDATEemergence), choices = ctrlDATEemergence)
}
})
# DFmapSITE <- reactive({
# if(!is.null(r$individualSITE)){
# individualSITE() %>%
# dplyr::filter(DateEmergence == input$ctrlDATEemergence)
# }
# })
output$mapSITE <- renderPlot({
req(input$ctrlDATEemergence) # needed to remove the error message
ggplot() +
theme_minimal() +
geom_sf(data = r$landscapeHOST) +
geom_sf(data = r$landscapeHOST, alpha = 0.5, fill = "blue", color = "blue") +
geom_sf(data = r$individualSITE, color = "black") +
geom_sf(data = dplyr::filter(individualSITE(), DateEmergence == input$ctrlDATEemergence),
color = "#a95e26", size = 4, alpha = 0.5)
......
......@@ -183,7 +183,8 @@ mod_tabItemLandscape_ui <- function(id){
)
)
)
)
),
p("Once both source and host are ready, you have to define a landscape frame in the next box 'Frame'.")
)
),
fluidRow(
......@@ -197,6 +198,7 @@ mod_tabItemLandscape_ui <- function(id){
selected = "bufferSQUAREFRAME",
tabPanel(title = "Generate",
value = "bufferSQUAREFRAME",
p("Choose the size of the buffer, and click on the green button 'Valid'."),
numericInput(inputId = ns("squareFrameBuffer"),
label = "Size of the buffer",
value = 0.005),
......@@ -234,8 +236,10 @@ mod_tabItemLandscape_ui <- function(id){
width = 6, status = "success",
title = "Only with Load Map",
solidHeader = FALSE,
p("This graphic is optional and may not appears, but does not change the coming simulations."),
leafletOutput(ns("mapLANDSCAPE"))
)
),
p("Once all elements of the landscape are ready (source, host and frame) go back at the Top of the page and click 'Next'.")
)
),
briskaRshinyApp::footerPage()
......
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