volcanoStatsTable: Extracts x and y axis values from objects to create input for...

View source: R/volcano_plot.R

volcanoStatsTableR Documentation

Extracts x and y axis values from objects to create input for volcano plot

Description

You can, in theory, create a volcano plot from a number of different parts of a SparrowResult() object. Most often you want to create a volcano plot from the differential expressino results, but you could imagine building a volcan plot where each point is a geneset. In this case, you would extract the pvalues from the method you like in the SparrowResult() object using the stats parameter.

Usage

volcanoStatsTable(
  x,
  stats = "dge",
  xaxis = "logFC",
  yaxis = "pval",
  idx = "idx",
  xtfrm = identity,
  ytfrm = function(vals) -log10(vals)
)

Arguments

x

A SparrowResult object, or a data.frame

stats

One of "dge" or resultNames(x)

xaxis, 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

xtfrm

A function that transforms the xaxis column to an appropriate scale for the x-axis. This is the identity function by default, because most often the logFC is plotted as is.

ytfrm

A function that transforms the yaxis column to an appropriate scale for the y-axis. This is the -log10(yval) function by default, because this is how we most often plot the y-axis.

Details

Like the volcanoPlot() function, this is mostly used by the sparrow.shiny package.

Value

a data.frame with .xv, .xy, .xvt and .xvy columns that represent the xvalues, yvalues, transformed xvalues, and transformed yvalues, respectively

Examples

mg <- exampleSparrowResult()
v.dge <- volcanoStatsTable(mg)
v.camera <- volcanoStatsTable(mg, 'camera')

lianos/sparrow documentation built on Dec. 8, 2024, 2:19 a.m.