A PheWAS visualization displays association p-values between a given genetic variant and multiple phenotypes. In this demonstration, we are showing single variant association statistics from multiple publicly available meta-analyses of genome-wide association studies (GWAS), stored locally in a database at the Center for Statistical Genetics (University of Michigan.) For the purposes of the demonstration, we chose reasonable groupings of traits into categories, but any arbitrary grouping is possible.
LocusZoom.js requires a REST API endpoint to retrieve data for the plot. The format of the response is documented in our API documentation, with a brief synopsis also included below.
Code for creating the plot can be found on the source for this page, and also in the locuszoom.js repository.
Or try jumping to a particular variant:
Full documentation/examples are available on our website.
LocusZoom.js will fire off an API request containing 3 parameters: build
, filter
, and format
.
build
specifies the genome build for the given variant. An example would be 'GRCh37' or 'GRCh38'. The trailing version information (e.g. 'GRCh37p13.3') will not be present.
filter
specifies the query which contains the variant of interest. An example filter string would be: variant eq '11:61552680_G/T'
.
format
specifies the format of the response. For PheWAS, it is always objects
, which is an array of objects, each object containing the result for one association between variant and phenotype.
Here is an example request that LocusZoom.js will generate:
http://portaldev.sph.umich.edu/api/v1/statistic/phewas/?build=GRCh37&format=objects&filter=variant eq '10:114758349_C/T'
The response (JSON) must be in the following format:
{ "data": [ { "id": 45, "trait_group": "Metabolic disease", "trait_label": "Type 2 diabetes", "log_pvalue": 107.032, "variant": "10:114758349_C/T" "chromosome": "10", "position": 114758349, "build": "GRCh37", "ref_allele": "C", "ref_allele_freq": null, "score_test_stat": null, "study": "DIAGRAM", "description": "DIAGRAM 1000G T2D meta-analysis", "tech": null, "pmid": "28566273", "trait": "T2D" } ], "lastPage": null, "meta": { "build": [ "GRCh37" ] } }
Fields in red above are required fields that must be present in the response. Each record in the data
array requires:
id
: a unique identifier for each recordtrait_group
: any arbitrary grouping/category for the trait, e.g. "Metabolic diseases"trait_label
: a label for the trait, e.g. "Type 2 diabetes"log_pvalue
: -log10 p-value pmid
for the pubmed ID of the paper/analysis.)
These extra fields can be used in the tooltip or other locations.
The response should also include a meta
object, with one field build
that maps to an array of genome builds.
Typically this will only be 1 build, but we may in the future allow for converting a variant up to other builds.
lastPage
is reserved for future use when paging is implemented.