Hello,
I am fairly new to using R so I apologize if this question has been answered before but I have tried finding an answer for the past 2 weeks with no luck.
I have microarray data which has been grouped into WT (uninfected), WT(infected), Knockout(uninfected) and Knockout (infected)
the samples were grouped depending on the number of samples per group and then contrasts were made to determine dfiierential gene expression. I want to create a heatmap of these differentially expressed genes however I cannot get a heatmap to generate to show differential expression at the sample level. My heatmap will only show the differential expression of the groups. Here is my code that I have been using:
if (require(limma))
{
## compare <e.g., 'WT_25u_v_WT_25i' and 'MyD88_25u_v_MyD88_25i'>
design <- model.matrix(~ 0+factor= c(1,1,2,2,2,2,3,3,4,4,4,5,5,6,6,6,6,7,7,8,8,8,8))
colnames(design) <- c('MyD88_25u', 'MyD88_25i', 'WT_25u', 'WT_25i', 'MyD88_47u', 'MyD88_47i', 'WT_47u', 'WT_47i')
fit<-lmFit(selDataMatrix, design)
# create you comparisons of interest
contrast.matrix <- makeContrasts(MyD88_25i-WT_25u,MyD88_25i-MyD88_25u,MyD88_25u-WT_25u, WT_25i-WT_25u, levels=design)
fit2u <- contrasts.fit(fit, contrast.matrix)
fit2u <- eBayes(fit2u)
# fit2 now contains all your comparisons
head(fit2$coef)
## Add gene symbols to gene properties
if (require(lumiHumanAll.db) & require(annotate))
{
geneSymbol <- getSYMBOL(probeList, 'lumiMouseAll.db')
geneName <- sapply(lookUp(probeList, 'lumiMouseAll.db', 'GENENAME'), function(x) x[1])
fit2u$genes <- data.frame(ID= probeList, geneSymbol=geneSymbol, geneName=geneName, stringsAsFactors=FALSE)
}
print(topTable(fit2u, number = 100, p.value < 0.05))
mat_data_25 <- data.matrix(fit2u[,2: ncol (fit2u)])
my_palette <- colorRampPalette(greenred(n=299))
col_breaks= c(seq(-2,0, length =100),
seq(0.01,2, length=100))
heatmap.2(mat_data_25,
main= "Significant genes at 25 weeks",
trace= "none",
dendrogram = "row",
margins= c(12,9),
col = my_palette,
breaks = col_breaks)
Any help would be most appreciated,
Ivonne
your breaks are way too wide for being able to see a difference. like try from -1 to +1 also, what are the fold changes of your DEGs, they don't look that different from the heatmap. also #2, use a the "Add comment" to reply to the messages unless you are posting a solution to the initial question :)