Title: | A test for when to use quantile normalization |
---|---|
Description: | A data-driven test for the assumptions of quantile normalization using raw data such as objects that inherit eSets (e.g. ExpressionSet, MethylSet). Group level information about each sample (such as Tumor / Normal status) must also be provided because the test assesses if there are global differences in the distributions between the user-defined groups. |
Authors: | Stephanie Hicks [aut, cre] , Rafael Irizarry [aut] |
Maintainer: | Stephanie Hicks <[email protected]> |
License: | GPL-3 |
Version: | 1.41.0 |
Built: | 2024-10-31 03:51:02 UTC |
Source: | https://github.com/bioc/quantro |
Accessors for the 'anova' slot of a quantro object.
anova(object, ...) ## S4 method for signature 'quantro' anova(object) ## S4 method for signature 'quantro' anova(object)
anova(object, ...) ## S4 method for signature 'quantro' anova(object) ## S4 method for signature 'quantro' anova(object)
object |
a |
... |
other |
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) anova(qtest)
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) anova(qtest)
This is the script used to create a subset of the FlowSorted.DLPFC.450k data set from Bioconductor. The purpose is to create an example object for the man pages and vignette in this package.
The object was created using the script in /inst and located in the /data folder.
A MethylSet object with 1e4 rows (probes) and 58 columns (samples).
Box plots of the columns of a matrix, but the columns are ordered and colored by a group-level variable
matboxplot( object, groupFactor, las = 3, brewer.n = 8, brewer.name = "Dark2", ... )
matboxplot( object, groupFactor, las = 3, brewer.n = 8, brewer.name = "Dark2", ... )
object |
object an object which is inherited from an
|
groupFactor |
a factor variable representing which
group each column in |
las |
a numeric in (0, 1, 2, 3) to orient the axis labels. Default is 3 (always vertical). |
brewer.n |
the number of colors in the palette from the RColorBrewer package. Default is 8. |
brewer.name |
the name of the palette from the RColorBrewer package. Default is "Dark2". |
... |
other arguments that can be passed to the codeboxplot function. |
A box plot for each column in object
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) matboxplot(object = p, groupFactor = pd$CellType)
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) matboxplot(object = p, groupFactor = pd$CellType)
Plots the density of the columns of a matrix
matdensity( object, groupFactor = NULL, type = "l", lty = 1, brewer.n = 8, brewer.name = "Dark2", ... )
matdensity( object, groupFactor = NULL, type = "l", lty = 1, brewer.n = 8, brewer.name = "Dark2", ... )
object |
object an object which is inherited from an
|
groupFactor |
an optional factor variable representing which
group each column in |
type |
the type of lines to plot. Default type is line ("l"). |
lty |
the line type. Default is the solid line. |
brewer.n |
the number of colors in the palette from the RColorBrewer package. Default is 8. |
brewer.name |
the name of the palette from the RColorBrewer package. Default is "Dark2". |
... |
other arguments that can be passed to the codematplot function. |
A density plot for each column in object
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) matdensity(object = p, groupFactor = pd$CellType, xlab = "beta values", ylab = "density")
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) matdensity(object = p, groupFactor = pd$CellType, xlab = "beta values", ylab = "density")
Accessors for the 'MSbetween' slot of a quantro object.
MSbetween(object) ## S4 method for signature 'quantro' MSbetween(object) ## S4 method for signature 'quantro' MSbetween(object)
MSbetween(object) ## S4 method for signature 'quantro' MSbetween(object) ## S4 method for signature 'quantro' MSbetween(object)
object |
a |
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) MSbetween(qtest)
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) MSbetween(qtest)
Accessors for the 'MSwithin' slot of a quantro object.
MSwithin(object) ## S4 method for signature 'quantro' MSwithin(object) ## S4 method for signature 'quantro' MSwithin(object)
MSwithin(object) ## S4 method for signature 'quantro' MSwithin(object) ## S4 method for signature 'quantro' MSwithin(object)
object |
a |
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) MSwithin(qtest)
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) MSwithin(qtest)
quantro
function.This function plots the histogram of the
null test statistics from permutation test in the quantro
function.
quantroPlot( object, savePlot = FALSE, xLab = NULL, yLab = NULL, mainLab = NULL, binWidth = NULL )
quantroPlot( object, savePlot = FALSE, xLab = NULL, yLab = NULL, mainLab = NULL, binWidth = NULL )
object |
a quantro object from |
savePlot |
a TRUE/FALSE object argument determining if the plot will be saved for further use or immediately displayed on the screen. |
xLab |
label for x-axis |
yLab |
label for y-axis |
mainLab |
title of plot |
binWidth |
binwidth or histogram. Default is the stat_bin default. |
A histogram will be plotted containing the null
test statistics when using boostrapped samples.
The red line is the observed test statistic
quantroStat
from quantro()
.
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) library(doParallel) registerDoParallel(cores=4) qtest <- quantro(p, pd$CellType, B = 100) quantroPlot(qtest)
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) library(doParallel) registerDoParallel(cores=4) qtest <- quantro(p, pd$CellType, B = 100) quantroPlot(qtest)
Accessors for the 'quantroPvalPerm' slot of a quantro object.
quantroPvalPerm(object) ## S4 method for signature 'quantro' quantroPvalPerm(object) ## S4 method for signature 'quantro' quantroPvalPerm(object)
quantroPvalPerm(object) ## S4 method for signature 'quantro' quantroPvalPerm(object) ## S4 method for signature 'quantro' quantroPvalPerm(object)
object |
a |
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) quantroPvalPerm(qtest)
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) quantroPvalPerm(qtest)
Accessors for the 'quantroStat' slot of a quantro object.
quantroStat(object) ## S4 method for signature 'quantro' quantroStat(object) ## S4 method for signature 'quantro' quantroStat(object)
quantroStat(object) ## S4 method for signature 'quantro' quantroStat(object) ## S4 method for signature 'quantro' quantroStat(object)
object |
a |
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) quantroStat(qtest)
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) quantroStat(qtest)
Accessors for the 'quantroStatPerm' slot of a quantro object.
quantroStatPerm(object) ## S4 method for signature 'quantro' quantroStatPerm(object) ## S4 method for signature 'quantro' quantroStatPerm(object)
quantroStatPerm(object) ## S4 method for signature 'quantro' quantroStatPerm(object) ## S4 method for signature 'quantro' quantroStatPerm(object)
object |
a |
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) quantroStatPerm(qtest)
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) quantroStatPerm(qtest)
This is a function that tests for global differences between groups of distributions which asses whether global normalization methods such as quantile normalization should be applied. This function defines the quantro class and constructor.
quantro( object, groupFactor = NULL, B = 0, qRange = NULL, useMedianNormalized = TRUE, verbose = TRUE )
quantro( object, groupFactor = NULL, B = 0, qRange = NULL, useMedianNormalized = TRUE, verbose = TRUE )
object |
an object which is inherited from an
|
groupFactor |
a group level factor associated with
each sample or column in the |
B |
number of permutations to assess statistical significance
in a permutation test. Default |
qRange |
the range of quantiles to consider. Default is
|
useMedianNormalized |
TRUE/FALSE argument specifying if the median normalized data should be used or not as input to test for global differences between distributions. Default is TRUE. |
verbose |
TRUE/FALSE argument specifying if verbose messages should be returned or not. Default is TRUE. |
Quantile normalization is one of the most widely used normalization tools for data analysis in genomics. Although it was originally developed for gene expression microarrays it is now used across many different high-throughput applications including RNAseq and ChIPseq. The methodology relies on the assumption that observed changes in the empirical distribution of samples are due to unwanted variability. Because the data is transformed to remove these differences it has the potential to remove interesting biologically driven global variation. Therefore, applying quantile normalization, or other global normalization methods that rely on similar assumptions, may not be an appropriate depending on the type and source of variation.
This function can be used to test a priori to the data analysis whether
global normalization methods such as quantile normalization should be
applied. The quantro
function uses the raw unprocessed high-throughput
data to test for global differences in the distributions across a set of groups.
The quantro
function will perform two tests:
1. An ANOVA to test if the medians of the distributions are different across groups. Differences across groups could be attributed to unwanted technical variation (such as batch effects) or real global biological variation. This is a helpful step for the user to verify if there is some unaccounted technical variation.
2. A test for global differences between the distributions across groups.
The main output is a test statistic called quantroStat
. This test
statistic is a ratio of two variances and is similar to the idea of ANOVA.
The main idea of the test is to compare the variability of distributions
within the groups to the variability of distributions between the groups.
If the variance between the groups is sufficiently larger than the variance
within the groups, quantile normalization may not be an appropriate
normalization technique depending on the source of variation
(technical or biological variation). As a default, we perform this test on
after a median normalization, but this option may be changed.
To assess the statistical significance of quantroStat
, we use
permutation testing. To perform a permutation test, set B
to the
number of permutations which will create a null distribution. If the number
of samples is large, this number can be a large number such as 1000. This
step can be very slow, but a parallelization has been implemented
throught the foreach
package. Register the number of cores using
the doParallel
package.
See the vignette for more details.
A quantro
S4 class object
summary |
Returns a list of three elements related to a summary of the experiment: (1) the number of groups (nGroups), (2) total number of samples (nTotSamples), (3) number of samples in each group (nSamplesinGroups). |
B |
Number of permutations for permutation testing. |
anova |
ANOVA to test if the medians of the distributions (averaged across groups) are different across groups. |
quantroStat |
A test statistic which is a ratio of the mean squared error between groups of distributions to the mean squared error within groups of distributions (psuedo F-statistic). |
quantroStatPerm |
If |
quantroPvalPerm |
If |
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) qtest <- quantro(object = p, groupFactor = pd$CellType)
library(minfi) data(flowSorted) p <- getBeta(flowSorted, offset = 100) pd <- pData(flowSorted) qtest <- quantro(object = p, groupFactor = pd$CellType)
Accessors for the 'summary' slot of a quantro object.
summary(object, ...) ## S4 method for signature 'quantro' summary(object) ## S4 method for signature 'quantro' summary(object)
summary(object, ...) ## S4 method for signature 'quantro' summary(object) ## S4 method for signature 'quantro' summary(object)
object |
a |
... |
other |
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) summary(qtest)
library(minfi) data(flowSorted) pd <- pData(flowSorted) qtest <- quantro(flowSorted, groupFactor = pd$CellType) summary(qtest)