diff --git a/DESCRIPTION b/DESCRIPTION index 74bdc07..d802e0c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,8 +8,8 @@ Authors@R: c( person("Looso", "Mario", email = "mario.looso@mpi-bn.mpg.de", role = "aut")) Description: This package provides modules for web-based tools that use plot based strategies to visualize and analyze multi-omics data. 'wilson' utilizes the 'shiny' and 'plotly' frameworks to provide a user friendly dashboard for interactive plotting. -URL: https://github.molgen.mpg.de/loosolab/wilson -BugReports: https://github.molgen.mpg.de/loosolab/wilson/issues +URL: https://github.molgen.mpg.de/loosolab/wilson/ +BugReports: https://github.molgen.mpg.de/loosolab/wilson/issues/ License: MIT + file LICENSE Encoding: UTF-8 LazyData: true @@ -47,4 +47,7 @@ Imports: shiny, methods, R6 RoxygenNote: 6.0.1 -biocViews: +biocViews: +Suggests: knitr, + rmarkdown +VignetteBuilder: knitr diff --git a/README.md b/README.md index 8555793..72c98fe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # WIlsON: Webbased Interactive Omics visualizatioN - The R Package -*Buildkite:* [![Build status](https://badge.buildkite.com/d79f55bb3e3cf0d70d6784feb8c6e26182d602f534e74fac4e.svg?branch=master)](https://buildkite.com/loosolab/wilson) +*Buildkite:* [![Build status](https://badge.buildkite.com/d79f55bb3e3cf0d70d6784feb8c6e26182d602f534e74fac4e.svg?branch=master)](https://buildkite.com/loosolab/wilson/) ## Abstract #### Objective @@ -12,9 +12,9 @@ The WIlsON R package employs the R Shiny and Plotly web-based frameworks using a The WIlsON R package includes a toolbox of R Shiny modules that can be used to construct a wide array of web-interfaces for plotting feature-based data. ## Availability -All components of the WIlsON R package have been implemented in an integrated web application that is available for download from the Github repository [wilson-apps](https://github.molgen.mpg.de/loosolab/wilson-apps) and can be tested on our [official demonstration server](http://loosolab.mpi-bn.mpg.de/apps/wilson/). +All components of the WIlsON R package have been implemented in an integrated web application that is available for download from the Github repository [wilson-apps](https://github.molgen.mpg.de/loosolab/wilson-apps/) and can be tested on our [official demonstration server](http://loosolab.mpi-bn.mpg.de/apps/wilson/). -Usage instructions can be found in the extensive [documentation](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki). +Usage instructions can be found in the extensive [documentation](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki/). Get a Docker container [here](https://hub.docker.com/r/loosolab/wilson/). @@ -37,7 +37,7 @@ CLARION: generiC fiLe formAt foR quantItative cOmparsions of high throughput scr CLARION is a data format especially developed to be used with WIlsON, which relies on a tab-delimited table with a metadata header to describe the following columns. It is based on the Summarized Experiment format and supports all types of data which can be reduced to features and their annotation (e.g. genes, transcripts, proteins, probes) with assigned numerical values (e.g. count, score, log2foldchange, z-score, p-value). Most result tables derived from RNA-Seq, ChIP/ATAC-Seq, Proteomics, Microarrays, and many other analyses can thus be easily reformatted to become compatible without having to modify the code of WIlsON for each specific experiment. -Please check the following link for details considering the [CLARION format](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki/CLARION-Format). +Please check the following link for details considering the [CLARION format](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki/CLARION-Format/). ## How to cite *Schultheis H, Kuenne C, Preussner J, Wiegandt R, Fust A, Bentsen M, Looso M*. WIlsON: Webbased Interactive Omics VisualizatioN. (2018), doi: https://XY diff --git a/vignettes/intro.Rmd b/vignettes/intro.Rmd new file mode 100644 index 0000000..d9c145d --- /dev/null +++ b/vignettes/intro.Rmd @@ -0,0 +1,87 @@ +--- +title: "Introduction" +author: "Hendrik Schultheis" +date: "`r Sys.Date()`" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Vignette Title} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` + +This vignette describes the intended workflow and usage of the wilson package for building an application and provides a simple example. + +**Prerequisites:** + +* be familiar with the basic structure of a [shiny-app](https://shiny.rstudio.com/articles/basics.html) and [shinydashboard](https://rstudio.github.io/shinydashboard/get_started.html) +* know how to use [shiny-modules](https://shiny.rstudio.com/articles/modules.html#using-modules) +* have a sufficient dataset in clarion-format + * either by [converting](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki/CLARION-Format/) your own data + * or downloading from [here](https://github.molgen.mpg.de/loosolab/wilson-apps/tree/master/wilson-basic/data/) + +## Workflow + +The workflow of a wilson-application can roughly be divided into three basic steps: + +1. load data +2. filter data +3. visualize data + +But depending on the actual implementation neither the order nor the number of steps are set. Resulting in enhanced usability as for example the filter can be changed at any given time. + +## Example + +In this example we will create a wilson-application with a static dataset, a single visualization method and a preceding filter, seperated into a *Filter* and a *Visualization* tab. + +So to start we first import the needed packages and afterwards define the application interface: +``` +library(shiny) +library(shinydashboard) +library(wilson) + +# Define UI for application +ui <- dashboardPage( + header = dashboardHeader(disable = TRUE), + sidebar = dashboardSidebar(disable = TRUE), + body = dashboardBody( + tags$style(type = "text/css", "body {padding-top: 50px;}"), + navbarPage( + title = "wilson example", + position = "fixed-top", + tabPanel(title = "Filter", + # Load filter UI + featureSelectorUI(id = "filter")), + tabPanel(title = "Visualization", + # Load scatterplot UI + scatterPlotUI(id = "scatter")) + ))) +``` +This code creates an UI with two tabs. The first tab with the title *Filter* contains the filter UI called with `featureSelectorUI()` whereas the UI needed for a scatterplot called with `scatterPlotUI()` is enclosed by the second tab (*Visualization*). + +Second the server function needs to be as follows: +``` +# Define server logic required for filtering and plotting +server <- function(input, output, session) { + # load/ parse data + # change this path to match your file location + data <- parser("../wilson-apps/wilson-basic/data/A_RNAseq_Zhang_2015.se") + + # Load filter server logic + filtered_data <- callModule(module = featureSelector, id = "filter", clarion = data) + # Load scatterplot server logic + callModule(module = scatterPlot, id = "scatter", clarion = reactive(filtered_data()$object)) +} + +# Run the application +shinyApp(ui = ui, server = server) +``` +The server is what reacts to user interaction whithin the interface. Once started it will first parse the given [clarion](https://github.molgen.mpg.de/loosolab/wilson-apps/wiki/CLARION-Format/) file into a clarion object, performing validation steps in the process. Next the server parts of the respecting [modules](https://shiny.rstudio.com/articles/modules.html) defined in the UI (notice the matching ids) are loaded. Whereas the filter module bluntly accepts the data object with `clarion = data` the plot module receives its data via `clarion = reactive(filtered_data()$object)`. Wrapping in `reactive()` is due to the fact, that the filtered data object returned from the filter module is in a reactive context which essentially means shiny 'knows' when this variable changes. Read more about shiny's reactivity system [here](https://shiny.rstudio.com/articles/reactivity-overview.html). + +For a more advanced example of a wilson-application see the [wilson-basic app](https://github.molgen.mpg.de/loosolab/wilson-apps/blob/master/wilson-basic/app.R) in our [wilson-apps](https://github.molgen.mpg.de/loosolab/wilson-apps/) repository.