rejuve-bio / biocypher-kg

MIT License
0 stars 6 forks source link

BioCypher MeTTa

A project for creating BioCypher-driven knowledge graphs and outputs MeTTa files.

βš™οΈ Installation (local)

  1. Clone this repository.

    git clone https://github.com/Habush/biocypher-metta.git
  2. Install the dependencies using Poetry. (Or feel free to use your own dependency management system. We provide a pyproject.toml to define dependencies.)

    poetry install
  3. You are ready to go!

    poetry shell
    python create_knowledge_graph.py

πŸ›  Usage

Structure

The project template is structured as follows:

.
β”‚  # Project setup
β”‚
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ pyproject.toml
β”‚
β”‚  # Docker setup
β”‚
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ docker
β”‚Β Β  β”œβ”€β”€ biocypher_entrypoint_patch.sh
β”‚Β Β  β”œβ”€β”€ create_table.sh
β”‚Β Β  └── import.sh
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ docker-variables.env
β”‚
β”‚  # Project pipeline
|── biocypher_metta
β”‚Β Β  β”œβ”€β”€ adapters
β”‚Β Β  β”œβ”€β”€ metta_writer.py
β”‚
β”œβ”€β”€ create_knowledge_graph.py
β”œβ”€β”€ config
β”‚Β Β  β”œβ”€β”€ biocypher_config.yaml
β”‚Β Β  β”œβ”€β”€ biocypher_docker_config.yaml
β”‚Β Β  └── schema_config.yaml

The main components of the BioCypher pipeline are the create_knowledge_graph.py, the configuration in the config directory, and the adapter module in the biocypher_metta directory. The input adapters are used for preprocessing biomedical databases and converting them into a BioCypher nodes and edges. The metta_writer.py script contains code to convert these BioCypher nodes and edges into MeTTa represntation.