Description Usage Arguments Value Author(s) Examples
Draw a volcano box plot from the object returned by stats4bioinfo::tTestPerRow.bootstrap(). This representation combines the features of a volcano plot (significance versus effect size) with the box plots, to indicate the dispersion (inter-quartille range) and extent of the bootstrapped values. The qbcissa represents the mean difference between groups. The ordinate the significance of the Welch test (sig=-log10(e-value)). Each bootstrapped test is represented by a 2-dimensional box plot, where thick bars denotes the median, the rectangle delimits the inter-quartile ranges, and the lines indicate the extent of the bootstrapped values.
1 2 3 4 5 6 7 8 9 10 | tTestPerRow.bootstrap.VolcanoBoxPlot(ttpr.result, control.type = "fdr",
support.quantile = ttpr.result$support.quantile, plot.sig.boxes = TRUE,
plot.effect.boxes = TRUE, plot.rectangles = TRUE, cex = 0.7,
xlab = "Effect size", ylab = paste(sep = "", "-log10(", control.type,
")"), density.colors = FALSE, col.boxplots = "#888888",
col.positive = "#4455DD", col.grid = "#BBBBBB", col.lines = "blue",
col.alpha = "darkred", lty.positive = "solid", lty.negative = "solid",
lty.alpha = "dashed", lwd.rectangles = 1, lwd.iqr = 3, lwd.extent = 1,
lwd.support.quantile = 1, support.ticks = 0.03, xlim = NULL,
ylim = NULL, legend.corner = "topleft", legend.cex = 0.8, ...)
|
ttpr.result |
Must be the data frame obtained with tTestPerRow.bootstrap() |
cex |
Point size, passed to plot() and lines() |
... |
Additional parameters are passed to plot() |
control.type="fdr" |
Type of control (supported: "fdr", "e.value", "p.value") |
support.quantile=ttpr.result$support.quantile |
Support quantile, i.e. the minimal fraction of significant bootstrap iterations required to declare a feature positive. By default, this value is read from the input tTestPerRow() result object. However, it can be over-written in order to estimate the impact of the threshold on support quantile on the result, without having to re-run the analysis. |
plot.sig.boxes=TRUE |
Draw boxplots for the significance (Y axis) |
plot.effect.boxes=TRUE |
Draw boxplots for the effect size (X axis) |
plot.rectangles=TRUE |
Draw inter-quartile rectangles, i.e. rectangles whose corners are defined by the first and third quartiles, on both axes. |
density.colors=FALSE |
Automatically set the colors according to feature status and local density in the Volcano space. |
col.boxplots='#888888' |
Color(s) for the boxplots. can be either a single value (same color for all boxplots), or a vector of the same length as the numer of multiple tests (rows of the result tables). |
col.positive='#4455DD' |
Color to highlight significant points (called positive). |
col.lines='blue' |
Color for the line highlighting the significance threshold |
col.alpha="darkred" |
Color for the line highlighting the significance threshold. |
col.grid=#BBBBBB |
Grid color |
lty.positive=3 |
Line types for the positive tests. |
lty.negative=1 |
Line types for the negative tests. |
lty.alpha="dashed" |
Line type for the horizontal line denoting the alpha theshold. |
lwd.rectangles=1 |
Line width for the IQR rectangles. Set to 0 to avoid drawing rectangle. |
lwd.iqr=3 |
Line width for the inter-quartile bars (thick bars from Q1 to Q"). Set to 0 to avoid drawing inter-quartile bars |
lwd.extent=1 |
Line width for the extent lines Set to 0 to avoid drawing median bars |
lwd.support.quantile=1 |
Line width for the ticks denoting support quantiles, i.e. the significance corresponding to the specified support quantile. |
support.ticks=0.03 |
Width of the ticks denoting the support cutoff. Set to 0 to avoid drawing support cutoff. |
xlab="Effect |
size" Label for the X axis |
ylab="-log10(p-value)" |
Label for the Y axis |
xlim=NULL |
Range of the X axis. Automatically computed if NULL (default). |
ylim=NULL |
Range of the Y axis. Automatically computed if NULL (default). |
legend.corner="bottomleft" |
Corner for the legend. When NULL, no legend is displayed. |
legend.cex=1 |
Font size for the legend. |
no return object
Jacques van Helden (Jacques.van-Helden@univ-amu.fr)
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ## Generate a random set with two samples from distinct
## populations A and B, characterized by and m rows (features),
## among which m1 are under H1 (mA != mB) and m0 under
## H0 (mA = mB).
m1 <- 500 ## Number of features under H_1
m0 <- 500 ## Number of features under H_0
m <- m0+m1
bootstrap.iterations <- 100
effect.size <- 1 ## Difference between means for the features under H1
sample.sizes <- c("A"=30,"B"=30)
sample.labels <- rep(names(sample.sizes), times=sample.sizes)
table(sample.labels)
row.means.g1 <- rep(0, m) ## All rows have a null mean for group 1
row.means.g2 <- c(rep(0+effect.size, m1), rep(0, m0)) ## group 2 mean differs depending on the row
rand.2grp <- data.frame(cbind(
matrix(nrow=m, ncol=sample.sizes[1], rnorm(m=row.means.g1,sd=1,n=sample.sizes[1]*m)),
matrix(nrow=m, ncol=sample.sizes[2], rnorm(m=row.means.g2,sd=1,n=sample.sizes[2]*m))))
## Apply Student t-test with classical bootstrap
## (draw samples of same size as original groups, with replacement).
## Set the support quantile to 0.9, in order to select only the features
## passing the alpha threshold in at least 90% of the iteratios.
student.bootstrap <- tTestPerRow.bootstrap(x = rand.2grp, cl=sample.labels,
iterations=bootstrap.iterations, var.equal=TRUE, support.quantile=0.9)
## Draw the volcano box plot with default parameters
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap)
## Draw the volcano box plot with max stringency on support:
## only consider as positive the rows declared positive in all bootstrap iterations
student.bootstrap.100pcsupport <- tTestPerRow.bootstrap(x = rand.2grp, cl=sample.labels,
iterations=bootstrap.iterations, var.equal=TRUE, support.quantile=1)
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap.100pcsupport)
## Only draw extent lines and median bars (from quartile 1 to quartile 3) for effect size (horizontal bars and lines)
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, lwd.extent=1, lwd.rectangles=0, lwd.iqr=3,
plot.effect.boxes=TRUE, plot.sig.boxes=FALSE)
## Only draw extent lines for effect size
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, lwd.extent=1, lwd.rectangles=0, lwd.iqr=0,
plot.effect.boxes=TRUE, plot.sig.boxes=FALSE)
## Only draw median bars, for both effect size (X axis) and significance (Y axis)
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, lwd.extent=0, lwd.rectangles=0, lwd.iqr=3)
## "Significance bootstrap volano plot": a volcano plot indicating the fluctuations of the significance across the bootstrap iterations
## Compare bootstrap volcanos with different control types
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, lwd.extent=1, lwd.rectangles=0, lwd.iqr=3, support.ticks=0.02,
control.type="p.value", plot.effect.boxes=FALSE, plot.sig.boxes=TRUE, plot.rectangles=FALSE, xlim=c(-0.7,1.7))
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, lwd.extent=1, lwd.rectangles=0, lwd.iqr=3, support.ticks=0.02,
control.type="fdr", plot.effect.boxes=FALSE, plot.sig.boxes=TRUE, plot.rectangles=FALSE, xlim=c(-0.7,1.7))
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, lwd.extent=1, lwd.rectangles=0, lwd.iqr=3, support.ticks=0.02,
control.type="e.value", plot.effect.boxes=FALSE, plot.sig.boxes=TRUE, plot.rectangles=FALSE, xlim=c(-0.7,1.7))
## Show the options to select subset of graphical elements (rectangles, box plots on each axis).
## For the sake of comparison, first plot Student t-test on the full dataset (not bootstrapped) + a Volcano CI plot (confidence intervals).
## which is included in the result.
x11(width=8, height=12)
par(mfrow=c(3,2))
par(mar=c(4,4,2,0.5))
tTestPerRow.plotVolcano(student.bootstrap$full.set.test, control.type="p.value", legend.corner="topleft", main="Volcano plot")
tTestPerRow.plotVolcano(student.bootstrap$full.set.test, control.type="p.value", legend.corner="topleft", plot.ci=TRUE, main="Confidence volcano")
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, control.type="p.value", legend.corner="topleft",
main="Effect size bootstrap volcano", plot.effect.boxes=TRUE, plot.sig.boxes=FALSE, plot.rectangles=FALSE)
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, control.type="p.value", legend.corner="topleft",
main="Significance bootstrap volcano", plot.effect.boxes=FALSE, plot.sig.boxes=TRUE, plot.rectangles=FALSE)
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, control.type="p.value", legend.corner="topleft",
main="Bootstrap volcano: quartile rectangles", plot.effect.boxes=FALSE, plot.sig.boxes=FALSE, plot.rectangles=TRUE)
tTestPerRow.bootstrap.VolcanoBoxPlot(student.bootstrap, control.type="p.value", legend.corner="topleft",
main="Bootstrap volcano: box plots", plot.effect.boxes=TRUE, plot.sig.boxes=TRUE, plot.rectangles=TRUE)
par(mfrow=c(1,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.