probeFit: Fit probe models

Description Usage Arguments Details Value Author(s) References

View source: R/probeFit.R

Description

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.

Usage

1
2
3
4
5
6
7
8
9
probeFit(
  pe,
  assay = SummarizedExperiment::assayNames(pe)[1],
  stratify = "condition",
  guardrail = TRUE,
  offset = 1L,
  verbose = FALSE,
  ...
)

Arguments

pe

a PBMExperiment object containing PBM intensity data.

assay

a string name of the assay to use for fitting probe models. (default = SummarizedExperiment::assayNames(pe)[1])

stratify

a character string specifying a column in colData(pe) to use for grouping samples, e.g. into alleles. (default = "condition")

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 limma::eBayes. See Details for default parameters used in this function as they differ from the limma::eBayes default values.

Details

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.

Value

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.

Author(s)

Patrick Kimes

References

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:


pkimes/upbm documentation built on Oct. 17, 2020, 9:10 a.m.