-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scale on ribbon #116
Comments
Fancy! Good question. What kind of scale do you mean? A complete axis, or a small scale bar with fixed size for comparison. Maybe akin to #85 geom_scale_bar but on the y-axis matching the ribbon scale? On a side note, check out |
A little update to this. I had some time to play around with this and I got a bit further with the gggenomes builtin aesthetics:
p_chr <- gggenomes(seqs = genome)+
geom_seq()
p_chr %>% add_feats(cluster)+
geom_bar(aes(x=(x+xend)/2,
y = score),
feats(cluster),
fill="orange",
linetype=1,
size=0.1,
alpha=1,
stat = "identity")+
theme(axis.line.y.left = element_line(),
axis.ticks.y = element_line(),
axis.text.y = element_text(),
axis.line.x = element_blank(),
axis.ticks.x = element_blank(),
axis.text.x = element_blank())+
scale_y_continuous(limits = c(0, max(cluster$score)),breaks = seq(0,max(cluster$score), 2)) My question would be if there is a way to move the bare genome to 0. It seems to sit always at 1 at the Y-axis. |
Here's a solution, although granted, not the prettiest ...
|
Hi,
lately I have been playing around with the amazing gggenomes library. I'm interested in visualizing gene counts within non overlapping sliding windows. Similar to the GC content example in the documentation I wanted to plot the data in a ribbon above and below the chromosomes / genomic regions plus some extra ribbons representing alternative treatments.
Is there a way to show a scale next to the ribbons that I drew in this picture?
I know there are some overlaps that I still have to work out. The scale next to the ribbons would be one step closer to a perfect plot :) It would be amazing if someone could help me out with this!
Below is some example code to show how I generated the red ribbon plot. I added all the other ribbons in the same way adjusting their y value and their fill color.
seqs = fasta index file read in with read_fai()
mapping = paf file generated with minimap2 read in with read_paf()
gene_cluster = bed file with genes per window count read in with read_bed()
Cheers,
Daniel
The text was updated successfully, but these errors were encountered: