[BioC] Differential Expression analysis

abdul rawoof [guest] guest at bioconductor.org
Mon Feb 4 14:48:08 CET 2013


Hello,

Please could you explain me why the no. of Differentially expressed genes in my data varying when in one i at one step   
i am using "arrayWeight" function,
and for the same data without using "arrayWeight"fucntion.

Which one is more reliable???
Here is my code::
###################
> DiffEx_all <- data.matrix(read.csv("Log2AvgSig afterNorm.csv",row.names=1))
> DiffEx_allgp <- substr(colnames(DiffEx_all),1,5)
> DiffEx_allgp <- as.factor(DiffEx_allgp)
> DiffEx_allgp
 [1] D1_R. D2_NR D2_R  D2_NR D2_NR D1_NR D1_R. D1_NR D1_NR Contr Contr Contr
Levels: Contr D1_NR D1_R. D2_NR D2_R

> DiffEx.design <- model.matrix(~0+DiffEx_allgp)
> colnames(DiffEx.design)=sub("DiffEx_allgp","",colnames(DiffEx.design))
> DiffEx.design
#####################################
DE analysis with "arrayWeights"
#####################################
> aw=arrayWeights(DiffEx_all,DiffEx.design) 
> fit.all <-lmFit(DiffEx_all,DiffEx.design,weights=aw)
> ebfit.all <- eBayes(fit.all)

> all_contrasts <- makeContrasts(D1R= D1_R.-Contr,D1NR=D1_NR-Contr,D2R=D2_R-Contr,D2NR=D2_NR-Contr,levels=DiffEx.design)

> ebfit.all.contrasts <- contrasts.fit(ebfit.all, all_contrasts)
> ebfit.all.contrasts <- eBayes(ebfit.all.contrasts)
> all.decide <- decideTests(ebfit.all.contrasts,adjust.method="BH",p.value=0.05)
> summary(all.decide)
     D1R  D1NR   D2R  D2NR
-1     1     0     5     2
0  29470 29474 29423 29471
1      1     0    56     2
#######################################
DE analysis without "arrayWeights"
#######################################
> fit.all <-lmFit(DiffEx_all,DiffEx.design)
> ebfit.all <- eBayes(fit.all)

> all_contrasts <- makeContrasts(D1R= D1_R.-Contr,D1NR=D1_NR-Contr,D2R=D2_R-Contr,D2NR=D2_NR-Contr,levels=DiffEx.design)

> ebfit.all.contrasts <- contrasts.fit(ebfit.all, all_contrasts)
> ebfit.all.contrasts <- eBayes(ebfit.all.contrasts)
> all.decide <- decideTests(ebfit.all.contrasts,adjust.method="BH",p.value=0.05)

> all.decide <- decideTests(ebfit.all.contrasts,p.value=0.05)
>  summary(all.decide)
     D1R  D1NR   D2R  D2NR
-1     1     0     3     2
0  29467 29473 29443 29471
1      3     0    48     1
#############################################

 -- output of sessionInfo(): 

aaa

--
Sent via the guest posting facility at bioconductor.org.



More information about the Bioconductor mailing list