Skip to contents

Background

It is often difficult to determine how specific the instruments for a particular trait are. For example if you have a particular measure of adiposity, how do you know that the instruments are not also associated with other measures of adiposity? It may be the case that there is a cluster of traits that are statistically indistinguishable from one another in an MR framework. This aims to illustrate how to create trait clusters based on the similarity of the instruments used to measure them.

The gpmapr package provides a way to cluster traits based on instrument similarity. This is done by starting with an index trait, identifying instruments for that trait, and then searching for traits with similar associations. Finally, it uses a conditional F-statistic measure to determine how to cluster traits.

1. Get instruments

Provide a trait within the https://gpmap.opengwas.io database

bmi_instruments <- get_instruments(trait = "ieu-a-2")

2. Get traits that are associated with the same instruments

bmi_phewas <- phewas(variants = bmi_instruments$variants) %>%
    wide_format()

3. Get clusters

bmi_clusters <- get_clusters(phewas_result = bmi_phewas)