Skip to content

Commit 9e56149

Browse files
committed
get_individual_neuron_inputs: dedupe the thumbnail carousel + datasets
The Images/Template_Space collects had no DISTINCT, so the cross-product with INSTANCEOF types / imaging techniques repeated each alignment's thumbnail (e.g. 2 templates -> 6 thumbnails, 1 -> 3). Use collect(DISTINCT ...) so it is one thumbnail per template, and align the thumbnail markdown with the other query functions (template,imageId ref + 'aligned to' alt + '; ' separator) so the frontend reorders by the loaded template. Validated against pdb (nThumbs == nTemplates per neuron).
1 parent 327f0d1 commit 9e56149

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/vfbquery/vfb_queries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,9 +3042,9 @@ def get_individual_neuron_inputs(neuron_short_form: str, return_dataframe=True,
30423042
apoc.text.format("[%s](%s)", [b.label, b.short_form]) as Name,
30433043
apoc.text.format("[%s](%s)", [neuronType.label, neuronType.short_form]) as Type,
30443044
apoc.text.join(b.uniqueFacets, '|') as Gross_Type,
3045-
apoc.text.join(collect(apoc.text.format("[%s](%s)", [templ.label, templ.short_form])), ', ') as Template_Space,
3045+
apoc.text.join(collect(DISTINCT apoc.text.format("[%s](%s)", [templ.label, templ.short_form])), ', ') as Template_Space,
30463046
apoc.text.format("[%s](%s)", [imagingTechnique.label, imagingTechnique.short_form]) as Imaging_Technique,
3047-
apoc.text.join(collect(REPLACE(apoc.text.format("[![%s](%s '%s')](%s)",[b.label, REPLACE(COALESCE(image.thumbnail[0],""),"thumbnailT.png","thumbnail.png"), b.label, b.short_form]), "[![null]( 'null')](null)", "")), ' | ') as Images
3047+
apoc.text.join(collect(DISTINCT REPLACE(apoc.text.format("[![%s](%s '%s')](%s)",[b.label + " aligned to " + (CASE WHEN templ.symbol[0] <> '' THEN templ.symbol[0] ELSE templ.label END), REPLACE(COALESCE(image.thumbnail[0],""),"thumbnailT.png","thumbnail.png"), b.label + " aligned to " + (CASE WHEN templ.symbol[0] <> '' THEN templ.symbol[0] ELSE templ.label END), templ.short_form + "," + b.short_form]), "[![null]( 'null')](null)", "")), '; ') as Images
30483048
ORDER BY Weight Desc
30493049
"""
30503050

0 commit comments

Comments
 (0)