Hi James, I think there is still something that I am missing in the circular display :
shall you follow my examples, I would appreciate your help on why these plots look so different ..
1) example 1:
library("ggbio")
library("GenomicFeatures")
library("GenomicRanges")
gr1 <- GRanges("chr21", strand="+", IRanges(start = c(1, 20), end = c(10, 30)), score = c(0,20))
values(gr1)$to.gr <- GRanges( "chr21", strand="+", IRanges(start = c(100, 200), end = c(110, 210)) )
seqlengths(gr1) <- 220
ggbio() + circle(gr1, geom = "bar", radius = 120, trackWidth = 4, aes(fill = score, y = score), direction = "anticlockwise") + circle(gr1, geom = "point", color = "red", radius = 130, trackWidth = 3, grid = TRUE, aes(y = score), direction = "anticlockwise") + circle(gr1, geom = "link", linked.to = "to.gr", radius = 100, trackWidth = 1, direction = "anticlockwise")
2) example 2 ; identical as example 1), except that we do modify the seqlengths() : i.e. seqlengths(gr1) <- 2200.
library("ggbio")
library("GenomicFeatures")
library("GenomicRanges")
gr1 <- GRanges("chr21", strand="+", IRanges(start = c(1, 20), end = c(10, 30)), score = c(0,20))
values(gr1)$to.gr <- GRanges( "chr21", strand="+", IRanges(start = c(100, 200), end = c(110, 210)) )
seqlengths(gr1) <- 2200
ggbio() + circle(gr1, geom = "bar", radius = 120, trackWidth = 4, aes(fill = score, y = score), direction = "anticlockwise") + circle(gr1, geom = "point", color = "red", radius = 130, trackWidth = 3, grid = TRUE, aes(y = score), direction = "anticlockwise") + circle(gr1, geom = "link", linked.to = "to.gr", radius = 100, trackWidth = 1, direction = "anticlockwise")
Let's try this one more time. Do you see the difference between the following results? Can you see why they are different?
If so, do you now understand why calling autoplot() on Homo.sapiens (which by default represents the entire genome) doesn't do what you expect? Have you read the ggbio vignette, specifically the part about circular plotting? Does this hopefully explain by example that you cannot do what you want using autoplot()?
You can probably do exactly what you want using ggbio, but you should understand going in that it will only be due to your own hard work. Like ggplot2, ggbio tries to 'do the right thing', and if you want it to do something else it is non-obvious how one would do that. There are quite a few examples in the vignette, and even more scattered around the internets, so that should be helpful. But the help pages are not super-helpful, and Tengfei doesn't answer many questions (last question answered was almost a year ago, and not even 1000 questions answered for what could hypothetically be a highly used package).