DGE analysis with LIMMA
2
0
Entering edit mode
Amit • 0
@b648b3f5
Last seen 10 days ago
India
# DGE Analysis with Limma.
# Model matrix.
design <- model.matrix(~0+PHENO$Group)
fit <- lmFit(VAR.exprs, design)
contrasts <- makeContrasts(G3- G1, G3 - G2, G1 - G2, levels=design)
fit2 <- contrasts.fit(fit, contrasts)
fit2 <- eBayes(fit2)
#Results
topTable(fit2)
decideTests(fit2)
table(decideTests(fit2))
Results <- decideTests(fit2)
summary(Results)
## Venn Diagram
vennDiagram(Results)

The vennDiagram shows common genes. How would i extract those with all there details like logfc, p value, adj.p.value and so on in a table.

limma • 430 views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 20 hours ago
United States

The Results object is a matrix with -1 or 1 if a given gene is significant, so rowSums(abs(Results)) == 3L will give you all the genes that are in the intersection. You can then use topTable (with sort.by = "none"), and the indicator variable generated using rowSums to subset to the genes in the intersection for each contrast, and then merge as you see fit.

1
Entering edit mode

Thanks James, but can you please share script/code as i am new in this field.

ADD REPLY
2
Entering edit mode

Untested

ind <- rowSums(abs(Results)) == 3L
lst <- lapply(1:3, function(x) topTable(fit2, x, Inf, sort.by = "n")[ind,])
d.f <- cbind(lst[[1]], do.call(cbind, function(x) lapply(lst[-1], x[,c("logFC","t", "P.Value","adj.P.Val")]))
ADD REPLY
0
Entering edit mode

Hi James, I have run the script and it gave me only column names and not data.

colnames(d.f) [1] "logFC" "AveExpr" "t" "P.Value" "adj.P.Val" "B" "logFC" "t"
[9] "P.Value" "adj.P.Val" "logFC" "t" "P.Value" "adj.P.Val"

rownames(d.f) character(0)

ADD REPLY
1
Entering edit mode

Yes. As I said, untested. When you ran the last line it had to have said

Error in do.call(cbind, function(x) lapply(lst[-1], x[, c("logFC", "t",  : 
  second argument must be a list

Because the last line should actually read

d.f <- cbind(lst[[1]], do.call(cbind, lapply(lst[-1], function(x) x[,c("logFC","t", "P.Value","adj.P.Val")])))
ADD REPLY
2
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

This is not a direct answer to your question, but rather a comment and some advice. In most cases you would be better of using the topTable already provided by

topTable(fit2)

rather than trying to hack a new table from the Venn Diagram. This table already provides logFC for all three comparisons together with an overall P-value for differences between the 3 phenotypes.

ADD COMMENT

Login before adding your answer.

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