statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
156 stars 29 forks source link

local data, refVar #180

Closed anujgoel1 closed 4 years ago

anujgoel1 commented 4 years ago

Hi, Sorry to bother with this request. I have my own summary statistics that I am using as JSON file for a region and am using your server API LDLZ2 for LD information. What I really would like to do is have my own custom refVar rather than the "best". I am not able to achieve this. Not sure if I have not understood it clearly enough to implement this or this feature is not available in this scenario? Many thanks for help/suggestion. BW, Anuj

abought commented 4 years ago

Anuj,

We're always happy to help a new LocusZoom user.

The good news is that LZ absolutely supports this feature. There are two ways to set the "best" variant:

  1. If you are using the "default" association plot layout, there is a tooltip option-you can click any point to "make (it the) LD reference".

Screen Shot 2020-03-23 at 12 01 42 PM

  1. Even if you don't use the default layout, you can still set LD ref var via code before or after plot creation, by setting a variable in plot.state: eg to change it after the plot is drawn, and rerender: plot.applyState( { ldrefvar: "16:53845487_C/A" });

Since you are already using LDLZ2 as your data source, note that this will even work in combination with the "LD population" dropdown menu, for any of several 1000G reference populations.

Here is a sample page showing both "custom ref var" and "LD population" UI in action: https://my.locuszoom.org/gwas/236887/region/?chrom=16&start=53609247&end=54009247

If your goals are simple enough, you may not even need to use your own JSON file; our new tools allow association plots directly from a summary stats file in many common formats (from tabixed data without uploading, or upload to get additional features)

Hope this helps- let us know if you have further questions!

anujgoel1 commented 4 years ago

Great. Thanks Andy. I had tried option 1 but wasnt what I had in mind. Option 2 did the trick for me. :) Many thanks. Best wishes, Anuj.