mgVolcano: A module to visualize a volcano plot.

View source: R/mgVolcano-module.R

mgVolcanoR Documentation

A module to visualize a volcano plot.

Description

Users can specify logFC and FDR thresholds for which the individual dots in the volcano are rather hexbins so that the browser doesn't have to handle a single point for each gene/dot.

Usage

mgVolcano(
  input,
  output,
  session,
  x,
  stats = "dge",
  xaxis = "logFC",
  yaxis = "pval",
  idx = "idx",
  tools = c("box_select", "reset", "save"),
  width = NULL,
  height = NULL,
  highlight = shiny::reactive(NULL),
  default_xhex = 1,
  default_yhex = 0.1,
  webgl = FALSE,
  ...
)

mgVolcanoUI(
  id,
  x,
  stats = "dge",
  xaxis = "logFC",
  yaxis = "padj",
  idx = "idx",
  hexbin = TRUE,
  default_xhex = 1,
  default_yhex = 0.1
)

Arguments

input, output, session

shiny bits

x

A SparrowResult object, or a data.frame

stats

One of "dge" or resultNames(x)

xaxis

the column of the the provided (or extracted) data.frame to use for the xaxis and yaxis of the volcano

yaxis

the column of the the provided (or extracted) data.frame to use for the xaxis and yaxis of the volcano

idx

The column of the data.frame to use as the identifier for the element in the row. You probably don't want to mess with this

tools

the plotly tools to include in the figures toolbar

width

the width and height of the output plotly plot

height

the width and height of the output plotly plot

highlight

a reactive vector of featureIds that indicate which points to highlight on the volcano, irresespective of their "hexbin" status.

default_xhex, default_yhex

default values to set the slider inputs to pass in for hex-ization

webgl

use webgl to make the plotly plot

...

pass through arguments (not used)

id

the shiny id of the output widget

hexbin

boolean to indicate if the UI should show a wrench widget to configure the parameters for the hexbin drawing (default: 'TRUE')

Value

A reactive data.frame that includes the information of the genes that are brushed in the volcano plot. If no genes have been selected, then 'NULL'.

Functions

  • mgVolcanoUI: the UI for the module

Examples

sres <- sparrow::exampleSparrowResult()
app <- shiny::shinyApp(
  ui = shiny::shinyUI(shiny::fluidPage(
    exampleUISetup(),
    title = "Interactive volcano plot",
    mgVolcanoUI("mod"))),
  server = function(input, output, session) {
    src <- shiny::reactive(SparrowResultContainer(sres))
    shiny::callModule(mgVolcano, "mod", src, default_xhex = 2)
  })
if (interactive()) {
  shiny::runApp(app)
}

lianos/sparrow.shiny documentation built on Oct. 12, 2023, 2:43 a.m.