Entering edit mode
11.2 years ago
robjohn7000
▴
110
I created a venn diagram (5 intersecting circles) using the code below, but not sure how to go about extracting the genes that are differentially expressed across different compartments.
## create experimental design
experimentalFactors<-targets$time
sampleGroups <- factor(experimentalFactors, levels = unique(experimentalFactors))
exptDesign <- model.matrix(~ 0 + sampleGroups)
colnames(exptDesign) <- levels(sampleGroups)
## create contrasts
contrasts <- makeContrasts("hr6-0","hr24-hr0","hr48-hr0","hr72-hr0","hr80-hr0",levels = exptDesign)
fit <- lmFit(selDataMatrix, exptDesign)
fit2 <- contrasts.fit(fit, contrasts)
fit2 <- eBayes(fit2)
## venn diagram
fit2.venn <- fit2[,1:5]
results <- decideTests(fit2.venn, method="separate", adjust.method="BH", p.value=0.05, lfc=1.5)
vennDiagram(results)
Please help!
Brilliant! That worked nicely. Thanks Irsan for the code and the explanations. I was able to get the genes that are upregulated in all contrasts with the following:
But the gene names are in the "illumina" format and I wanted the official gene syambols, and then tried two ways (neither worked):
Is there a way of getting the genes in the official gene symbol format?
Well that depends on whether the official gene symbols are somewhere in your data in fit2 in the first place. Is it?
yes, it is here:fit2$genes$geneSymbol
I guess fit2$genes is a data frame. Does it also contain a column with the illumina ids you mentioned earlier?
yes it's the same data frame that contains a column of IDs.
Many thanks, your latest code worked with a modification, thus: Genes <- row.names(Genes) Official_genes <- fit2$genes[Genes, "geneSymbol"]
I really appreciate your help Irsan!!!
You are welcome :-)