monarch-initiative / monarchr Goto Github PK
View Code? Open in Web Editor NEWR package for easy access, manipulation, and analysis of Monarch KG data
License: Other
R package for easy access, manipulation, and analysis of Monarch KG data
License: Other
original doc: https://docs.google.com/document/d/1cbNP45X32G8BEoJgpX91gUANB5_CVCZARPh51RVgBA8/edit
This document is for rough notes on approaches for exposing Monarch via R
The idea would be to have lots of ontology logic implemented in R. This would essentially be OAK in R.
I don’t think we should pursue this unless there is someone who has the time and resources, a strong vision and extensive experience of building similar libraries
This would be a very lightweight layer that would mostly be geared around obtaining dataframes for genes, diseases, etc. It would have minimal logic. It could even be autoderived via swagger2R.
All logic would be server side. The R would mostly be retrieval
This would require two new pieces
FastAPI layer onto OAK
An OAK adapter for the new Monarch API
However, both of these are already things we want.
There may be efficiency considerations with so many layers. There would need to be some thinking about the generic FastAPI layer for OAK (e.g. OAK is naturally sync; things like connecting to a sqlite for the first time incur an initial time overhead)
For checks + docs & site build & publish to GH pages.
Trying to mass query all phenotypes in the KG by setting query to NULL and raising limit.
Running with limit<=500 works fine:
out <- monarchr::monarch_search(query = NULL,
category = "biolink:PhenotypicFeature",
limit = 500)
But after some trial and error, I found out that anything >500 causes an error:
out <- monarchr::monarch_search(query = NULL,
category = "biolink:PhenotypicFeature",
limit = 501)
Error in response_content$total :
$ operator is invalid for atomic vectors
Is this something caused by monarchR or the KG API itself?
Thanks!
Brian
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.4.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: Europe/London
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] monarchr_0.2.1
loaded via a namespace (and not attached):
[1] vctrs_0.6.5 httr_1.4.7 cli_3.6.2 knitr_1.45 rlang_1.1.3 xfun_0.43 purrr_1.0.2
[8] generics_0.1.3 assertthat_0.2.1 jsonlite_1.8.8 glue_1.7.0 htmltools_0.5.8.1 fansi_1.0.6 rmarkdown_2.26
[15] neo2R_2.4.2 evaluate_0.23 tibble_3.2.1 base64enc_0.1-3 fastmap_1.1.1 yaml_2.3.8 lifecycle_1.0.4
[22] compiler_4.3.1 dplyr_1.1.4 igraph_2.0.3 pkgconfig_2.0.3 tidyr_1.3.1 rstudioapi_0.16.0 digest_0.6.35
[29] R6_2.5.1 tidyselect_1.2.1 utf8_1.2.4 curl_5.2.1 pillar_1.9.0 magrittr_2.0.3 tidygraph_1.3.1
[36] tools_4.3.1
Hi there,
I'm in the process of developing another R package, KGExplorer
, which seeks to merge knowledge graphs from multiple biomedical resources, with a special focus on Monarch to start. I'm quite partial to the tidygraph
representation and plan to use that as one of the primary object classes, in addition to the ontology_DAG
class within simona
for ontologies.
Some potential integrations:
I was also just having a discussion with @charlieccarey about their R package of the same name:
@charlieccarey's package has some nice functionalities like searching for specific types of interactions, e.g. bioentity_interactions_assoc_w_gene
I'm mainly posting here to see if there's way we could coordinate our efforts. I haven't explored the package in your repo yet but would be happy to make contributions if there's room for it.
All the best,
Brian
Brian M. Schilder
PhD Candidate
Neurogenomics Lab
Faculty of Medicine, Department of Brain Sciences
UK Dementia Research Institute, Imperial College London
CV | bschilder.github.io/CV/CV
LinkedIn | linkedin.com/in/brian-schilder
Website I | bschilder.github.io/BMSchilder
Twitter | twitter.com/BMSchilder
Lab | neurogenomics.co.uk
Example:
eds_hits <- query_ids(c("MONDO:0007525", "MONDO:0020066", "MONDO:0034021"))
fetch_edges(eds_hits, result_categories = "biolink:Gene")
Warning: Unknown or uninitialised column: id
.Error in tbl_kgx(nodes_df) :
Error: tbl_kgx nodes must have an 'id' column.
w/ packagedown deployed to github pages
Need monarch-initiative/monarch-app#240 for bulk search
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.