Question: ggbio circular plot
0
4.0 years ago by
Poland
Marcin Grzybowski0 wrote:

I have GRanges object with SNP. I would like to mark it on chromosome using circular plot from ggbio by colour scale - so more SNP in particular region deeper color. Is it any simple way to do it?

Thank you very much for any advice.

Marcin

snp ggbio granges • 1.4k views
modified 4.0 years ago by Michael Lawrence11k • written 4.0 years ago by Marcin Grzybowski0
1
4.0 years ago by
United States
Michael Lawrence11k wrote:

First need to decide how to summarize the SNP density. Perhaps something like a runsum() on the coverage of SNPs? Then it should be relatively straightforward to plot the Rle in a circular area plot, mapping the value to color.

Thank you for advice. I run:

runsum(coverage(GRanges List), k=50000)

and i got Simple Rle List. I can make nice bar with it, however when i try:

ggplot() + layout_circle(GRanges object, geom="ideo", radius=30, trackWidth=2, fill=SimpleRleList)

it doesn't change my colors. What should i do to change it?

1
4.0 years ago by
United States
Michael Lawrence11k wrote:

Not an expert, but perhaps you could coerce that RleList to a GRanges and then generate the circle:

gr <- as(runsum, "GRanges")
ggplot() + layout_circle(gr, geom = "bar", aes(fill = score))