Entering edit mode
3.3 years ago
Anand
▴
40
I've been able to create a gene expression heatmap of LogFC using the following code:
ggplot(dat, aes(gene_id, type, fill = logFC)) +
geom_tile() +
theme_void() +
theme(axis.text.x = element_blank(),
axis.title = element_blank(),
legend.position = "top") +
scale_fill_gradientn(colours = c("dodgerblue4", "dodgerblue3","dodgerblue2", "dodgerblue1","white",
"firebrick1", "firebrick2","firebrick3", "firebrick4"),
values = rescale(c(-5, 0, 5))) +
guides(fill = guide_colourbar(barwidth = 30, barheight = 2, title.vjust = 1)) +
theme(axis.text = element_text(size = 24),
legend.text = element_text(size = 20),
legend.title = element_text(size = 20))
Instead of the 1000+ gene names as x-axis ticks, i'd like to replace them just with the number of DEGs in total with breaks. Similar to the second image I have posted up. Any help or advice would be much appreciated.