Skip to content

Commit 8dcb415

Browse files
committed
get_template_roi_tree: expand walk relationships to reach all painted leaves
Robbie reported the Adult T1 Leg (VFB_00120000) ROI tree was missing painted domains on v2-dev. Live diagnostic on pdb revealed two separate problems: 1. Only 4 of 678 painted-domain `in_register_with` relationships on VFB_00120000 carry the `ie.index` property — so the existing `WHERE exists(ie.index)` filter drops 99.5% of legitimate painted domains for this template. The master painted-domain volume on the CDN /data/VFB/i/0012/0000/VFB_00120000/Leg40-poisson_simple_expanded.nrrd delineates ~256 distinct uint8 stamp labels, suggesting the volume geometry is intact — it's the pdb bookkeeping that's incomplete. 2. Even if all 48 distinct painted classes had `ie.index` set, the current walk (root)<-[:SUBCLASSOF|part_of|innervates*0..]-(leaf) only reached 12 of them from the anatomy_root. The missed leaves connect via has_sensory_dendrite_in (sensory neurons), fasciculates_with (nerves), attached_to_part_of (muscle cells), sends_synaptic_output_to_cell (motor neurons). Adding those to the relationship list takes the reachable node count from 12 to 80 (full 48-leaf coverage plus the structural parents). This release fixes (2) only — adds the 4 missing relationship types to the walk. The `WHERE exists(ie.index)` filter stays in place; (1) is the right scope for an upstream pdb-curation fix rather than a VFBquery workaround. The list of 45 currently- unindexed leg painted classes is reported separately at Claude CoWork/reports/VFB_00120000-missing-painted-domain-index.md for the curation step. `overlaps` is deliberately omitted from the new walk — it's a very broad spatial relationship in FBbt and would pull in classes that merely co-locate with leg structures without being part of the leg ontology. Sanity: JRC2018U (rich-index brain): 46 indexed painted classes, walk now reaches 77 reachable nodes (was 12; under-walking fixed for the brain too). Adult T1 Leg: 4 indexed painted classes (unchanged until pdb curation), walk now reaches 7 nodes (was 3; the few leaves that ARE indexed get their structural parents in the tree properly). Patch bump 1.14.5 -> 1.14.6.
1 parent 79a04d6 commit 8dcb415

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
here = path.abspath(path.dirname(__file__))
55

6-
__version__ = "1.14.5"
6+
__version__ = "1.14.6"
77

88
# Get the long description from the README file
99
with open(path.join(here, 'README.md')) as f:

src/vfbquery/vfb_queries.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5028,7 +5028,20 @@ def get_template_roi_tree(template_short_form: str, return_dataframe=False):
50285028
f"WITH t, root, "
50295029
f"[r IN painted_rows WHERE r.class_id IS NOT NULL] AS painted_rows "
50305030
f"WITH t, root, painted_rows, [r IN painted_rows | r.class_id] AS leaf_ids "
5031-
f"OPTIONAL MATCH path = (root)<-[:SUBCLASSOF|part_of|innervates*0..]-(leaf:Class) "
5031+
# v1.14.6: expanded the relationship set used to reach painted
5032+
# leaves. The previous walk (SUBCLASSOF | part_of | innervates)
5033+
# missed every sensory neuron, motor neuron, muscle attachment
5034+
# and fasciculating axon — exactly the bulk of painted domains
5035+
# on the leg / VNC templates. Live diagnostic on Adult T1 Leg
5036+
# (VFB_00120000) showed 39 hops via part_of, 20 via SUBCLASSOF,
5037+
# 15 via has_sensory_dendrite_in, 9 via fasciculates_with,
5038+
# 3 via attached_to_part_of, 1 via sends_synaptic_output_to_cell
5039+
# when walking each painted class to the anatomy_root.
5040+
# `overlaps` is deliberately omitted — it's a very broad
5041+
# spatial relationship in FBbt and would pull in classes that
5042+
# merely co-locate with leg structures without being part of
5043+
# the leg ontology.
5044+
f"OPTIONAL MATCH path = (root)<-[:SUBCLASSOF|part_of|innervates|has_sensory_dendrite_in|fasciculates_with|attached_to_part_of|sends_synaptic_output_to_cell*0..]-(leaf:Class) "
50325045
f"WHERE leaf.short_form IN leaf_ids "
50335046
f"WITH t, root, painted_rows, "
50345047
f"collect(distinct [n IN nodes(path) | "

0 commit comments

Comments
 (0)