Description Usage Arguments Author(s) See Also Examples
View source: R/CompareVolcanoPlots.r
Produces a volcano plot that can be sued to compare between different normalisation methods.
1 2 3 4 5 | CompareVolcanoPlots(lcoef, lpvals, normmeth = NULL, plimit = 0.05,
coeflimit = 1, yrange = NULL, negcontrol = NULL, poscontrol = NULL,
xlab = "Coefficients", ylab = "-log(p-value)", labelunderlim = FALSE,
labelsig = FALSE, saveinteractiveplot = FALSE,
interactiveplotname = "interactiveVolcanPlot", ...)
|
lcoef |
A list of vectors of coefficients with metabolite names, each vector corresponding to a different noramlization method. |
lpvals |
A list of vector of corresponding p-values. |
normmeth |
A vector with the normalization method used corresponding in order to the data supplied to be displayed on the plot. |
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. |
yrange |
A numeric for the maximum y value (scale of y-axis is -log(p-value)), can only be set to a value as big as the maximum y-value in the plots. |
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. |
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. |
saveinteractiveplot |
A logical indication whether the interactive plot produced should
be saved as a |
interactiveplotname |
A character string indicating the name to be used for saving the interactive plot. |
... |
Arguments to VolcanoPlot function |
Alysha M De Livera, Gavriel Olshansky
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | data("alldata_eg")
featuredata_eg<-alldata_eg$featuredata
dataview(featuredata_eg)
sampledata_eg<-alldata_eg$sampledata
dataview(sampledata_eg)
metabolitedata_eg<-alldata_eg$metabolitedata
dataview(metabolitedata_eg)
logdata <- LogTransform(featuredata_eg)
dataview(logdata$featuredata)
imp <- MissingValues(logdata$featuredata,sampledata_eg,metabolitedata_eg,
feature.cutof=0.8, sample.cutoff=0.8, method="knn")
dataview(imp$featuredata)
#Linear model fit using unadjusted data
factormat<-model.matrix(~gender +Age +bmi, sampledata_eg)
unadjustedFit<-LinearModelFit(featuredata=imp$featuredata,
factormat=factormat,
ruv2=FALSE)
unadjustedFit
#Linear model fit using `is' normalized data
Norm_is <-NormQcmets(imp$featuredata, method = "is",
isvec = imp$featuredata[,which(metabolitedata_eg$IS ==1)[1]])
isFit<-LinearModelFit(featuredata=Norm_is$featuredata,
factormat=factormat,
ruv2=FALSE)
isFit
#Linear model fit with ruv-2 normalization
ruv2Fit<-LinearModelFit(featuredata=imp$featuredata,
factormat=factormat,
ruv2=TRUE,k=2,
qcmets = which(metabolitedata_eg$IS ==1))
ruv2Fit
#Exploring metabolites associated with age
lcoef_age<-list(unadjusted=unadjustedFit$coefficients[,"Age"],
is_age=isFit$coefficients[,"Age"],
ruv2_age=ruv2Fit$coefficients[,"Age"])
lpvals_age<-list(unadjusted=unadjustedFit$p.value[,"Age"],
is=isFit$p.value[,"Age"],
ruv2=ruv2Fit$p.value[,"Age"])
negcontrols<-metabolitedata_eg$names[which(metabolitedata_eg$IS==1)]
CompareVolcanoPlots(lcoef=lcoef_age,
lpvals_age,
xlab="Coef",
negcontrol=negcontrols)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.