circular display in ggbio
1
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA

Dear all,

please could someone share if there is ANY RULE for making CIRCULAR PLOTS in GGBIO of ONLY CHROMOSOMAL SEGMENTS function of SEQLENGTHS :

for instance, let's consider the following GRanges object that contains the coordinates for 2 genes:

x <- GRanges(seqnames = "chr21", ranges = IRanges(c(43766466,43782390), c(43771208,43786644)), strand ="*", gene = c("TFF1","TFF2"), score = c(0,10))

size_interval <- max(end(x))-min(start(x))

seqlengths(x) <- size_interval

ggplot() + layout_circle(x, geom = "bar", fill = "red", radius = 120, trackWidth = 3, aes(y=score))

ggbio() + circle(x, geom = "bar", fill = "red", radius = 120, trackWidth = 3, aes(y=score))

How could I make the plot in such a way that is easy to visualize (it is on chr21 that has a length of approx 48 megabases, but we do not want to plot the entire chromosome .. ) thank you very much !

 

ggbio granges • 1.3k views
ADD COMMENT
0
Entering edit mode
Bogdan ▴ 670
@bogdan-2367
Last seen 6 months ago
Palo Alto, CA, USA

oh, well, if I may share a solution from Tengfei :

library(ggbio)

library(GenomicRanges)

x <- GRanges(seqnames = "chr21", ranges =

                 IRanges(c(43766466,43782390), c(43771208,43786644)), strand ="*", gene

             = c("TFF1","TFF2"), score = c(0,10))

x <- shift(x, min(start(x)) * -1 + 1e4)

size_interval <- max(end(x)) + 1e4

seqlengths(x) <- size_interval

 

ggbio() + circle(x, geom = "ideo") + circle(x, geom = "bar", aes(y = score),

                        fill = "red", color = "red")

 

ADD COMMENT

Login before adding your answer.

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