4.0.0 ā€¢ Published 2 years ago

@biothings-explorer/smartapi-kg v4.0.0

Weekly downloads
173
License
ISC
Repository
github
Last release
2 years ago

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();
    • Option 9: Load Meta-KG with an api list

      meta_kg.constructMetaKGSync(includeReasoner=true, {apiList: [
        {
          id: '09c8782d9f4027712e65b95424adba79',
          name: 'MyVariant.info API'
        },
        {
          id: '59dce17363dce279d389100834e43648',
          name: 'MyGene.info API'
        }
      ]});
  • 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: 'SmallMolecule'})
    //filter based on input_type, output_type and api
    meta_kg.filter({ api: "Automat PHAROS API", input_type: "SmallMolecule", 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

4.0.0

2 years ago

3.9.0

3 years ago

3.8.0

3 years ago

3.8.1

3 years ago

3.7.1

3 years ago

3.7.0

3 years ago

3.6.0

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.2.0

3 years ago

3.3.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.2.11

3 years ago

2.2.12

3 years ago

2.2.10

3 years ago

2.2.9

3 years ago

2.2.7

3 years ago

2.2.8

3 years ago

2.2.6

3 years ago

2.2.5

3 years ago

2.2.4

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.9.0

4 years ago

1.8.3

4 years ago

1.7.3

4 years ago

1.6.3

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago