Exploring the Genotype–Phenotype Map from R and Python
Researchers can now explore the OpenGWAS Genotype–Phenotype Map (GPMap) from either R or Python. Andrew Elmore and Gibran Hemani’s gpmapr reached CRAN on 7th November, and Andrew Elmore and Tom Gaunt’s gpmappy reached 1.0.0 on PyPI on 23rd October. Both packages let researchers look up traits, genes and variants from a script.

Figure: An example GPMap workflow in R, using haemoglobin concentration as a starting point. Original schematic; no study data are plotted.
From a trait to its genetic neighbours in R
In our February introduction to GPMap, we described how the resource groups associations that appear to share a genetic signal. The R package makes it possible to bring those results into a reproducible analysis. For instance, the haemoglobin tutorial starts with haemoglobin concentration, retrieves groups of colocalising associations, and then looks more closely at evidence around the iron-regulating gene TMPRSS6.
install.packages("gpmapr")
gpmapr::search_gpmap("haemoglobin")
Using GPMap from Python
The Python client reached version 1.0.0 on 23 October. A 1.0.1 update followed on 19 November.
python -m pip install gpmappy
from gpmappy import GpmapClient
client = GpmapClient()
matches = client.search_gpmap("haemoglobin", as_dataframe=False)
print(matches[:5])
If you prefer pandas DataFrames, install gpmappy[dataframe]. The Python documentation shows how to follow up a search result.
A shared signal is a lead to investigate, not proof that one trait causes another. The R documentation includes examples for following up a lead by trait, gene or genomic region. You can also explore the GPMap website.