Skip to content

Commit 46388fd

Browse files
committed
Merge feature/template-type-column-fixes: template/Type column fixes (v1.15.1)
2 parents 64e7079 + 4cf851c commit 46388fd

2 files changed

Lines changed: 10 additions & 10 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.15.0"
6+
__version__ = "1.15.1"
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: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,7 +2594,7 @@ def get_similar_neurons(neuron, similarity_score='NBLAST_score', return_datafram
25942594
CALL {{
25952595
WITH n2
25962596
OPTIONAL MATCH (n2)-[:INSTANCEOF]->(typ:Class)
2597-
RETURN apoc.text.join([l IN collect(DISTINCT typ.label) WHERE l IS NOT NULL AND l <> ''], '|') AS type
2597+
RETURN apoc.text.join([x IN collect(DISTINCT CASE WHEN typ.short_form IS NULL THEN NULL ELSE apoc.text.format('[%s](%s)', [coalesce(typ.symbol[0], typ.label), typ.short_form]) END) WHERE x IS NOT NULL], '; ') AS type
25982598
}}
25992599
CALL {{
26002600
WITH n2
@@ -3192,7 +3192,7 @@ def get_neuron_neuron_connectivity(short_form: str, return_dataframe=True, limit
31923192
OPTIONAL MATCH (oi)-[:INSTANCEOF]->(typ:Class)
31933193
WITH oi, down, up,
31943194
apoc.text.join(
3195-
collect(DISTINCT coalesce(typ.label, '')),
3195+
[x IN collect(DISTINCT CASE WHEN typ.short_form IS NULL THEN NULL ELSE apoc.text.format('[%s](%s)', [coalesce(typ.symbol[0], typ.label), typ.short_form]) END) WHERE x IS NOT NULL],
31963196
'; '
31973197
) AS type
31983198
ORDER BY oi.label
@@ -3283,7 +3283,7 @@ def get_neuron_region_connectivity(short_form: str, return_dataframe=True, limit
32833283
OPTIONAL MATCH (target)-[:INSTANCEOF]->(typ:Class)
32843284
WITH target, synapse_counts,
32853285
apoc.text.join(
3286-
collect(DISTINCT coalesce(typ.label, '')),
3286+
[x IN collect(DISTINCT CASE WHEN typ.short_form IS NULL THEN NULL ELSE apoc.text.format('[%s](%s)', [coalesce(typ.symbol[0], typ.label), typ.short_form]) END) WHERE x IS NOT NULL],
32873287
'; '
32883288
) AS type
32893289
ORDER BY target.label
@@ -4956,7 +4956,7 @@ def get_similar_morphology_nb_exp(expression_short_form: str, return_dataframe=T
49564956
CALL {{
49574957
WITH primary
49584958
OPTIONAL MATCH (primary)-[:INSTANCEOF]->(typ:Class)
4959-
RETURN apoc.text.join([l IN collect(DISTINCT typ.label) WHERE l IS NOT NULL AND l <> ''], '|') AS type
4959+
RETURN apoc.text.join([x IN collect(DISTINCT CASE WHEN typ.short_form IS NULL THEN NULL ELSE apoc.text.format('[%s](%s)', [coalesce(typ.symbol[0], typ.label), typ.short_form]) END) WHERE x IS NOT NULL], '; ') AS type
49604960
}}
49614961
CALL {{
49624962
WITH primary
@@ -5284,10 +5284,10 @@ def get_dataset_images(dataset_short_form: str, return_dataframe=True, limit: in
52845284
RETURN primary.short_form AS id,
52855285
'[' + primary.label + ']({VFB_REPORT_BASE}' + primary.short_form + ')' AS name,
52865286
apoc.text.join(coalesce(primary.uniqueFacets, []), '|') AS tags,
5287-
typ.label AS type,
5288-
REPLACE(apoc.text.format("[%s](%s)",[COALESCE(template.symbol[0],template.label),template.short_form]), '[null](null)', '') AS template,
5287+
REPLACE(apoc.text.format("[%s](%s)",[COALESCE(typ.symbol[0],typ.label),typ.short_form]), '[null](null)', '') AS type,
5288+
REPLACE(apoc.text.format("[%s](%s)",[COALESCE(template_anat.symbol[0],template_anat.label),template_anat.short_form]), '[null](null)', '') AS template,
52895289
technique.label AS technique,
5290-
REPLACE(apoc.text.format("[![%s](%s '%s')](%s)",[COALESCE(primary.symbol[0],primary.label) + " aligned to " + COALESCE(template.symbol[0],template.label), REPLACE(COALESCE(irw.thumbnail[0],""),"thumbnailT.png","thumbnail.png"), COALESCE(primary.symbol[0],primary.label) + " aligned to " + COALESCE(template.symbol[0],template.label), template.short_form + "," + primary.short_form]), "[![null]( 'null')](null)", "") AS thumbnail"""
5290+
REPLACE(apoc.text.format("[![%s](%s '%s')](%s)",[COALESCE(primary.symbol[0],primary.label) + " aligned to " + COALESCE(template_anat.symbol[0],template_anat.label), REPLACE(COALESCE(irw.thumbnail[0],""),"thumbnailT.png","thumbnail.png"), COALESCE(primary.symbol[0],primary.label) + " aligned to " + COALESCE(template_anat.symbol[0],template_anat.label), template_anat.short_form + "," + primary.short_form]), "[![null]( 'null')](null)", "") AS thumbnail"""
52915291
if limit != -1: main_query += f" LIMIT {limit}"
52925292

52935293
results = vc.nc.commit_list([main_query])
@@ -5310,7 +5310,7 @@ def get_all_aligned_images(template_short_form: str, return_dataframe=True, limi
53105310
RETURN DISTINCT di.short_form AS id,
53115311
'[' + di.label + ']({VFB_REPORT_BASE}' + di.short_form + ')' AS name,
53125312
apoc.text.join(coalesce(di.uniqueFacets, []), '|') AS tags,
5313-
typ.label AS type,
5313+
REPLACE(apoc.text.format("[%s](%s)",[COALESCE(typ.symbol[0],typ.label),typ.short_form]), '[null](null)', '') AS type,
53145314
REPLACE(apoc.text.format("[%s](%s)",[COALESCE(templ.symbol[0],templ.label),templ.short_form]), '[null](null)', '') AS template,
53155315
technique.label AS technique,
53165316
REPLACE(apoc.text.format("[![%s](%s '%s')](%s)",[COALESCE(di.symbol[0],di.label) + " aligned to " + COALESCE(templ.symbol[0],templ.label), REPLACE(COALESCE(irw.thumbnail[0],""),"thumbnailT.png","thumbnail.png"), COALESCE(di.symbol[0],di.label) + " aligned to " + COALESCE(templ.symbol[0],templ.label), templ.short_form + "," + di.short_form]), "[![null]( 'null')](null)", "") AS thumbnail"""
@@ -5523,7 +5523,7 @@ def get_terms_for_pub(pub_short_form: str, return_dataframe=True, limit: int = -
55235523
primary.short_form AS id,
55245524
apoc.text.format("[%s](%s)", [primary.label, primary.short_form]) AS name,
55255525
apoc.text.join(coalesce(primary.uniqueFacets, []), '|') AS tags,
5526-
coalesce(typ.label, '') AS type,
5526+
REPLACE(apoc.text.format("[%s](%s)", [COALESCE(typ.symbol[0], typ.label), typ.short_form]), '[null](null)', '') AS type,
55275527
REPLACE(apoc.text.format("[%s](%s)", [COALESCE(template_anat.symbol[0], template_anat.label), template_anat.short_form]), '[null](null)', '') AS template,
55285528
coalesce(technique.label, '') AS technique,
55295529
REPLACE(apoc.text.format("[![%s](%s '%s')](%s)", [COALESCE(primary.symbol[0], coalesce(primary.label, 'image')) + " aligned to " + COALESCE(template_anat.symbol[0], template_anat.label), REPLACE(COALESCE(irw.thumbnail[0], ''), 'thumbnailT.png', 'thumbnail.png'), COALESCE(primary.symbol[0], coalesce(primary.label, 'image')) + " aligned to " + COALESCE(template_anat.symbol[0], template_anat.label), template_anat.short_form + "," + primary.short_form]), "[![null]( 'null')](null)", "") AS thumbnail

0 commit comments

Comments
 (0)