Closed songtaogui closed 5 years ago
Thanks for the question. The documentation hints at this, but not very clearly.
When we request LD from our server, we are usually doing so with respect to a "reference variant" (automatically chosen as the most significant p value in the displayed region).
What this means in practice is that variant1
is always the same value (as shown in query string below), and we're omitting it from our payloads to save space.
Sample API url:
https://portaldev.sph.umich.edu/api/v1/pair/LD/results/?filter=reference eq 1 and chromosome2 eq '10' and position2 ge 114550452 and position2 le 115067678 and variant1 eq '10:114758349_C/T'&fields=chr,pos,rsquare
It might be possible to use LD calculated according to different assumptions, but you'd probably have to write a fair bit of custom code to use and display it cleanly.
Thank you for the kindly help.
I have learned that LocusZoom allows users to change LD ref snps. My understanding was that when variant1
changes, we need to re-calculate variant2 R2
to creat a new json file. So, how could I format the whole LD data to LocusZoom so it can extract variant2 LD
based on user selected variant1
, and which script of LocusZoom does that?
Thank you ! Best wishes.
Changing reference SNPs is indeed a feature of LocusZoom.js. However, in any web application, we try to avoid sending all possible to the browser at once.
There are a few possible approaches, depending on the size of your task and how comfortable you are writing custom code here.
Although you could put all the data into all one file, you'd be writing a lot of code for a not very optimal strategy- if deploying your own LD server is at all an option, I recommend that route.
Thank you for the explanation, I will use local script to fetch the JSON to LocusZoom.
Hi,
I have LD file formated like:
snp1 snp2 D-prime R2
And how could I convert the LD file to json format? I have read thestaticdata/ld_10_114550452-115067678.json
, and found that their are only infomation forvariant2
:Should there also be infomation for
variant1
?Thanks!
SongtaoGui