Code Monkey home page Code Monkey logo

smartapi-kg.js's Introduction

Welcome to @biothings-explorer/smartapi-kg ๐Ÿ‘‹

Coverage Status Version Documentation Maintenance

Test

Generate a meta knowledge graph of how biomedical concepts are connected based on SmartAPI Specifications with built-in filtering capabilities

๐Ÿ  Homepage

Install

npm i @biothings-explorer/smartapi-kg

Usage

  • Import and Initialize

    const kg = require("@biothings-explorer/smartapi-kg")
    //initiate a new knowledge graph class
    let meta_kg = new kg.default()
  • Load the Meta Knowledge Graph (meta-kg)

    • Option 1: Load Meta-KG from SmartAPI specs with translator tag specified

      //async load knowledge graph from SmartAPI
      await meta_kg.constructMetaKG()
    • Option 2: Load Meta-KG from SmartAPI specs with translator tag as well as ReasonerStdAPI with /predicates endpoint

      await meta_kg.constructMetaKG(includeReasoner=true);
    • Option 3: Load Meta-KG from SmartAPI specs with tags equal to biothings

      await meta_kg.constructMetaKG(includeReasoner = false, {tag: "biothings"});
    • Option 4: Load Meta-KG from SmartAPI specs with team name equal to Text Mining Provider

      await meta_kg.constructMetaKG(includeReasoner = false, {teamName: "Text Mining Provider"});
    • Option 5: Load Meta-KG from SmartAPI specs with component equal to KP

      await meta_kg.constructMetaKG(includeReasoner = false, {component: "KP"});
    • Option 6: Load Meta-KG for a specific SmartAPI spec with SmartAPI ID

      await meta_kg.constructMetaKG(includeReasoner = false, {smartAPIID: "5076f09382b38d56a77e376416b634ca"});
    • Option 7: Load Meta-KG from a local copy of SmartAPI specs included in the package

      //Alternatively, you can also sync load SmartAPI specs from a local copy within the package
      meta_kg.constructMetaKGSync();
    • Option 8: Load Meta-KG from file path you specify

        const path = require("path");
        // provide file path storing your SmartAPI file
        const file_path = path.resolve(__dirname, '../data/smartapi_multiomics_kp_query.json');
        let meta_kg = new MetaKG(file_path);
        meta_kg.constructMetaKGSync();
  • Filter the Meta-KG for specific associations based on input, output, predicate, or api combinations.

    //filter based on predicate
    meta_kg.filter({predicate: 'treats'})
    //filter based on predicate and input_id
    meta_kg.filter({predicate: 'treats', input_id: 'CHEMBL.COMPOUND'})
    //filter based on predicate and input_type
    meta_kg.filter({predicate: ['treats', 'physically_interacts_with'], input_type: 'ChemicalSubstance'})
    //filter based on input_type, output_type and api
    meta_kg.filter({ api: "Automat PHAROS API", input_type: "ChemicalSubstance", output_type: "Gene" });

Runkit Notebook Demo

Run tests

npm run test

Author

๐Ÿ‘ค Jiwen Xin

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!

๐Ÿ“ License

Copyright ยฉ 2020 Jiwen Xin.
This project is ISC licensed.


This README was generated with โค๏ธ by readme-md-generator

smartapi-kg.js's People

Contributors

kevinxin90 avatar newgene avatar ericz1803 avatar ariutta avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

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.