Linkage disequilibrium

First we include boiler plate code to define the project, set environment variables and import libraries.

Next we define a Python string variable that we can reuse in multiple queries. These are GOR-pipe syntax definitions for the genotype freeze we use in the example.

We start by selecting a single variant from a GWAS run that we are interested in:

To explain the self-join like behaviour of the GTLD command we first show a simple query processing only 3 variants:

We notice that we get 9 rows showing the LD (D-prime and r) between each combination of variants. Also notice that the column rownum that we calculated is shown for both variants. Below, we expand the above to select only variants close (as defined by #maxdist#) to one variant of interest and also label that variant to be the only variant used as left-variant. Furthermore, we add annotations from AF, VEP and our GWAS run. These annotations are generated by the nested query defined in #panno# below.

Notice that not only do we see the annotation of the variant itself but also the corresponding annotations of the variant in LD. Commented out in the above query is a intersect join filtering to limit LD calculations only to common variants.

Finally, we expand the left-variants from a single variant to all the strongly associated variants (P <= 1e-6) and compare them with all the moderately significant variants. Keep in mind that the complexity goes up as the product of the number of variants (left and right) that overlap in the region defined by #maxdist# then times the number of samples (PNs). Hence, it is important to select these parameters in a thoughtful manner!

The examples above show how easy it is to interactively explore LD for variants of interest. It is for example trivial to modify the above queries to include a subset of the samples (e.g. by changing the use of the CSVSEL command). We have also pre-build workflows and report builders to perform LD-clumping where GWAS runs are pruned based on proximity to stronger associations.