Answers.Body: <p>The primary author of Gviz confirmed to me via email that this is not possible:</p>
  
  <blockquote>
    <p>Gviz will only give you the traditional linear tracks. There are a
    bunch of solutions available for visualizing circular genomes, most of
    which are more interactive in nature and not implemented in the rather
    static R graphics context. GGplot2 has some support for circular axes,
    too. If you want to stay within the R environment I’d start there.
    Ggbio is another option providing a somewhat higher-level interface.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-11T14:22:17.090Z
Answers.LastActivityDate: 2018-09-11T14:22:17.090Z
Answers.UserDisplayName: Chris_Rands
Body: <p>I am using Gviz to plot several tracks. I create a <code>GenomeAxisTrack()</code> and then several <code>AnnotationTrack()</code>s that I feed to <code>plotTracks()</code>. 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?</p>
  
  <p>I tried feeding to <code>AnnotationTrack()</code>; a <code>GRanges()</code> object with a <code>Seqinfo()</code> object specifying the <code>isCircular=TRUE</code> flag, but this didn't change the resulting plot.</p>
  
  <p>Here is minimal code to create a linear plot, I would like one where the first and last arrow join up in a circle:</p>
  
  <pre><code>library(Gviz)
  library(stringr)
  
  track &lt;- 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()
  </code></pre>
  
  <p><a href="https://i.sstatic.net/SJ9Nw.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/SJ9Nw.png" alt="enter image description here"></a></p>
  
  <p>Note, I am not interested in alternative software recommendations, I would like to solve this with gviz if it is possible. Also asked this <a href="https://support.bioconductor.org/p/112040/" rel="nofollow noreferrer">here</a>.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-15T10:23:13.107Z
Comments.Text: I would be amazed if there were a way to do that.
Comments.UserDisplayName: Devon Ryan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-15T10:28:47.953Z
Comments.Text: @DevonRyan why? i have use cases, but i'm not very familiar with gviz and its implementation
Comments.UserDisplayName: Chris_Rands
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-15T10:31:20.547Z
Comments.Text: 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.
Comments.UserDisplayName: Devon Ryan
Tags: <r><bioconductor><gviz>
Title: How to plot circular chromosomes with Gviz?
ThreadText: # How to plot circular chromosomes with Gviz?
  
  (Asked by: username_0 on 2018-08-15)
  
  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()
  
  ```
  
  [![enter image description here](https://i.sstatic.net/SJ9Nw.png)](https://i.sstatic.net/SJ9Nw.png)
  
  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](https://support.bioconductor.org/p/112040/).
  
  **Tags:** r, bioconductor, gviz
  
  > **Comments:**
  > **username_1**: I would be amazed if there were a way to do that.  
  > **username_0**: @username_1 why? i have use cases, but i'm not very familiar with gviz and its implementation  
  > **username_1**: 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2018-09-11. Score: 1 | Accepted answer
  
  The primary author of Gviz confirmed to me via email that this is not possible:
  
  > Gviz will only give you the traditional linear tracks. There are a
  > bunch of solutions available for visualizing circular genomes, most of
  > which are more interactive in nature and not implemented in the rather
  > static R graphics context. GGplot2 has some support for circular axes,
  > too. If you want to stay within the R environment I’d start there.
  > Ggbio is another option providing a somewhat higher-level interface.
  
  
  ---
  
  