{"id":31845974,"url":"https://github.com/ayushnoori/metapaths","last_synced_at":"2025-10-12T08:44:39.513Z","repository":{"id":58547595,"uuid":"382086164","full_name":"ayushnoori/metapaths","owner":"ayushnoori","description":"Similarity search in heterogeneous knowledge graphs using meta paths.","archived":false,"fork":false,"pushed_at":"2023-03-11T18:14:10.000Z","size":20212,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-22T15:40:01.538Z","etag":null,"topics":["knowledge-graph","metapath","network","r"],"latest_commit_sha":null,"homepage":"https://www.ayushnoori.com/metapaths","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayushnoori.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-01T15:57:51.000Z","updated_at":"2024-10-18T18:57:27.000Z","dependencies_parsed_at":"2023-02-09T11:01:00.474Z","dependency_job_id":null,"html_url":"https://github.com/ayushnoori/metapaths","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ayushnoori/metapaths","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayushnoori%2Fmetapaths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayushnoori%2Fmetapaths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayushnoori%2Fmetapaths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayushnoori%2Fmetapaths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayushnoori","download_url":"https://codeload.github.com/ayushnoori/metapaths/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayushnoori%2Fmetapaths/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010792,"owners_count":26084807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["knowledge-graph","metapath","network","r"],"created_at":"2025-10-12T08:44:22.809Z","updated_at":"2025-10-12T08:44:39.504Z","avatar_url":"https://github.com/ayushnoori.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `metapaths`: Meta-Path-Based Network Similarity Search in KGs \u003ca href=\"https://github.com/ayushnoori/metapaths\"\u003e\u003cimg src='man/figures/logo.svg' align=\"right\" width=\"170\"/\u003e\u003c/a\u003e\r\n\r\n[![docs](https://img.shields.io/badge/docs-live-brightgreen?style=for-the-badge)](https://www.ayushnoori.com/metapaths)\r\n[![website](https://img.shields.io/badge/website-live-brightgreen?style=for-the-badge)](https://zitniklab.hms.harvard.edu/projects/metapaths/)\r\n[![license: MIT](https://img.shields.io/badge/license-MPL-green.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)\r\n[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.7047209-blue?style=for-the-badge)](https://zenodo.org/badge/latestdoi/382086164)\r\n\r\nLarge-scale heterogeneous biomedical knowledge graphs (KGs) use graph structures to represent and study multi-typed relational information in biological systems. Network relationships in a KG can be quantified by similarity search methods; however, such methods must consider the diversity of node types contained within that KG. To distinguish between node types, we leverage meta paths, a general graph-theoretic approach for flexible similarity search in large networks. Meta paths are defined as sequences of node types which define a walk from the origin node to the destination node, and are widely used in biomedical network analysis.\r\n\r\nTo support meta paths in R, we present `metapaths`, the first R software package to perform meta path-based similarity search in heterogeneous KGs. The `metapaths` package offers various in-built similarity metrics for node pair comparison by querying KGs represented as either edge or adjacency lists, as well as auxiliary aggregation methods to measure set-level relationships. This framework facilitates the scalable and flexible modeling of network similarities in KGs with applications across biomedical KG learning.\r\n\r\n## Installation\r\n\r\n`metapaths` is designed for the [R](https://www.r-project.org/) programming language and statistical computing environment. To install the latest version of this package, please run the following line in your R console:\r\n\r\n```{r}\r\ndevtools::install_github(\"ayushnoori/metapaths\")\r\n```\r\n\r\n## Custom Similarity Metrics\r\n\r\nIn addition to the in-built similarity metrics, users may also define their own custom metrics. To define a custom similarity metric, please complete the following steps:\r\n\r\n1. Add a new function to [`similarity-metrics.R`](https://github.com/ayushnoori/metapaths/blob/master/R/similarity-metrics.R) with the `get_\u003csimilarity-metric\u003e()` nomenclature.\r\n\r\n2. Edit the `get_similarity_function()` function to add your metric to the list of allowed similarity metrics.\r\n\r\n3. Submit a pull request for approval.\r\n\r\n## Custom Aggregation Methods\r\n\r\nAkin to custom similarity metrics, users may also define custom aggregation methods for set-level comparison. To define a custom aggregation method, please complete the following steps:\r\n\r\n1. Add a new function to [`aggregation-methods.R`](https://github.com/ayushnoori/metapaths/blob/master/R/aggregation-methods.R) with the `get_\u003caggregation-method\u003e()` nomenclature.\r\n\r\n2. Edit the `get_aggregation_function()` function to add your metric to the list of allowed aggregation methods.\r\n\r\n3. Submit a pull request for approval.\r\n\r\n## Evaluation on a Biomedical KG\r\n\r\nEvaluation of the `metapaths` package on `ogbl-biokg`, an open-source biomedical KG available from the [Open Graph Benchmark](https://ogb.stanford.edu), recovered meaningful drug and disease-associated relationships as quantified by high similarity scores. For example, the meta path traversal function identified three paths following the specified meta path that connect donepezil – a drug used to treat Alzheimer’s disease (AD) – with the regulation of amyloid fibril formation pathway, which is implicated in AD.\r\n\r\n\u003cimg src='man/figures/metapaths_figure.svg'/\u003e\r\n\r\nAdditional usage examples are available in the [`ogbl-biokg` vignette](https://www.ayushnoori.com/metapaths/articles/biokg-demo.html).\r\n\r\n## Documentation\r\n\r\n* The `metapaths` R package is freely available under MPL 2.0 [via GitHub](https://github.com/ayushnoori/metapaths).\r\n* Package documentation and usage examples are available [here](https://www.ayushnoori.com/metapaths).\r\n* For more information, please visit the `metapaths` [project website](https://zitniklab.hms.harvard.edu/projects/metapaths/).\r\n\r\n## Citation\r\n\r\nIf you find `metapaths` useful, please cite our forthcoming paper:\r\n\r\n```\r\n@article{noori2022metapaths,\r\n  title={metapaths: similarity search in heterogeneous knowledge graphs via meta paths},\r\n  author={Noori, Ayush and Tan, Amelia L.M. and Li, Michelle M. and Zitnik, Marinka},\r\n  journal={arXiv: 2209.0000},\r\n  volume={},\r\n  number={},\r\n  pages={},\r\n  year={2022},\r\n  publisher={}\r\n}\r\n```\r\n\r\n## Contact\r\n\r\nShould any questions arise, please [open a GitHub issue](https://github.com/ayushnoori/metapaths/issues/new) or contact [anoori@college.harvard.edu](anoori@college.harvard.edu).\r\n\r\n\u003c!-- ## Build Documentation\r\n\r\nThe documentation for `metapaths` is built using the `roxygen2` package. To build the documentation, run:\r\n\r\n```{r}\r\nroxygen2::roxygenise()\r\n```\r\n\r\n## Build Website\r\n\r\nThe website for `metapaths` is built using the `pkgdown` package. To compile and render the website, run:\r\n\r\n```{r}\r\npkgdown::build_site()\r\n``` --\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayushnoori%2Fmetapaths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayushnoori%2Fmetapaths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayushnoori%2Fmetapaths/lists"}