# How to plot circular chromosomes with Gviz?

I am using Gviz to plot several tracks. I create a GenomeAxisTrack() and then several AnnotationTrack()s that I feed to plotTracks(). This produces a stacked output of tracks with annotated arrows as I want but the displays are linear. In some cases I have the complete genomes and I know they are circular (like some bacterial and viral chromosomes), how can I display the plots as circular?

I tried feeding to AnnotationTrack(); a GRanges() object with a Seqinfo() object specifying the isCircular=TRUE flag, but this didn't change the resulting plot.

Here is minimal code to create a linear plot, I would like one where the first and last arrow join up in a circle:

library(Gviz)
library(stringr)

track <- AnnotationTrack(start=c(1,5,7), end=c(2,6,10), strand=c('+','+','-'), stacking="dense", fill=c('red','blue', 'black'))
png(file=paste("test","png", sep="."))
plotTracks(track)
dev.off()


Note, I am not interested in alternative software recommendations, I would like to solve this with gviz if it is possible. Also asked this here.

• I would be amazed if there were a way to do that. – Devon Ryan Aug 15 '18 at 10:23
• @DevonRyan why? i have use cases, but i'm not very familiar with gviz and its implementation – Chris_Rands Aug 15 '18 at 10:28
• For track-based plots you would pretty much have to set it up for circular plotting from the very beginning in order for it to work. I'm aware that there are use-cases, but given where gviz was developed and the use-cases there it would be surprising if circular genomes were a consideration during development. – Devon Ryan Aug 15 '18 at 10:31