Skip to content
Merged
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
20 changes: 19 additions & 1 deletion src/logic_network_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1512,10 +1512,28 @@ def _emit_boundary_decomposition_edges(
"""
from src.neo4j_connector import get_labels

# Positional roots / terminals from the current edge list.
# Positional roots / terminals from the current edge list, IGNORING
# depletion edges.
#
# A root is "produced by no reaction in this pathway", which is what makes
# it a boundary complex worth decomposing into subunits. A depletion edge is
# not production: it is our own modelling inference, catalyst -> consumed
# input, emitted earlier in this same function. Counting it as an incoming
# edge makes a boundary complex look produced, so it silently loses its
# assembly decomposition and a knockout of one of its subunits stops
# reaching it.
#
# Found by extending phosphatase detection to non-cytosolic compartments:
# three MAPK dimers in R-HSA-450294 (p-MAPK1/3/7 -> dimer) lost their
# assembly edges purely because a new depletion edge landed on them. The
# same thing already happens wherever a cytosolic depletion edge lands on a
# boundary complex, so this is a pre-existing bug, not one the compartment
# change introduced.
sources: Set[str] = set()
targets: Set[str] = set()
for edge in pathway_logic_network_data:
if edge.get("edge_type") == "depletion":
continue
sources.add(edge["source_id"])
targets.add(edge["target_id"])
root_uuids = sources - targets # produced by no reaction in this pathway
Expand Down
Loading