NormalizeRUVRand: RUV-random normalized data

Description Usage Arguments Value Author(s) References Examples

View source: R/NormalizeRUVRand.R

Description

Given suitable controls, this function may be used to obtain a normalized metabolomics data matrix for downstream statistical analysis

Usage

1
 NormalizeRUVRand(Y,ctl,k=NULL,lambda=NULL,plotk=TRUE) 

Arguments

Y

A metabolomics data matrix with samples in rows and metabolites in columns

ctl

A logical vector indicating which metabolites should be used as negative controls

k

The number of factors of unwanted variation

plotk

A logical indicating whether a bargraph for the proportion of variance explained by the factors of unwanted variation needs to be plotted

lambda

The regularization parameter which depends on k. If not entered, it will be estimated. See DeLivera et al, 2014 for details.

Value

The result is an object of class normdata.

Author(s)

Alysha M De Livera and Laurent Jacob

References

De Livera, A. M., Dias, D. A, De Souza, D., Rupasinghe, T., Pyke, J., Tull, D., Roessner, U., McConville, M., and Speed, T. P. (2012). Normalizing and integrating metabolomics data. Analytical chemistry, 84(24), 10768-76.

De Livera, A.M., Aho-Sysi, M., Jacob, L., Gagnon-Bartch, J., Castillo, S., Simpson, J.A., and Speed, T.P. (2014), Statistical methods for handling unwanted variation in metabolomics data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
data(UV)
Y<-data.matrix(UV[,-c(1:3)]) 

##Empirical controls
IS<-Y[,which(colnames(Y)=="IS")] 
r<-numeric(dim(Y)[2])
for(j in 1:length(r)){
  r[j]<-cor(IS,Y[,j])
}
ctl<-logical(length(r))
ctl[which(r>round(quantile(r,0.7),2))]<-TRUE 

## Not run:   
ruv<-NormalizeRUVRand(Y=Y,ctl=ctl,k=3) 
ruvclust<-NormalizeRUVRandClust(RUVRand=ruv,
                   maxIter=200, 
                   nUpdate=100,
                   lambdaUpdate=TRUE,
                   p=2)
ruvclustY<-ruvclust$newY
pairs(princomp(ruvclustY,cor=TRUE)$scores[,c(1:3)],
      pch=as.numeric(UV[,2]), col=UV[,3],
      main="RUV random for clustering")

## End(Not run)

MetNorm documentation built on May 2, 2019, 4:16 a.m.