How to extract common genes that are DE in each comparisons?
1
0
Entering edit mode
rkp • 0
@rkp-10175
Last seen 6.2 years ago

 I have made a Contrasts matrix as 

design <- model.matrix(~0+f)
colnames(design) <- levels(f)
design
fit <- lmFit(eset,design)
names(fit)
cont.matrix <- makeContrasts(C9T9="Control9-Treated9",C24T24="Control24-Treated24",........................................,levels=design)
cont.matrix
fit2  <- contrasts.fit(fit, cont.matrix)
fit2  <- eBayes(fit2)
colnames(fit2)
topTable(fit2,coef=1)
topTable(fit2,coef="C9T9")

I have total of 8 comparisons and successfully extracted up and down-regulated  genes from each comparisons using topTable, beside also identified the total number of up and down-regulated genes from each comparisons using

summary(decideTests(fit2))

but I am facing problem to identify/extract common genes that are DE in each of comparisons. Therefore, It is my kind request to all of you, please provides any suggestions for extracting of common genes that are DE in each of the comparisons.

Thanking you.

Kind regards,

Rajesh

limma bioconductor affymetrix microarrays R • 1.6k views
ADD COMMENT
0
Entering edit mode

Hi Aaron,

Thank you very much for your reply but I am unable to find genes that are DE in all comparisons. It given the probe id of all the genes present in datasets instead of DEG.

> is.de <- decideTests(fit2, method="global")
> de.in.all <- rowSumsis.de!=0) == ncol is.de)
> length(de.in.all)
[1] 22810
> up.in.all <- rowSumsis.de == 1) == ncol is.de)
> length(up.in.all)
[1] 22810

 

ADD REPLY
0
Entering edit mode

Please use the "add comment" button to reply to existing answers, rather than adding a new answer.

de.in.all is a logical vector, so its length will obviously be the same as the number of genes. The relevant bit of information is in which elements are TRUE, i.e., which(de.in.all) if you want the indices of the relevant genes.

ADD REPLY
0
Entering edit mode

> is.de <- decideTests(fit2, method="global")
> de.in.all <- rowSumsis.de!=0) == ncolis.de)
> length(de.in.all)
[1] 22810
> up.in.all <- rowSumsis.de == 1) == ncolis.de)
> length(up.in.all)
[1] 22810

ADD REPLY
1
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 16 hours ago
The city by the bay

You should be able to do something like:

is.de <- decideTests(fit2, method="global")
de.in.all <- rowSums(is.de!=0) == ncol(is.de)

... which will select the genes that are DE in all comparisons at a FDR of 5%. The "global" method ensures that the same significance threshold is applied to all contrasts. Otherwise, a gene with the same t-statistic in each of two contrasts may be considered DE in one contrast and not DE in the other, just because of the effect of other genes on the multiplicity correction. Note that the above method will not select for DE genes that change in the same direction, in which case you should do something like the below for upregulated genes:

up.in.all <- rowSums(is.de == 1) == ncol(is.de)
ADD COMMENT

Login before adding your answer.

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