Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion bin/check-no-path-cases-in-neo4j.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@

from src.neo4j_connector import get_graph # noqa: E402

MP_BIOPATH_DIR = Path("/home/awright/gitroot/mp-biopath-pathways")
# Overridable so the path is not tied to one machine; the default follows the
# same ~/gitroot layout the rest of the tooling assumes.
MP_BIOPATH_DIR = Path(os.environ.get("MPBIO_ROOT",
str(Path.home() / "gitroot" / "mp-biopath-pathways")))


def load_pathway_lookup() -> dict[str, str]:
Expand Down
5 changes: 4 additions & 1 deletion bin/validate-against-mpbiopath.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
from src.argument_parser import logger # noqa: E402
from src.neo4j_connector import get_graph # noqa: E402

MP_BIOPATH_DIR = Path("/home/awright/gitroot/mp-biopath-pathways")
# Overridable so the path is not tied to one machine; the default follows the
# same ~/gitroot layout the rest of the tooling assumes.
MP_BIOPATH_DIR = Path(os.environ.get("MPBIO_ROOT",
str(Path.home() / "gitroot" / "mp-biopath-pathways")))
DOWN, NORMAL, UP = 0, 1, 2
MAX_ITERATIONS = 50

Expand Down
8 changes: 4 additions & 4 deletions specs/001-validator-fidelity/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ generator deliberately re-represents Reactome:
A validator that fails on correct output is worse than no validator: it trains
the reader to ignore it, and it masks the real defects underneath.

## Architecture principle (Adam, 2026-09)
## Architecture principle (stated 2026-09)

> We want to make the LNGs in a way that represents them based on how curators
> intended to design them. And DeltaSignal would figure out how best to
> process them.
The logic networks should represent pathways as the curators intended them to
be designed; it is DeltaSignal's job to work out how best to process that
representation.

Validation follows from this: the validator must check **faithfulness to
curator intent under the generator's chosen representation**, not
Expand Down
6 changes: 3 additions & 3 deletions src/diagram_connectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def augment_reaction_connections(pathway_id: str,
def diagram_glyph_positions(pathway_id: str) -> Dict[Tuple[str, str, str], List[int]]:
"""``(reaction_stId, entity_stId, role) -> [glyph_id]`` for one pathway.

Adam: *"two nodes in the reactome pathway diagram that are in the same
compartment could be the same thing but in two different places. We need
to be able to know which one the uuid was from."*
Requirement: two glyphs in the same compartment of a Reactome pathway
diagram can draw the same entity in two different places, and it must be
possible to tell which of them a uuid came from.

That identity exists and this module already read it — ``x["id"]`` on each
input/output/catalyst entry is the DiagramObject id, which is what the
Expand Down
2 changes: 1 addition & 1 deletion src/logic_network_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ def _emit_precedingevent_handoff_edges(
complex on the other — so bundling makes them different nodes and the link is
lost. This is NOT a heuristic: the ``precedingEvent`` edge is in Neo4j.

Rule (per Adam): for each precedingEvent pair, do nothing if the reactions are
The rule: for each precedingEvent pair, do nothing if the reactions are
ALREADY connected by a shared whole entity (the curator's asserted entity is
represented). Only when they share no whole entity — yet the curator says
they're connected — add ONE bridge, between the output/input nodes that share
Expand Down
6 changes: 3 additions & 3 deletions src/resolution_validation.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Completeness checks for node_resolution.csv, in both directions.

Adam's requirement: "we need to be able to map every node in the database to
the LNG node perfectly. and same with the other way around." "Perfectly" is
not checkable, so it is expressed here as: no absence goes undeclared.
Requirement: every node in the database must map to an LNG node, and back
again. "Perfectly" is not checkable, so it is expressed here as: no absence
goes undeclared.

Pure functions over already-loaded rows, deliberately free of the filesystem
and Neo4j, so the negative control in
Expand Down
6 changes: 3 additions & 3 deletions tests/test_provenance_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def test_glyph_id_and_diagram_are_written_together(tmp_path, monkeypatch):

Glyph ids are unique only WITHIN a diagram — the same integer identifies a
different drawing in another one — so a row carrying one without the other
cannot be resolved back to anything. This is the invariant behind Adam's
question: knowing a uuid came from glyph 535 is only useful if you also
know which diagram 535 belongs to.
cannot be resolved back to anything. This is the invariant behind the
original question: knowing a uuid came from glyph 535 is only useful if you
also know which diagram 535 belongs to.
"""
monkeypatch.setattr(m, "get_labels", lambda e: ["EntityWithAccessionedSequence"], raising=False)

Expand Down
Loading