Question: Plotting arbitrary lines at Gviz plotTracks
gravatar for yogacacarolom
6.1 years ago by
yogacacarolom60 wrote:

I would like to plot lines between two itens at different `AnnotationTrack`, or simple between two coordinates in my `Gviz`plot.

genes data.frame:

      start      end
     72529373 72690449
     75457896 75536848
     76867833 76922959
     75664651 75870596
     76958977 77024110
     72065147 72204484
     74198711 74199129
     74816044 74978179
     76758753 76864805
     77032585 77176916
     73574461 73704802

ideoTrack <- IdeogramTrack(genome = "bosTau6", chromosome = "chr12", fontsize=14, ucscChromosomeNames=TRUE)
axisTrack <- GenomeAxisTrack(range = IRanges(start  = c(71959908, 76756891), end = c(72409907, 77206892), names = rep("Neighborhood", 2)), fontsize=14, showId = TRUE, = 0.5, = "black")
aTgenes1 <- AnnotationTrack(genes, name = "Genes", genome ="bosTau6", chromosome ="chr12", showId = TRUE, stacking ="dense")
aTgenes2 <- AnnotationTrack(genes, name = "Genes", genome ="bosTau6", chromosome ="chr12", showId = TRUE, stacking ="dense")
plotTracks(list(ideoTrack, axisTrack, aTgenes1, aTgenes2), from = 71959908, to = 77206892, sizes=c(1,1,1,1), margin=40, littleTicks = TRUE)

This above code result in this plot:



Considering the 11 plotted genes (the fourth gene is very small and hard to see), I have the follow interaction between the genes:

gene 1 -> gene 2 and gene 11
gene 3 -> gene 5
gene 7 -> gene 6

With this interaction I expect some final plot similar to this picture:

I had tried some approachs that works in normal plots but not to `Gviz` plots. Some ideas? Thank you very much!

plot bioconductor R • 2.1k views
ADD COMMENTlink written 6.1 years ago by yogacacarolom60

I have a feeling that you'll get the best reply to this from the bioconductor mailing list. Be sure to CC: Florian Hahne, since he's the Gviz maintainer. I suggest this list since in order to programmatically draw things, you'll need to extract the coordinates to which various objects will be drawn and doing this will require a fairly high level of familiarity with the inner-workings of the package (this is something which only the maintainer is likely to have).

The maintainers might also be able to suggest another way to do this or, at the very least, give you some insight as to how doable this approach is.

ADD REPLYlink written 6.1 years ago by Devon Ryan96k

Did you get anywhere with this?

ADD REPLYlink written 4.6 years ago by stianlagstad1.0k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1444 users visited in the last hour