I am wondering if something like this (A and B):
is possible with `ggbio`.
It's possible with Tracks() to stack plots with a genomic X axis, assuming you could make them in the first place.
Thank you for your reply. To draw genes, what I use is the following:
p2 <- autoplot(txdb, which=genes_subset, label.color = "black", color = "brown", fill = "brown") +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
it draws gene structures including exons, introns, etc. How could I draw something like in the image? Just a rectangle with the gene names below.
Not sure. I don't think you can get just the genes from the TxDb directly. You'll need to extract them and pass them directly as a GRanges. As for the labeling, from reading the code, it might be possible to coerce that GRanges to a GRangesList, and labels might show up above the midpoint of the rectangles. I don't think there's any way to get them below. The author of ggbio has moved on to other things, so the package is not in a very good state right now.