inst/shiny/quantrra/Documentation.R

# Documentation ----------------
Documentation <- tabItem(
  tabName = 't2',
  h1('Documentation'),
  'This application was developed with the intention to provide a framework for a transparent, accesible and intuitive methodology for risk assesment. ',
  'We provide some examples for different models that can be adapted to specific scenarios. In this documentation we explain how to load a pre-existing model file, modify it, and how to creat a new mode from scratch. ',
  br(),
  'The main tab consist on 3 sections: Model table, Model tree and results',
  tags$h2('Model table'),
  'This table contains the information on how the nodes interact with each other to calculate the risk of the event. The model table can be edited inside this shiny app, you can modify the nodes names, distribution or formulas. The columns included in the table are:',
  tags$li('id. A unique identifyier for the node. Try to use short names without spaces or special characters for this variables, and do not repeat the same id for different nodes.'),
  tags$li('label. The name of the node. THis label can contain spaces or special characters. The purpose of this variable is to be a human friendly readable identifyier for the nodes'),
  tags$li('type. There are two types of nodes, In and Out. In nodes are user defined inputs that use a probability distribution to describe the probability of the event happening. 
  Out nodes are calculated by the model there can be multiple outputs and the outputs can be calculated using other outputs. '),
  tags$li('level. The hierarchy level of the node, the hierarchy order of the nodes is very important to tell the model the order of how the output nodes will be calculated. For example, if an output node O1 is dependent of another output node O2, the dependent node O2 needs to be a lower hierarchy than O1 in order to be calculated'),
  tags$li('distribution. The distributions of the input nodes, current distributions supported includes: normal, binomial, poisson and pert. Only defined for In nodes'),
  tags$li('formula. Formula used to calculate the node. Needs to be defined only for Out nodes'),
  br(),
  tags$h3('Distributions supported'),
  'To specify the distribution you must write the name of the distribution followed by the parameters. Currently there are 4 probability distributions supported.',
  tags$h4('Normal'),
  'Normal distribution has two parameters: mean and standard deviation. For example, if we want to specify a normal distribution with mean = 20 and standard deviation = 1.5, we would write ',
          tags$em('Normal(20, 1.5) '), 'in the column for the given node. For more information of the normal distribution visit: ', tags$a('https://en.wikipedia.org/wiki/Normal_distribution'),
          tags$h4('Pert'),
          'The Pert distribution has three parameters: min,mode, and max. For example, if we want to specify a pert distribution with a mode of 20, a min of 10 and a max of 35, we would write ',
          tags$em('Pert(10, 20, 35) '), 'in the column for the given node. For more information of the pert distribution visit: ', tags$a('https://en.wikipedia.org/wiki/PERT_distribution'),
          tags$h4('Binomial'),
          'The Binomial distribution has two parameters: number of trials (n) and probability of success (p). For example, if we want to specify a binomial distribution with a n of 8, a p of 0.2, we would write ',
          tags$em('Binomial(8, 0.2) '), 'in the column for the given node. For more information of the binomial distribution visit: ', tags$a('https://en.wikipedia.org/wiki/Binomial_distribution'),
          tags$h4('Poisson'),
          'The Poisson distribution has one parameters: lambda, which represents both the mean and standard deviation. For example, if we want to specify a Poisson distribution with a lambda of 10, we would write ',
          tags$em('Poisson(10) '), 'in the column for the given node. For more information of the poisson distribution visit: ', tags$a('https://en.wikipedia.org/wiki/Poisson_distribution'),
          tags$h2('Model tree'),
          'This section provide a graphical representation of the current model. You can edit the model and add new nodes in this section. To add a new node click on the edit button,
            this will change the interface to edit mode with two options: add Node and Add Edge. To exit the edit mode, click the x on the top right corner.',
          tags$h2('Loading a model file'),
          'When the app is initialized, a basic model file is already pre-loaded, you cans tart editing the provided model, or you can use another model from the examples. You can find some pre-existing model files in the ', 
          tags$em('Examples '), 'tab of this app. For more information of the example model files, you can go to the reference in the link provided',
          br(),
          # tags$img(src = 'G1.GIF', align = 'center'),
          br(),
          'Once you have downloaded, you can go back to the main tab and load the .zip file. ',
          br(),
          # tags$img(src = 'G2.GIF', align = 'center'),
          br(),
          'For questions, contact: ', tags$a("Jose Pablo Gomez", href = 'mailto:jpgo@ucdavis.edu'))


# ------------ | Examples | ----------------
Examples <- tabItem(
  tabName = 't3',
  tags$h1('Examples'),
  'In this tab you will find a library of example model files, the idea is that as more models are available this library will get populated with a diversity of model files that can be used and adapted for other diseases/regions',
  br(),
  tags$h2('PPA OIRSA'),
  'This model was developed by the Organismo Internacional Regional de Sanidad Agropecuaria (OIRSA) to estimate the probability of introduction of african swine fever into the countries from the OIRSA region', 
  br(),
  tags$a('Reference', href = 'https://www.oirsa.org/contenido/2020/AR_PPA_Edición%20revisada%2001_07_20.pdf'),
  hr(),
  downloadButton("downloadOIRSA", "Download"),
  br(),
  tags$h2('ASF Legal imports'),
  'Model used for the publication: “Quantitative Risk Assessment of African Swine Fever Introduction into Spain by Legal Import of Swine Products.” This model evaluates the risk of introduction of African Swine Fever into Spain via legal product imports.', 
  br(),
  tags$a('Reference', href = 'https://doi.org/10.1016/j.rvsc.2023.104990'),
  hr(),
  downloadButton("downloadASFP", "Download"),
  # br(),
  # tags$h2('Pleuromutilins in Denmark'),
  # 'This model was developed by Alban et. al. to evaluate the Risk to Public Health due to Use of Antimicrobials in Pigs', 
  # br(),
  # tags$a('Reference', href = 'https://www.oirsa.org/contenido/2020/AR_PPA_Edición%20revisada%2001_07_20.pdf'),
  # hr(),
  # downloadButton("downloadLis", "Download"),
  # tags$a('Download model', href ='https://www.oirsa.org/contenido/2020/AR_PPA_Edición%20revisada%2001_07_20.pdf'),
  br(),
  # tags$h2('OIE'),
  # 'Description', 
  # br(),
  # tags$a('Reference', href = 'https://rr-africa.oie.int/wp-content/uploads/2018/03/handbook_on_import_risk_analysis_-_oie_-_vol__i.pdf'),
  # downloadButton("downloadM2", "Download")
  )
jpablo91/QuantRRA documentation built on July 3, 2024, 10:46 p.m.