ivanek / Gviz

This is the Gviz development repository. Gviz plots data and annotation information along genomic coordinates.
https://bioconductor.org/packages/Gviz/
Artistic License 2.0
71 stars 10 forks source link

Include pairwise LD information in a track? #5

Open pbreheny opened 5 years ago

pbreheny commented 5 years ago

Is there a way in Gviz to include anything like a plot of which SNPs are in pairwise LD with each other? Something like this, for example:

gwas

I haven't managed to figure out a way to include something like this, but it would be a nice addition.

Gviz is fantastic, by the way; thank you for all your work on it.

ivanek commented 5 years ago

Hi @pbreheny, Unfortunately this is currently not possible but I would be happy to implement it. I was thinking about a "rotated" heatmap instead of those lines. What is the data format in which you store the LD, is it a matrix or sparse version of it?

pbreheny commented 5 years ago

I typically use the ld() function in the snpStats package to compute linkage disequilibrium. It has a depth argument that controls the maximum lag between SNPs, and returns a sparse matrix (specifically, a dgCMatrix) with zeros for all pairs outside depth.

A rotated heatmap would be fantastic, especially if it incorporates that sparsity/depth. For example, in the above figure, you probably wouldn't want a heatmap of the entire region, but a heatmap of the central band, rotated, would be great. I think the main appeal of the lines is that it's easy to restrict them to a certain depth, but if you can accomplish that with a heatmap, even better.