Skip to content

Commit fa983fe

Browse files
committed
TransgeneExpressionHere: simplify Expressed_in to single-link
v1.14.3 introduced multi-chip rendering for Expressed_in (label1----id1; label2----id2; +N more) and switched the geppetto-vfb queryBuilderConfiguration entry from QueryLinkComponent to QueryLinkArrayComponent. A walk through the codebase showed: - No other VFBquery query populates the entityDelimiter "----" wire slots; Reference's QueryLinkArrayComponent config is scaffolding only and renders plain text per item today. - GrossTypeLabelsComponent (the only existing multi-click chip component) depends on a hardcoded label->id table in utils.js and isn't reusable for dynamic anatomy classes. - v2 prod's Expressed_in column always displayed a single value per row (e.g. "pacemaker neuron"), never a list. So the multi-chip approach was both an invention of new infrastructure and a behavioural change vs. v2 prod. Backing out: - Cypher: collapse anat_pairs from a list with cap-at-5 + "+N more" overflow to a single representative via apoc.coll.sort(collect(DISTINCT anat.label + '----' + anat.short_form))[0] which gives the alphabetically first leaf anatomy class within the Owlery closure. Deterministic, no special-case length logic. - Schema headers/preview_columns unchanged (column still exists); the wire format now matches what QueryLinkComponent expects. Verified locally on pacemaker neuron (FBbt_00006048): P{GAL4-per.BS} -> 'pacemaker neuron----FBbt_00006048' P{GAL4-tim.E} -> 'pacemaker neuron----FBbt_00006048' P{GSV6}GS10340 -> 'pacemaker neuron----FBbt_00006048' P{cry-GAL4.E} -> 'pacemaker neuron----FBbt_00006048' matching v2 prod's single-value display for the same entity. Companion geppetto-vfb commit reverts the QueryLinkArrayComponent switch and drops the batch4 multi-chip tests. Patch bump 1.14.3 -> 1.14.4. The wire format change invalidates stale @with_solr_cache buckets implicitly via shape mismatch.
1 parent bb335f2 commit fa983fe

2 files changed

Lines changed: 12 additions & 15 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.3"
6+
__version__ = "1.14.4"
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: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5424,14 +5424,15 @@ def get_transgene_expression_here(anatomy_short_form: str, return_dataframe=True
54245424
INSTANCEOF leaf subclasses, not the parent. Same closure pattern as
54255425
get_instances (v1.12.8).
54265426
5427-
v1.14.3: adds Expressed_in column. Each EP row carries the leaf
5428-
anatomy classes its Individuals are INSTANCEOF (within the Owlery
5429-
closure of the queried class), formatted as
5430-
`label----short_form; label----short_form; ...` so the geppetto-vfb
5431-
QueryLinkArrayComponent renders one clickable chip per anat
5432-
(calling window.addVfbId on click). Capped at the first 5 with
5433-
`+N more` overflow so EPs that overlap large closures stay
5434-
readable.
5427+
v1.14.3: adds Expressed_in column matching v2 prod's single-value
5428+
display. Each EP row carries ONE representative leaf anatomy class
5429+
its Individuals are INSTANCEOF (alphabetically first within the
5430+
Owlery closure of the queried class), wire-formatted as
5431+
`label----short_form` so the geppetto-vfb QueryLinkComponent
5432+
(single-link customComponent that's already on this column in
5433+
queryBuilderConfiguration.js) parses the entity id and renders it
5434+
as a clickable navigation link. No new React-side infrastructure
5435+
or wire-format invention needed.
54355436
"""
54365437
# Resolve the full subclass closure of the input anatomy class via
54375438
# Owlery. Owlery handles OWL inference (equivalence classes, defined
@@ -5473,7 +5474,7 @@ def get_transgene_expression_here(anatomy_short_form: str, return_dataframe=True
54735474
WHERE anat.short_form IN {anat_short_forms!r}
54745475
WITH ep,
54755476
collect(DISTINCT ar.pub[0]) AS pub_shorts,
5476-
collect(DISTINCT anat.label + '----' + anat.short_form) AS anat_pairs
5477+
apoc.coll.sort(collect(DISTINCT anat.label + '----' + anat.short_form))[0] AS expressed_in
54775478
ORDER BY ep.label
54785479
{limit_clause}
54795480
CALL {{
@@ -5501,11 +5502,7 @@ def get_transgene_expression_here(anatomy_short_form: str, return_dataframe=True
55015502
RETURN
55025503
ep.short_form AS id,
55035504
apoc.text.format("[%s](%s)", [ep.label, ep.short_form]) AS name,
5504-
CASE
5505-
WHEN size(anat_pairs) <= 5
5506-
THEN apoc.text.join(anat_pairs, '; ')
5507-
ELSE apoc.text.join(anat_pairs[0..5], '; ') + '; +' + toString(size(anat_pairs)-5) + ' more'
5508-
END AS expressed_in,
5505+
expressed_in,
55095506
apoc.text.join(coalesce(ep.uniqueFacets, []), '|') AS tags,
55105507
pubs,
55115508
REPLACE(apoc.text.format("[%s](%s)", [COALESCE(templ.symbol[0], templ.label), templ.short_form]), '[null](null)', '') AS template,

0 commit comments

Comments
 (0)