Hi everyone:
I have a problem in using combat function of sva package.
My expression matrix like this,the row is gene ID, the col is sample name;
Gene ID | FPKM_SRR1747143 | FPKM_SRR1747144 | FPKM_SRR1747145 |
ENSG00000227232.5_2 | 16.9862 | 21.125874 | 10.934044 |
ENSG00000243485.5_3 | 0.315278 | 0.274214 | 0.376238 |
ENSG00000236679.2 | 0.223015 | 0.312557 | 0.094344 |
ENSG00000238009.6_4 | 0.160705 | 0.133555 | 0.105627 |
ENSG00000239945.1_4 | 0.268948 | 0.227667 | 0.127205 |
My samples is divided into three batch ,and each batch has some case and some control:
sample batch condition
FPKM_SRR1747143 1 control
FPKM_SRR1747144 1 case
FPKM_SRR1747145 1 control
FPKM_SRR1747146 2control
FPKM_SRR1747147 2 case
FPKM_SRR1747148 3 control
FPKM_SRR1747149 3 control
FPKM_SRR1747150 3 case
And my code is like that :
bdata <- read.table("batch.txt",header=T,row.names=1);
mdata=read.table("matrix.txt",header=T,row.names=1,blank.lines.skip=F);
mdata <- as.matrix(mdata)
mod = model.matrix(~1, data=bdata);
batch= bdata$batch
combat_mdata =ComBat(dat=mdata, batch=batch, mod=mod, par.prior=TRUE,prior.plots=FLASE)
But I got a wrong message :
Found3batches
Adjusting for0covariate(s) or covariate level(s)
Found20276Missing Data Values
Standardizing Data across genes
Error in X[!is.na(y), ] : (subscript) logical subscript too long
When I transposition the matrix ,the row is sample name , the col is gene ID , I got another wrong message :
Found3batches
Adjusting for0covariate(s) or covariate level(s)
Standardizing Data across genes
Error in tcrossprod(t(design), as.matrix(dat)) :
non-conformable arguments
If anyone know what is the problem of my data ,please give your advise!
Thank you !