Learn R Programming

EpiGraphDB R package epigraphdb

EpiGraphDB is an analytical platform and database to support data mining in epidemiology. The platform incorporates a graph of causal estimates generated by systematically applying Mendelian randomization to a wide array of phenotypes, and augments this with a wealth of additional data from other bioinformatic sources. EpiGraphDB aims to support appropriate application and interpretation of causal inference in systematic automated analyses of many phenotypes.

epigraphdb is an R package to provide ease of access to EpiGraphDB services. We will refer to epigraphdb as the name of the R package whereas "EpiGraphDB" as the overall platform.

Installation

To install the latest development version from github ( devtools is required ):

# install.packages("devtools")
devtools::install_github("MRCIEU/epigraphdb-r")

To install a stable version from CRAN:

install.packages("epigraphdb")

NOTE: while the package repository is "epigraphdb-r", the R package name is "epigraphdb".

Using epigraphdb

epigraphdb provides a simple and intuitive way to query the API, as:

library("epigraphdb")
#>
#>   EpiGraphDB v1.0 (API: https://api.epigraphdb.org)
#>
mr(outcome_trait = "Body mass index")
#> # A tibble: 370 x 12
#>    exposure_id exposure_name outcome_id outcome_name estimate      se
#>    <chr>       <chr>         <chr>      <chr>           <dbl>   <dbl>
#>  1 627         Epiandroster… 785        Body mass i…   0.0950 2.28e-3
#>  2 541         X-11787       835        Body mass i…  -0.0578 1.77e-4
#>  3 971         Ulcerative c… 835        Body mass i…  -0.0111 1.76e-4
#>  4 60          Waist circum… 835        Body mass i…   0.861  2.07e-2
#>  5 UKB-a:426   Eye problems… 94         Body mass i…  -1.12   1.90e-2
#>  6 UKB-a:373   Ever depress… 95         Body mass i…  -0.616  4.80e-4
#>  7 29          Birth length  95         Body mass i…  -0.141  5.67e-4
#>  8 350         Laurate (12:… 974        Body mass i…   0.418  7.10e-3
#>  9 UKB-a:124   Treatment/me… 974        Body mass i…  -5.14   1.08e-1
#> 10 95          Body mass in… 974        Body mass i…   0.981  2.79e-2
#> # … with 360 more rows, and 6 more variables: p <dbl>, ci_upp <dbl>,
#> #   ci_low <dbl>, selection <chr>, method <chr>, moescore <dbl>)

For more information on how to use the epigraphdb R package and how to use the API in R please check out the following articles:

Article
Getting started with EpiGraphDB in R
Using EpiGraphDB R package
Using EpiGraphDB API (from R and command line)
Package options
Meta functionalities of the EpiGraphDB platform
Case study 1: Distinguishing vertical and horizontal pleiotropy for SNP-protein associations
Case study 2: Identification of potential drug targets
Case study 3: Triangulating causal estimates with literature evidence

Package functionalities

Users can use the general query function query_epigraphdb to get data from an API endpoint on EpiGraphDB without having to deal with HTTP requests by themselves. We also provide a list of functions (see the table below) that are equivalent to the upstream endpoints for the ease of use.

Contributing

If you would like to contribute to this package, please check out documentation on setting up development and currently planned updates.

EpiGraphDB resources

linkscreenshot
docs
API
web application
r package

Citation

Please cite EpiGraphDB as

Yi Liu, Benjamin Elsworth, Pau Erola, Valeriia Haberland, Gibran Hemani, Matt Lyon, Jie Zheng, Oliver Lloyd, Marina Vabistsevits, Tom R Gaunt, EpiGraphDB: a database and data mining platform for health data science, Bioinformatics, btaa961, https://doi.org/10.1093/bioinformatics/btaa961

@article{epigraphdb2020bioinformatics,
    author = {Liu, Yi and Elsworth, Benjamin and Erola, Pau and Haberland, Valeriia and Hemani, Gibran and Lyon, Matt and Zheng, Jie and Lloyd, Oliver and Vabistsevits, Marina and Gaunt, Tom R},
    title = {{EpiGraphDB}: a database and data mining platform for health data science},
    journal = {Bioinformatics},
    year = {2020},
    month = {11},
    issn = {1367-4803},
    doi = {10.1093/bioinformatics/btaa961},
    url = {https://doi.org/10.1093/bioinformatics/btaa961},
    note = {btaa961},
    eprint = {https://academic.oup.com/bioinformatics/advance-article-pdf/doi/10.1093/bioinformatics/btaa961/34178613/btaa961.pdf}
}

Contact

Please get in touch with us for issues, comments, suggestions, etc. via the following methods:

Copy Link

Version

Install

install.packages('epigraphdb')

Monthly Downloads

260

Version

0.2.3

License

GPL-3

Maintainer

Yi Liu

Last Published

January 14th, 2022

Functions in epigraphdb (0.2.3)

drugs_risk_factors

Drugs for risk factors
http_condition

Modified httr::http_condition
obs_cor

Observational correlations between traits
ontology_gwas_efo

Ontology association between EFO term and Gwas
stop_for_status

Catch error for an HTTP response
pathway

Pathway evidence
query_epigraphdb

Send data request to an EpiGraphDB API endpoint
meta_rels_list

List meta rels (e.g. MR, etc.)
%>%

Pipe operator
meta_rels_list_rel

List relationships under a meta relationship
meta_nodes_search_node

Search a node by its id field, or its name field
mr

Return information related to Mendelian Randomisation
flatten_response

Flatten the "results" field from an API response to a tibble df
pqtl_pleio

Return information related to the pleiotropy of SNPs
pqtl_list

Return a list of all proteins/exposures or traits/outcomes available in the database
pqtl

Return information related to the pQTL analysis
meta_nodes_list

List meta nodes (e.g. Gwas, Gene, etc.)
meta_nodes_list_node

List nodes under a meta node
xqtl_single_snp_mr

Single SNP QTL MR evidence
literature_gwas

Literature evidence regarding a GWAS trait
mappings_gene_to_protein

Return protein uniprot_id from associated genes
protein_in_pathway

For the list of proteins, returns their associated pathway data
xqtl_multi_snp_mr

Multi SNP QTL MR evidence
confounder

MR evidence on confounding traits between exposure and outcome
api_request

The very general wrapper from EpiGraphDB endpoint request
cypher

Send a query in Cypher to EpiGraphDB
genetic_cor

Genetic correlations between traits
epigraphdb-package

epigraphdb: Interface Package for the 'EpiGraphDB' Platform
api_post_request

Wrapper of httr::POST that handles status errors and custom headers
api_get_request

Wrapper of httr::GET that handles status errors and custom headers