Question: ggbio: integrate different plots
0
2.7 years ago by
Spain
andreucat910 wrote:

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

is possible with ggbio.

ggbio • 685 views
ADD COMMENTlink
modified 2.7 years ago by Michael Lawrence11k • written 2.7 years ago by andreucat910
Answer: ggbio: integrate different plots
0
2.7 years ago by
United States
Michael Lawrence11k wrote:

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

ADD COMMENTlink written 2.7 years ago by Michael Lawrence11k

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 REPLYlink written 2.7 years ago by andreucat910

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 REPLYlink written 2.7 years ago by Michael Lawrence11k
Please log in to add an answer.

Content
Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 211 users visited in the last hour