plotting interactions in gviz (Chia-Pet, HiC, 5C). New feature?
2
0
Entering edit mode
doyourun • 0
@doyourun-7288
Last seen 6.9 years ago
United States

Dear Florian, the Gviz package is amazing, however there is one thing I want to do that I cannot find.

I wish to draw interactions between two points (e.g. could be a DNA/RNA fusion, long-range interaction from Chia-Pet, HiC, 5C,3C experiments..).

I don’t want to do it in circos, because I am focusing on a smaller region (a few MB).

1. Is there a way to obtain the plotting coordinate system of the plot  so that I can then plot an arc between the two loci using a standard R  plotting function.

1. Is there a way to force a larger coordinate (e.g. I want to make the vertical (y) axis bigger, to add space for the arcs above the ideograms).

Is there a way to do this in gviz?

Regards,

Hugues Sicotte

gviz • 1.8k views
0
Entering edit mode

So we have a package called GenomicInteractions http://www.bioconductor.org/packages/release/bioc/html/GenomicInteractions.html which can make very simple plots of regions using the plotRegion function. This uses bezier curves to plot arcs between different anchors. However, please note that we've found that it has several bugs in the plotting of the annotation tracks at the bottom of the plot (although the arcs and anchors are plotted correctly). I was planning on moving this code to something more gviz like (and trying to use the gviz plotting code for underlying tracks -  and was planning on contacting Florian in the very near future) and hope this will make it into the next version of GenomicInteractions or contributed to gviz.

0
Entering edit mode

Just let me know one you have a working prototype and we can think about integration into Gviz

1
Entering edit mode
Robert Ivanek ▴ 710
@robert-ivanek-5892
Last seen 4 days ago
Switzerland

Hi Hugues,

I have implemented sashimi-like plots into devel version 1.11.14, which should be available early next week. It is part of the AlignemntsTrack visualization, you just need to add additional type "sashimi".  It is compatible with existing types "coverage" and "pileup".

0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 3.2 years ago
Switzerland

Hi Hugues,

out of the box we do not have these interaction plots in Gviz, but there is a straight forward way to retrieve all of the plotting coordinates:

The return value of the plotTracks function is a list with the input track objects, but they all contain the relevant plotting information in their ImageMap slot. The coodrs method can be used to extract them. Note that the y coordinates are actually reverted (top is 0). Now the second thing you need to know is that Gviz is using grid graphics under the hood, so for every manipulation of the plot you will also need to use grid graphics tools. Here's a rather trivial example to connect elements of an AnnotationTrack:

annTrack <- AnnotationTrack(start=c(1, 100, 700, 1900), width=50, chromosome=1, genome="hg19", name="foo", id=letters[1:4])
res <- plotTracks(list(GenomeAxisTrack(), annTrack))
xy <- coords(res\$foo)
x = xy[,1] + (xy[,3]-xy[,1])/2
y = xy[,2] + (xy[,4]-xy[,2])/2
pushViewport(viewport(xscale=c(0, dev.size(units="px")[1]), yscale=c(dev.size(units="px")[2], 0)))
grid.bezier(rep(x[3:4], each=2), c(y[2], rep(min(xy[,2]), 2), y[3]), default.units="native")

This is really just a starter, but I'm sure you will figure out the details.

With regards to your second question: There is no easy way to increase the margin of the IdeogramTrack. However you can always just add a dummy CustomTrack above or below with a hidden title panel. Probably not the cleanest solution but it works.

That being said, my co-author Robert has some ideas about Sashimi plots which may be helpful in this context, so stay tuned.

0
Entering edit mode

Is there any news on the shashimi plot front Florian? I would be great if that would be possible. I willing to do some testing since I am working on a project that would really benefit from that.