Coder Social home page Coder Social logo

mrcieu / epigraphdb-r Goto Github PK

View Code? Open in Web Editor NEW
26.0 10.0 7.0 6.02 MB

R package for epigraphdb

Home Page: http://mrcieu.github.io/epigraphdb-r

License: GNU General Public License v3.0

Makefile 6.42% R 92.72% CSS 0.09% Dockerfile 0.77%
graph-database api-client bioinformatics epidemiology mendelian-randomization phenotypes

epigraphdb-r's Introduction

EpiGraphDB R package epigraphdb

CRAN status Codecov test coverage

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.

API r package
General query
query_epigraphdb
Topic queries
GET /mr mr
GET /ontology/gwas-efo ontology_gwas_efo
GET /obs-cor obs_cor
GET /genetic-cor genetic_cor
GET /pqtl/ pqtl
GET /pqtl/pleio/ pqtl_pleio
GET /pqtl/list pqtl_list
GET /confounder confounder
GET /pathway pathway
GET /drugs/risk-factors drugs_risk_factors
GET /xqtl/multi-snp-mr xqtl_multi_snp_mr
GET /xqtl/single-snp-mr xqtl_single_snp_mr
GET /literature/gwas literature_gwas
POST /protein/in-pathway protein_in_pathway
Utilities
POST /mappings/gene-to-protein mappings_gene_to_protein
GET /meta/nodes/list meta_nodes_list
GET /meta/rels/list meta_rels_list
GET /meta/nodes/{meta_node}/list meta_nodes_list_node
GET /meta/rels/{meta_rel}/list meta_rels_list_rel
GET /meta/nodes/{meta_node}/search meta_nodes_search_node
POST /cypher cypher

Contributing

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

EpiGraphDB resources

link screenshot
docs docs
API api
web application webapp
r package epigraphdb-r

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:

epigraphdb-r's People

Contributors

mvab avatar yiliu6240 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

epigraphdb-r's Issues

Remove {styler} dependency

Hi, author of the formatting package {styler} here. As I judge from a search in your source code, there is no functionality that uses {styler}, in other words {styler} is not a runtime dependency. You may recommend people to format their code when they contribute, so {styler} is a development dependency. Adding {styler} as a dependency (via Imports: or Suggests:) to your package has the following drawbacks:

  • Your user's may install a package they don't need (assuming most people who install your package are useres, not developers). This costs additional bandwith, installation time, disk space etc... If they need it, they can just manually install it.
  • I as a maintainer of {styler} have to run reverse dependency checks (R CMD Check your package with my new version of {styler}) upon submitting to CRAN e.g. with {revdepcheck}. {styler} has more than 40 reverse dependencies, which makes this a long process.

For that reason, I suggest you to drop that dependency from your package. If you want to ensure your code remains styled, I recommend {precommit} to apply {styler} on each commit or other tools described in the third-party integrations website of {styler}.

For the removal to take effect, a CRAN submission of your package is required (but the issue is not urgent). For tracking, this issue is referenced in r-lib/styler#1121.

Error accessing pQTL gene list through R package

Error while retrieving list of genes with pQTLs

library("epigraphdb")
set.seed(123)
 
# get list of genes with pQTLs
genes <- query_epigraphdb(
      route = "/pqtl/list/",
      params = list(flag="exposures"),
      mode = "table",
      method = "GET"
)

Returns

Error in curl::curl_fetch_memory(url, handle = handle): TCP connection reset by peer
Request failed [ERROR]. Retrying in 4 seconds...

Here is my session

> sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /mnt/storage/software/apps/R-3.6.0/lib64/R/lib/libR.so
LAPACK: /mnt/storage/software/apps/R-3.6.0/lib64/R/lib/libRlapack.so

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] epigraphdb_0.2.2

loaded via a namespace (and not attached):
[1] httr_1.4.2     compiler_3.6.0 R6_2.5.0       magrittr_2.0.1 tools_3.6.0   
[6] glue_1.4.2     curl_4.3.1    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.