Help with multiple batch effects
0
0
Entering edit mode
Fp • 0
@fp-16305
Last seen 6.4 years ago

Hello, I have an expression matrix of 1208 samples (1095 tumor and 113 normal) downloaded from TCGA. I know there are 3 batch effects: type, plateId and TSS. I've tried to correct for them with Combat but I need a little help with the model.matrix. 

There is something wrong. The error message says: Error in ((dat - t(design %% B.hat))^2) %% rep(1/n.array, n.array) : requires numeric/complex matrix/vector arguments

Is there anyone who can help me? I'm a student. Thanks in advance. The code is:

 

batch<-as.data.frame(cbind(samples,plateId,group,TSS),as.is=T)[,-1]


##correct for group

mod.1<- model.matrix(~plateId+TSS, data=batch) 
bat.1<- ComBat(dat=dati, batch$group, mod.1, mean.only = TRUE, par.prior=TRUE, prior.plots=FALSE)

##correct for plateId

mod.2<- model.matrix(~group+TSS, data=batch) 
bat.2<- ComBat(dat=bat.1, batch$plateId, mod.2, mean.only = TRUE,par.prior=TRUE, prior.plots=FALSE)

##correct for TSS

mod.3<- model.matrix(~group+plateId, data=batch) 
bat.3<- ComBat(dat=bat.2, batch$TSS, mod.3, mean.only = TRUE,par.prior=TRUE, prior.plots=FALSE)

 

combat sva batch effect • 984 views
ADD COMMENT

Login before adding your answer.

Traffic: 486 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6