Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

biolink-model

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

biolink-model

A nodejs module to consume biolink model

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

A nodejs library for manipulating BioLink Model.

Test Coveralls Coverage Status

💾 Install

npm i biolink-model

📐 Usage

📢 Import and Initialize

const bl = require("biolink-model")

const biolink = new bl.BioLink();


Loading BioLink Yaml file is a required step before you can utilizing this package to traverse the hierarchy tree for BioLink predicates and classes.

The Yaml file can be loaded through a url, a local file stored within the package, or a valid file path provided.

This can be done in sync or async mode.

// load in async mode
await biolink.load();
// in sync mode
biolink.loadSync();
// load in async mode
/// the url provided below points to the most recent version of the biolink model.
await biolink.load("https://raw.githubusercontent.com/biolink/biolink-model/master/biolink-model.yaml");

This can be done in sync or async mode as well.

import path from 'path';
// load in async mode
// assume your biolink file is stored in the same folder under biolink.yaml
await biolink.load(path.resolve(__dirname, './biolink.yaml');
// in sync mode
biolink.loadSync(path.resolve(__dirname, './biolink.yaml');

const tree = biolink.classTree;

const tree = biolink.classTree;

const ancestors = tree.getAncestors("Gene")

const tree = biolink.classTree;

const descendants = tree.getDescendants("MolecularEntity")

const tree = biolink.slotTree;

const tree = biolink.slotTree;

const ancestors = tree.getAncestors("regulates")

const tree = biolink.slotTree;

const descendants = tree.getDescendants("regulates")

Keywords

FAQs

Package last updated on 16 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc