Skip to content

Commit a061167

Browse files
committed
anatScRNAseqQuery: emit Dataset cell as [label](short_form) markdown
Reviewer report on v2-dev: the Dataset column on "Single cell transcriptomics data for adult antennal lobe projection neuron" (and every anatScRNAseqQuery result) renders as a raw Python-dict dump: {symbol=, iri=http://flybase.org/reports/FBlc0006090, types=[Entity, Individual, DataSet, hasScRNAseq, scRNAseq_DataSet], short_form=FBlc0006090, unique_facets=[DataSet], label=scRNAseq_2018_Davie} Root cause: the RETURN clause inside get_anatomy_scrnaseq's main_query passed the `dataset` map straight through: RETURN cluster.short_form AS id, apoc.text.format("[%s](%s)", [cluster.label, cluster.short_form]) AS name, apoc.text.join(cluster.unique_facets, '|') AS tags, dataset, <-- unwrapped Cypher map pubs VFBqueryJsonProcessor's generic-cell formatter has no handler for arbitrary maps -- it has dedicated handlers for `pubs` (nested core.label) and image markdown, but anything else falls through to Map.toString(), which Java prints as the brace-equals shape above. Fix mirrors how every other clickable-label cell in VFBquery is emitted (`name`, `parent`, `template`, etc.): apoc.text.format("[%s](%s)", [dataset.label, dataset.short_form]) AS dataset Plus two coupled touchups: - columns_to_encode picks up 'dataset' so percent-encoding runs on the dataset label if it ever contains URL-unsafe chars (consistent with `name`). - Schema header `dataset.type` flips metadata -> markdown so the Java side routes it through stripMarkdownLink for display and through the existing markdown-id-extraction path for chip navigation. Matches the v2 prod "Dataset" column behaviour where the cell is a clickable label routing to the dataset's individual page. Verified locally against pdb via the same probe Robbie reported the bug on (FBbt_00067123, adult antennal lobe projection neuron): both adPN and lPN cluster rows now show `[scRNAseq_2018_Davie](FBlc0006090)` in the wire response, which the Java processor renders as the bare label "scRNAseq_2018_Davie" with a clickable id slot. Patch bump 1.14.7 -> 1.14.8. No cache bucket renames; the @with_solr_cache decorator on the wrapper invalidates entries implicitly via the function source-hash change. Related but out-of-scope for this commit: clusterExpression / GenesExpressed has the same dict-dump pattern in its `anatomy` field plus a wider column-name regression (Name vs Gene, missing Cell type / Function). Tracking separately -- "more problematic".
1 parent 45540bc commit a061167

2 files changed

Lines changed: 4 additions & 4 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.7"
6+
__version__ = "1.14.8"
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4310,7 +4310,7 @@ def get_anatomy_scrnaseq(anatomy_short_form: str, return_dataframe=True, limit:
43104310
cluster.short_form AS id,
43114311
apoc.text.format("[%s](%s)", [cluster.label, cluster.short_form]) AS name,
43124312
apoc.text.join(cluster.unique_facets, '|') AS tags,
4313-
dataset,
4313+
apoc.text.format("[%s](%s)", [dataset.label, dataset.short_form]) AS dataset,
43144314
pubs
43154315
ORDER BY cluster.label
43164316
"""
@@ -4324,7 +4324,7 @@ def get_anatomy_scrnaseq(anatomy_short_form: str, return_dataframe=True, limit:
43244324

43254325
# Encode markdown links
43264326
if not df.empty:
4327-
columns_to_encode = ['name']
4327+
columns_to_encode = ['name', 'dataset']
43284328
df = encode_markdown_links(df, columns_to_encode)
43294329

43304330
if return_dataframe:
@@ -4335,7 +4335,7 @@ def get_anatomy_scrnaseq(anatomy_short_form: str, return_dataframe=True, limit:
43354335
"id": {"title": "ID", "type": "selection_id", "order": -1},
43364336
"name": {"title": "Cluster", "type": "markdown", "order": 0},
43374337
"tags": {"title": "Tags", "type": "tags", "order": 1},
4338-
"dataset": {"title": "Dataset", "type": "metadata", "order": 2},
4338+
"dataset": {"title": "Dataset", "type": "markdown", "order": 2},
43394339
"pubs": {"title": "Publications", "type": "metadata", "order": 3}
43404340
},
43414341
"rows": [

0 commit comments

Comments
 (0)