torchcell.knowledge_graphs
Builders for the BioCypher knowledge graph and the manifest that governs changes to the served graph. dataset_adapter_map pairs each dataset class with its adapter, and the create_* modules run a BioCypher build over a configured set of datasets. kg_manifest records, per served dataset, the schema fingerprints and adapter code the graph was built under, and decides whether a new dataset can be admitted by incremental import or requires a full rebuild; incremental_import turns one BioCypher output directory into a Neo4j incremental import; releases names and lists served releases. The package resolves its two listed submodules lazily, because each imports every dataset loader and adapter.
build_time_projection
Project the tcdb knowledge-graph BUILD (CSV-generation) time for any subset config.
Classes
One adapter's measured CSV-generation timing from a calibration build. |
|
Parsed calibration file (per-adapter timings + the measured total). |
|
A KG-build subset config, mirroring the hydra |
|
Full (uncapped) record count for one dataset, with its provenance source. |
|
Per-adapter calibrated generation rate (seconds per record processed). |
|
One adapter's projected contribution to a build under some subset config. |
|
Projected build (CSV-generation) time for a subset config, with a breakdown. |
Functions
Load and validate a calibration-timings JSON file (e.g. job 966). |
|
Return the committed full record counts as typed |
|
Fit a per-record rate for each adapter from the calibration build. |
|
Project total build time for |
|
Regenerate full record counts by reading each dataset's LMDB |
create_kg
Build a S. cerevisiae BioCypher knowledge graph from configured datasets.
Functions
Get the number of CPUs allocated by SLURM. |
create_scerevisiae_kg
Build the S. cerevisiae BioCypher knowledge graph from torchcell datasets.
Functions
Get the number of CPUs allocated by SLURM. |
create_scerevisiae_kg_small
Build a small S. cerevisiae BioCypher knowledge graph from Costanzo/Kuzmin data.
Functions
Get the number of CPUs allocated by SLURM. |
gene_interactions_scerevisae_kg
Build the S. cerevisiae gene-interaction BioCypher knowledge graph.
Functions
Get the number of CPUs allocated by SLURM. |
head_ontology
The sha256-pinned local mirror of BioCypher’s head ontology (Biolink 3.2.1).
Classes
The configured head ontology is remote, missing, or not the pinned bytes. |
|
Provenance of one mirrored head-ontology file, written beside it as JSON. |
Functions
The provenance JSON that sits beside an ontology file. |
|
Read the provenance record beside |
|
The |
|
Check the config's head ontology is a local file with its pinned sha256. |
|
Record a freshly fetched Biolink file; |
incremental_import
Turn one BioCypher output directory into a Neo4j incremental import.
Classes
One BioCypher label's files: a header plus its |
|
What this increment's relationships point at, split by where the nodes live. |
|
Everything written into a BioCypher output directory to make it incremental. |
|
Outcome of dropping relationship rows that the served store already holds. |
Functions
Group a BioCypher output directory's files by label, sorted by label. |
|
Rewrite a BioCypher node header for incremental import. |
|
Write |
|
Cypher creating THE uniqueness constraint keying the global id space. |
|
Count nodes/edges and find endpoints that lie outside this increment. |
|
The |
|
Write headers, constraints, the call script and the analysis into |
|
Which |
|
Rewrite every edge part file without the rows |
kg_manifest
The served knowledge graph’s build manifest, and the admission check for adding a dataset to it without rebuilding the others.
Classes
One BioCypher class: what the graph stores for it. |
|
The entry a served dataset grew from when it was re-admitted as a superset. |
|
A dataset as it exists in the served store. |
|
One change to the served store. |
|
What the served knowledge graph was built from, dataset by dataset. |
|
A served dataset whose schema closure no longer matches the store. |
|
Adapter code changes that could move ids or properties of SERVED nodes. |
|
Proof that a served dataset's records are all still produced by its dev LMDB. |
|
Verdict on adding one dataset to the served store incrementally. |
|
Verdict on adding SEVERAL datasets to the served store in ONE increment. |
Functions
Parse |
|
|
|
Every per-dataset adapter module and conf yaml in the working tree. |
|
Repo-relative adapter module + the conf yaml its adapter CLASS binds. |
|
Conf method names (node + edge) the dataset's adapter enables. |
|
Repo-relative path of the module that defines |
|
|
|
The value surface of the working tree (files that exist). |
|
The value surface as it was at |
|
|
|
Symbol -> fingerprint for a loader's closure, both taken at |
|
Symbol -> fingerprint for a loader's closure, from the working tree. |
|
The |
|
|
|
The tag pointing at |
|
|
|
Read a manifest JSON file. |
|
Write the manifest, stamping |
|
Reconstruct the manifest of a store built by a FULL build at |
|
The content-addressed id |
|
Experiment node ids the dev-tree LMDB of |
|
Compare the ids a store holds for a dataset with the ids its dev LMDB produces. |
|
Experiment node ids under one Dataset node of a running store. |
|
Adapter changes since the build that touch served datasets; plus new methods. |
|
Decide whether |
|
Aggregate per-dataset admission reports into one batch verdict. |
|
Decide whether every named dataset can be added in ONE incremental import. |
|
Append an admitted dataset to the manifest (call after the import succeeded). |
|
Record every member of an admitted batch under ONE event. |
|
|
|
One dataset's verdict, with the evidence each blocker is decided from. |
|
The batch verdict, every member's report, and the two cross-member views. |
|
Read an admission report; a BATCH report is the one carrying |
|
Dataset names from repeated |
|
|
release_snapshot
Committed snapshots of served knowledge-graph releases.
Classes
One served dataset as the release snapshot records it. |
|
One manifest event, reduced to what the compatibility page needs. |
|
The committed description of one served release. |
Functions
sha256 over the sorted |
|
The snapshot of a stamped manifest. |
|
Fill the package version of a snapshot whose manifest predates the spine. |
|
The snapshot paired with package |
|
|
|
Write the snapshot and its closures companion; returns the two paths. |
|
Read one snapshot file. |
|
Every committed snapshot, oldest build first (ties broken by release id). |
|
The per-dataset closure fingerprints committed beside |
releases
Knowledge-graph releases: what version a served store is, which datasets it holds, and whether a dataset’s bytes changed between two versions.
Classes
One dataset as one release serves it. |
|
The self-description a served store carries as its |
|
One database of a DBMS as |
|
Datasets by what happened to their bytes between two releases. |
|
A served dataset the local code would serialize under a different contract. |
|
Whether the local schema surface matches the contracts a release was built under. |
|
A served release and the installed package are not a pair. |
Functions
|
|
|
|
sha256 of the sorted, newline-joined ids (trailing newline). |
|
|
|
|
|
The store's release node, or None when the store predates release nodes. |
|
Write (or replace) the store's single release node; the database must be writable. |
|
The release record a manifest describes, with the measured content hashes. |
|
Give a manifest its version, release id, package version, and content hashes. |
|
Every user database of the DBMS at |
|
|
|
The database name to open for |
|
The datasets a version serves, with record counts and content hashes. |
|
Datasets unchanged (byte-identical), changed, added, and removed from |
|
Which served datasets the checkout at |
|
|
|
The compatibility verdict from a release's closures and any schema surface. |
|
The compatibility report, or |
|
The checkout this |
|
Position of |
|
Committer date of |
|
How far a served commit lags local main. |
|
The PKG cell: the tag when the build ran from one, else the version marked untagged. |
|
Table rows for one host: HOST DATABASE VERSION RELEASE PKG COMMIT# DATE DATASETS ORGANISMS NODES ALIASES STATUS. |
|
Fixed-width table with the header row. |
subset
Prefilter and subsample datasets for KG builds.
Classes
Declarative prefilter over raw dataset records, applied before sampling. |
Functions
Load gene sets from a text file: one set per line, whitespace-separated genes. |
|
Return the indices of records satisfying |
|
Return the dataset narrowed to a prefiltered pool, then randomly sampled. |
supported_queries.check
The supported-query drift check: does each registered query still hold on a release?
Classes
One way a registered query no longer holds on a release. |
|
One query's verdict, with the issue the CI job files when it fails. |
|
The check over a whole registry against one release. |
|
Node labels and relationship types a release carries, with node properties. |
Functions
BioCypher's label for a schema class: |
|
|
|
The labels and types of a release's graph schema under the |
|
|
|
Every drift of |
|
Check every registered query; exit code 1 when a supported query drifts. |
|
|
|
The named release's snapshot, or the newest committed one. |
|
|
|
Record |
supported_queries.cypher_deps
What a Cypher query reads from the graph, extracted from its text.
Functions
The query with |
|
|
|
|
|
The labels, types, properties, literals and parameters |
supported_queries.registry
The supported-query registry: which shipped .cql queries the project stands behind.
Classes
What a query reads from the graph, as extracted from its Cypher text. |
|
One registered query and where it stands in the release lifecycle. |
|
Every registered query; |
Functions
|
Not documented
Submodules left out of this page:
conf(configuration files only)