ggbio: integrate different plots
1
0
Entering edit mode
@andreucat91-8929
Last seen 8.0 years ago
Spain

I am wondering if something like this (A and B):

 

 

is possible with `ggbio`.

ggbio • 1.7k views
ADD COMMENT
0
Entering edit mode
@michael-lawrence-3846
Last seen 3.0 years ago
United States

It's possible with Tracks() to stack plots with a genomic X axis, assuming you could make them in the first place. 

ADD COMMENT
0
Entering edit mode

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.

 

ADD REPLY
0
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

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