Skip to content

biothings/node-expansion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Expansion

Module for expanding terms to children.

Install

pnpm i @biothings-explorer/node-expansion

Dependencies

  1. Java 11+ (to run robot.jar)
  2. Download the script and JAR from ROBOT. The script for Mac & Linux is already downloaded.

Usage

  • by default, the module will expand terms to all descendants
const { getDescendants } = require('@biothings-explorer/node-expansion');

console.log(getDescendants(['GO:0022010', 'DOID:0060524']));

// {
//   'DOID:0060524': [
//     'DOID:0040001',
//     'DOID:0060526',
//     'DOID:0060525',
//     'DOID:0060527',
//     'DOID:0060528',
//     'DOID:0060529'
//   ]
// }
  • use recursive=false to get direct children only
const { getDescendants } = require('@biothings-explorer/node-expansion');

console.log(getDescendants(['GO:0022010', 'DOID:0060524', 'DOID:4'], recursive=false));

// {
//   'DOID:0060524': [ 'DOID:0040001', 'DOID:0060526' ],
//   'DOID:4': [
//     'DOID:0014667',
//     'DOID:0050117',
//     'DOID:0080015',
//     'DOID:14566',
//     'DOID:150',
//     'DOID:225',
//     'DOID:630',
//     'DOID:7'
//   ]
// }

Currently included ontologies

  • GO
  • DOID
  • HP
  • MONDO
  • CHEBI

Update Data Files

node download.js
  • downloads, converts, and parses all the owl files listed in the config file

References

R.C. Jackson, J.P. Balhoff, E. Douglass, N.L. Harris, C.J. Mungall, and J.A. Overton. ROBOT: A tool for automating ontology workflows. BMC Bioinformatics, vol. 20, July 2019.