VolcanoPlot: Volcano plot

Description Usage Arguments Author(s) Examples

View source: R/VolcanoPlot.r

Description

Produces a volcano plot given fold changes and p-values.

Usage

1
2
3
4
5
6
7
8
9
VolcanoPlot(coef, pvals, cexcutoff = 0.7, cexlab = 0.5, pointsize = 0.9,
  plimit = 0.05, coeflimit = 1, negcontrol = NULL, poscontrol = NULL,
  saveplot = FALSE, plotname = "VolcanoPlot", savetype = c("png", "bmp",
  "jpeg", "tiff", "pdf"), xlab = "Coefficients", ylab = "-log(p-value)",
  labelunderlim = FALSE, labelsig = FALSE, interactiveplot = TRUE,
  saveinteractiveplot = FALSE,
  interactiveplotname = "interactiveVolcanPlot", interactiveonly = FALSE,
  main = "Volcano Plot", fclabel = "", chooselegend = NULL,
  vlines = TRUE, tolabel = NULL, ...)

Arguments

coef

A vector of coefficients with metabolite names.

pvals

A vector of corresponding p-values.

cexcutoff

Font size of the cut-off labels.

cexlab

Font size of the variable labels.

pointsize

A numeric indicating the size of the points on the graph.

plimit

A numeric indicating the p value cutoff. The default is set to 0.05.

coeflimit

A numeric indicating the lower fold cutoff. The default is set to 2.

negcontrol

A vector with the names of the metabolites used as negative controls, to be coloured differently.

poscontrol

A vector with the names of the metabolites used as positive controls, to be coloured differently.

saveplot

A logical indicator whether to save the produced plot.

plotname

A character string indicating the name to be used for saving the plot.

savetype

The required format for the plot to be saved in. Threre is a choice of "png","bmp","jpeg","tiff","pdf" type files.

xlab

x-axis label.

ylab

y-axis label.

labelunderlim

A logical indicating whether to label points that are not significant.

labelsig

A logical indicating whether all significant points should be labeled.

interactiveplot

A logical indication whether an interactive plot should be shown.

saveinteractiveplot

A logical indication whether the interactive plot produced should be saved as a .html file.

interactiveplotname

A character string indicating the name to be used for saving the interactive plot.

interactiveonly

A boolean whether only an interactive version of the plot is required

main

Plot title.

fclabel

An optional character sting to label the vertical coefficient cutoff.

chooselegend

Defualt to NULL. For internal use in other functions in the package.

vlines

A logical indicating whether to show vertical coefficient cutoff lines.

tolabel

A list of metabolite names on the graph to be labeled

...

Other graphical parameters. See par.

Author(s)

Alysha M De Livera, Gavriel Olshansky

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 data("alldata_eg")
logdata<-LogTransform(alldata_eg$featuredata)
sampledata<-alldata_eg$sampledata
metabolitedata<-alldata_eg$metabolitedata
imp <-  MissingValues(logdata$featuredata,sampledata,metabolitedata,
                     feature.cutof=0.8, sample.cutoff=0.8, method="knn")
featuredata<-imp$featuredata
qcmets<-which(metabolitedata[,1]=="IS")
factormat<-model.matrix(~gender +Age , sampledata)

#Linear model fit with ordinary statistics with ruv2
ordFit_ruv2<-LinearModelFit(featuredata=featuredata,
                           factormat=factormat,
                           ruv2=TRUE, qcmets=qcmets,
                           k=2)
#Volcano plot
VolcanoPlot(coef=ordFit_ruv2$coefficients[,3], 
           pval=ordFit_ruv2$p.value[,3],
           cexlab = 0.8, 
           interactiveplot = TRUE, 
           coeflimit = 0.05,
           xlab="Coef",
           negcontrol= rownames(ordFit_ruv2$coefficients)
           [which(metabolitedata[,2]==1)],
           poscontrol= c("m74", "m161"),
           interactiveonly = TRUE)

NormalizeMets documentation built on May 1, 2019, 10:26 p.m.