cfr_sva: Removing Confounding Factor Effects using SVA

Description Usage Arguments Value Examples

View source: R/preprocessing.R

Description

Removing Confounding Factor Effects using SVA

Usage

1
cfr_sva(mat, age, cov = NA)

Arguments

mat

a numeric matrix with the expression values, where columns are the samples and rows are probesets, transcripts, or genes.

age

a numeric vector, where the names correspond to samples (the same as colnames of the given matrix).

cov

covariates to analyse SVs.

Value

a list with i) a numeric matrix with the expression values, ii) SVs for each sample, and iii) correlation between SVs and covariates

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sampnames = paste('sample',1:20,sep='')
myexp <- sapply( 1:20, function(i){ rnorm(n = 10000, mean = sample(1:3, 1), sd = sample(c(1, 3), 1)) })
colnames(myexp) = sampnames
agevec <- sample(20:80,20)
names(agevec) = sampnames
result_mat <- cfr_sva(myexp,agevec)
print(myexp[1:5,1:5])
print(result_mat$correctedExp[1:5,1:5])
dim(result_mat$correctedExp)
head(result_mat$SVs)
head(result_mat$SV_cov_corr)

mdonertas/hetAge documentation built on Jan. 2, 2020, 12:53 a.m.