A problem in using Combat
1
0
Entering edit mode
linw • 0
@linw-16024
Last seen 6.4 years ago

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 !

 

 

sva combat • 2.1k views
ADD COMMENT
0
Entering edit mode
@w-evan-johnson-5447
Last seen 5 months ago
United States
Dear linw, Looks like ComBat is picking up 20,276 missing values in your data. Should that be the case? It seems this is causing your error. Could it be that you are giving your Gene ID as a data column? Evan On Jun 26, 2018, at 8:18 AM, linw [bioc] <noreply@bioconductor.org<mailto:noreply@bioconductor.org>> wrote: Activity on a post you are following on support.bioconductor.org<https: support.bioconductor.org=""/> User linw<https: support.bioconductor.org="" u="" 16024=""/> wrote Question: A problem in using Combat<https: support.bioconductor.org="" p="" 110409=""/>: 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 ! ________________________________ Post tags: sva, combat You may reply via email or visit A problem in using Combat
ADD COMMENT

Login before adding your answer.

Traffic: 665 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