torchcell.database

Commands that build and serve the torchcell Neo4j knowledge graph. The package exports BuildCommand, a Cliff command that runs the database image build scripts; tcdb (the console script declared in pyproject.toml) is the Cliff entry point in torchcell.database.tcdb. Other modules create the Neo4j directory tree, combine BioCypher output directories into one import set, build a single registered dataset’s LMDB for admission, and hold the client connection settings and the Neo4j Browser stylesheet.

browser_style

Neo4j Browser graph stylesheet (GRASS) for the served torchcell graph.

Classes

browser_style.NodeRule

One node.<Label> {...} block.

browser_style.RelationshipRule

The single relationship {...} block: every edge is a membership edge.

browser_style.Caption

One caption entry as the Browser stores it (Z9 in the served bundle).

browser_style.SeedNodeStyle

What the Browser stores for one label after importing a node.<Label> rule.

browser_style.SeedState

The persisted graphStyling slice: the whitelist of its redux-persist config.

Functions

browser_style.schema_node_labels

Graph label -> is_a for every node class in the BioCypher schema config.

browser_style.lane_of

The ontology lane of a graph label; phenotypes come from their is_a.

browser_style.node_rules

Ancestor rules first (gray, small), then one colored rule per schema node class.

browser_style.render

The complete stylesheet text.

browser_style.seed_state

The styling the Browser would hold after "Upload GraSS styles" of render().

browser_style.persisted_value

The local-storage value redux-persist writes.

browser_style.stylesheet_sha256

sha256 of the rendered stylesheet; the seed re-runs when it changes.

browser_style.render_seed_js

The script the patched Browser page loads before its own bundle.

build_command

Cliff command for building the torchcell database image via shell scripts.

Classes

build_command.BuildCommand

A simple command that builds something.

build_dataset_lmdb

Build ONE registered dataset’s LMDB in the dev tree, for knowledge-graph admission.

Functions

build_dataset_lmdb.dataset_default_root

The loader's default root (relative to DATA_ROOT), e.g. data/torchcell/x.

build_dataset_lmdb.resolve_dataset_class

Look a dataset class up by name in the registry (importing the loader package).

build_dataset_lmdb.build_dataset

Instantiate dataset_class under data_root so it builds its LMDB; return it.

connection

Client-side Neo4j connection settings, resolved from the environment.

Classes

connection.Neo4jConnectionSettings

Where torchcell clients find the served knowledge graph, and which version.

Functions

connection.neo4j_connection_settings

Resolve connection settings from the environment at call time.

tcdb

Cliff-based command-line entry point for the torchcell database.

Classes

tcdb.TCDB

Cliff application exposing the torchcell database build commands.