get_precision_weights: Get precision weights from the copy number-variance...

View source: R/fit.R

get_precision_weightsR Documentation

Get precision weights from the copy number-variance relationship.

Description

Estimates the variability of the supplied log-ratios across samples as a function of copy number (DNA count levels).

Usage

get_precision_weights(logr, design, log_dna, span = 0.4, plot = TRUE, ...)

Arguments

logr

Matrix of outcome measures: log2 ratio of RNA counts to DNA counts.

design

Design matrix specifying comparisons of interest.

log_dna

Matrix of log2 aggregated DNA counts of the same dimension as logr.

span

The smoothing span for lowess in estimating the copy number-variance relationship. Default: 0.4.

plot

If TRUE, plot the copy number-variance relationship.

...

Further arguments to be passed to lmFit for obtaining residual standard deviations used in estimating the copy number-variance relationship.

Details

Residual standard deviations are computed using the supplied outcomes and design matrix. The square root of the the residual standard deviations are modeled as a function of the average log2 aggregated DNA counts to estimate the copy number-variance relationship.

Value

A matrix of precision weights of the same dimension as logr and log_dna.

References

Law, Charity W., Yunshun Chen, Wei Shi, and Gordon K. Smyth. Voom: Precision Weights Unlock Linear Model Analysis Tools for RNA-Seq Read Counts. Genome Biology 2014, 15:R29. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1186/gb-2014-15-2-r29")}.

Examples

data(mpraSetAggExample)
design <- data.frame(intcpt = 1,
                     episomal = grepl("MT", colnames(mpraSetAggExample)))
logr <- compute_logratio(mpraSetAggExample, aggregate = "none")
log_dna <- log2(getDNA(mpraSetAggExample, aggregate = FALSE) + 1)
w <- get_precision_weights(logr = logr, design = design,
                           log_dna = log_dna, plot = FALSE)

hansenlab/mpra documentation built on Sept. 15, 2024, 4:11 p.m.