# This script contains the function needed for the user to launch
# PeakMapper's interactive Shiny app
# Author: Daniel Fusca
#' Launch the Shiny app for running PeakMapper
#'
#' This function launches the Shiny app that allows the user to run PeakMapper
#' as an interactive session. Through this app, the user can upload BED-formatted
#' files, map uploaded peaks onto uploaded features, and visualize the results
#' of any generated mappings. The code for this Shiny app can be found in the
#' \code{shiny-scripts} directory.
#'
#' Sample BED files for uploading to the app can be found in the
#' \code{extdata} directory.
#'
#' Within this app, several blocks of code are based off of code provided in
#' some of RStudio's online Shiny tutorials - instances where app code is based
#' off of tutorial code are clearly noted within the app code, and references to
#' these tutorials are provided below. The actual code for runPeakMapperApp is
#' based off of a template for running Shiny apps presented by Anjali Silva.
#'
#' @return This function does not return anything, but running it launches a
#' session of PeakMapper's Shiny app.
#'
#' @examples
#' \dontrun{
#' runPeakMapperApp()
#' }
#'
#' @references
#' "Build a dynamic UI that reacts to user input". 15 October 2019. Accessed
#' 3 December 2019. https://shiny.rstudio.com/articles/dynamic-ui.html
#'
#' "Help users download data from your app". 28 June 2017. Accessed 3 December
#' 2019. https://shiny.rstudio.com/articles/download.html
#'
#' Winston Chang. "Changing the values of inputs from the server". Accessed
#' 3 December 2019. https://shiny.rstudio.com/gallery/update-input-demo.html
#'
#' @export
#' @importFrom shiny runApp
runPeakMapperApp <- function() {
appDir <- system.file("shiny-scripts",
package = "PeakMapper")
shiny::runApp(appDir, display.mode = "normal")
return()
}
# [END]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.