- Install pipx
- Install poetry using
pipx install poetry git clone https://github.com/Knowledge-Graph-Hub/kg-microbe.gitcd kg-microbepoetry install
poetry run kg download: This will download the resources needed for this project.
poetry run kg transform: This transforms the resources into knowledge graphs (KGs).
poetry run kg merge: This merges all transformed graphs above.
The standard merge writes data/merged/merged-kg.tar.gz, containing
merged-kg_nodes.tsv and merged-kg_edges.tsv, and writes statistics to
merged_graph_stats.yaml. To work with the TSV files directly:
tar -xzf data/merged/merged-kg.tar.gz -C data/merged
make run-summarymake run-summary also reads the archive directly, so extraction is optional.
The canonical merge.yaml build is the release graph. Other merge configs use
distinct names such as merged-kg-minimal.tar.gz,
merged-kg-no-metatraits.tar.gz, and merged-kg-prego-full.tar.gz, so running a
variant cannot masquerade as the canonical graph. The source differences are
defined in config/merge_variants.yaml.
Published releases use their own asset names. For example, the 2025-03-07
release provides kg-microbe-core.tar.gz and kg-microbe-biomedical.tar.gz;
the 2024-08-26 release provides 20240826.tar.gz. These historical assets
do not include the proposed artifact-provenance.txt sidecar. Inspect each
release's actual asset list and archive contents rather than assuming that
current build statistics or manifests are included.
The release.yml workflow is configured to publish
kg-microbe-YYYYMMDD.tar.gz plus artifact-provenance.txt, but its download
step still depends on the retired kg-hub endpoint
(#887).
This describes the workflow contract, not a successfully published artifact.
Download builds from GitHub releases:
- All releases: releases
- Latest curated release: releases/latest
- Merged graph matching the 2024-08-26 taxa-to-media predictions:
2024-08-26/20240826.tar.gz
(SHA-256
5eae75b3d189dc61cb53a3b2348435c6fcf6941d98538af3e789f7059d0a67fa)
Pin a specific release tag and verify the checksum for reproducible downstream
work. The former https://kg-hub.berkeleybop.io/kg-microbe/... dated and
current URLs are no longer served (they return 404); GitHub releases are the
supported distribution channel.
In order to be able to make KG releases on this repository, you'll need:
- Appropriate permissions to this repository.
- A GitHub token that has permissions on this repository. This is how you set it in GitHub. Make sure your token has access to this project.
- Save this token locally in the environment variable
GH_TOKEN:GitHub CLI reads the variable directly. Do not place the token in a Git URL, repository file, or shell history.export GH_TOKEN=XXXX
It should be noted that the KG construction process, particularly the transform step involving trimming of NCBI Taxonomy for any KG and the steps involving the microbial UniProt dataset for KG-Microbe-Function and KG-Microbe-Biomedical-Function, is computationally intensive. Successful execution on a local machine may require significant memory resources (e.g., >500 GB of RAM), further details can be found in the project's code repository.
Please remember to run poetry run tox before every commit to make sure the code you commit is error-free.
If you need to use environment variables for this project, copy .env.example to .env and set the environment variables accordingly:
cp .env.example .envThen edit the .env file to configure the required environment variables for your setup.
This cookiecutter project was developed from the kg-cookiecutter template and will be kept up-to-date using cruft.
