sva.check: A function for post-hoc checking of an sva object to check...

Description Usage Arguments Details Value Examples

View source: R/sva.check.R

Description

This function is designed to check for degenerate cases in the sva fit and fix the sva object where possible.

Usage

1
sva.check(svaobj, dat, mod, mod0)

Arguments

svaobj

The transformed data matrix with the variables in rows and samples in columns

dat

The data set that was used to build the surrogate variables

mod

The model matrix being used to fit the data

mod0

The null model matrix being used to fit the data

Details

empirical.controls for a direct estimate of the empirical controls.

Value

sv The estimated surrogate variables, one in each column

pprob.gam: A vector of the posterior probabilities each gene is affected by heterogeneity

pprob.b A vector of the posterior probabilities each gene is affected by mod

n.sv The number of significant surrogate variables

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(bladderbatch)
data(bladderdata)
#dat <- bladderEset
dat <- bladderEset[1:5000,]

pheno = pData(dat)
edata = exprs(dat)
mod = model.matrix(~as.factor(cancer), data=pheno)
mod0 = model.matrix(~1,data=pheno)

n.sv = num.sv(edata,mod,method="leek")
svobj = sva(edata,mod,mod0,n.sv=n.sv)
svacheckobj = sva.check(svobj,edata,mod,mod0)

Bioconductor-mirror/sva documentation built on June 23, 2017, 6:27 p.m.