volcanor: Creates a volcano object

Description Usage Arguments Value Note See Also Examples

View source: R/volcanor.R

Description

An object of class volcano includes all the needed information for producing a volcano plot of p-values against effect sizes or fold-changes. The goal is to seperate the pre-processing of the volcano plot elements from the graphical rendaring of the object, which could be done using any graphical device including plot_ly and plot in base R.

Usage

1
2
volcanor(x, p = "P", effect_size = "EFFECTSIZE", snp, gene, annotation1,
  annotation2, ...)

Arguments

x

A data.frame which must contain at least the following columns:

  • a p-value, must be numeric

  • a measure of the strength of association, typically an odds ratio, regression coefficient or log fold change. Must be numeric

p

A chracter string denoting the column name for the p-values. Default is p = "P". This column must be numeric or integer. Should not have missing, NA, NaN, or NULL values and should be between 0 and 1.

effect_size

A string denoting the column name for the effect size. Default is effect_size = "EFFECTSIZE". This column must be numeric or integer. Should not have missing, NA, NaN, or NULL values.

snp

A string denoting the column name for the SNP names (e.g. rs number). This argument is optional but required if you want to highlight any points. More generally, this column could be anything that identifies each point being plotted. For example, in an Epigenomewide association study (EWAS) this could be the probe name or cg number. This column should contain characters. This argument is necessary. volcanoly function

gene

A string denoting the column name for the GENE names. This column could be a character or numeric. More generally this could be any annotation information that you want to include in the plot. This argument is optional.

annotation1

A string denoting the column name for an annotation. This column could be a character or numeric. This could be any annotation information that you want to include in the plot (e.g. zscore, effect size, minor allele frequency). This argument is optional.

annotation2

A string denoting the column name for an annotation. This column could be a character or numeric. This could be any annotation information that you want to include in the plot (e.g. zscore, effect size, minor allele frequency). This argument is optional.

...

currently ignored

Value

An list object of class volcanor with the following elements

data

processed data to be used for plotting the volcano plot including the observed and expected p-values on the -log10 scale

pName, snpName, geneName, annotation1Name, annotation2Name

The names of the columns corresponding to the data provided. This information is used for annotating the plot in the volcanoly function

Note

This function will return an error if any of the p-values are NA, less than 0 or greater than 1

See Also

volcanoly

Examples

1
2
3
4
library(manhattanly)
volcanorObj <- volcanor(HapMap)
class(volcanorObj)
head(volcanorObj)

sahirbhatnagar/manhattanly documentation built on Dec. 17, 2017, 12:11 p.m.