Given a PBMExperiment of normalized probe intensities, this function fits
robust probe-level models across samples using the lmFit
and eBayes
functions from the limma package. The output is a PBMExperiment object with
probes in rows and conditions, rather than individual samples, in columns. The
condition labels of each sample should be specified as a column in the colData of
input PBMExperiment using the stratify=
parameter. By default, the function
expects a "condition"
column in the colData of the input object.
probeFit( pe, assay = SummarizedExperiment::assayNames(pe)[1], stratify = "condition", guardrail = TRUE, offset = 1L, verbose = FALSE, ... )
pe | a PBMExperiment object containing PBM intensity data. |
---|---|
assay | a string name of the assay to use for fitting probe models.
(default = |
stratify | a character string specifying a column in |
guardrail | a logical value whether to stop function if any sample appears to be of clearly low quality. Currently, this only checks for whether more than 20% of probes in any sample are NA. If any criteria is met, an error will be returned. (default = TRUE) |
offset | an integer offset to add to intensities before log2 scaling to prevent errors with zero intensities. If set to 0, probes with zero intensities are dropped/ignored in estimation. (default = 1) |
verbose | a logical value whether to print verbose output during analysis. (default = FALSE) |
... | additional parameters to be passed to |
PBMExperiment object with probe-level log2 intensity information aggregated
across replicates for each unique value in stratify
. Columns in the returned
PBMExperiment correspond to unique values of the stratify
variable, and
rows correspond to the subset of probes passing the filtering criteria
of the original PBMExperiment object. The PBMExperiment includes three assays,
"beta"
, "sd"
, and "df"
, storing the cross-replicate
mean, standard deviation, and degrees of freedom estimates for each condition and probe.
More specifically, limma::lmFit
is called on the log2-transformed values of the
specified assay with no intercept and a binary design matrix with columns corresponding
to the unique values of colData(pe)[[stratify]]
. Since PBM experiments are often
performed with few replicates per condition, the fit is then passed to limma::eBayes
with robust = TRUE
and trend = TRUE
by default. Parameters to
limma::eBayes
can be modified by specifying them during the call to probeFit
.
The cross-probe robust and trended variance estimates are obtained using the
eBayes
function from the limma package with robust = TRUE
and
trend = TRUE
by default. The procedure was developed and described
in the following paper:
Phipson, B., Lee, S., Majewski, I. J., Alexander, W. S., & Smyth, G. K. (2016). Robust hyperparameter estimation protects against hypervariable genes and improves power to detect differential expression. Annals of Applied Statistics, 10(2), 946-963.