Skip to content

Commit eb6bddf

Browse files
committed
Merge feature/clusterexpression-function-column: clusterExpression Function column (v1.18.0)
2 parents a701fa7 + a40b3b8 commit eb6bddf

2 files changed

Lines changed: 8 additions & 5 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.17.0"
6+
__version__ = "1.18.0"
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: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,7 @@ def clusterExpression_to_schema(name, take_default):
18601860
"default": take_default,
18611861
}
18621862
preview = 5
1863-
preview_columns = ["id", "name", "tags", "expression_level", "expression_extent"]
1863+
preview_columns = ["id", "name", "tags", "expression_level", "expression_extent", "function"]
18641864

18651865
return Query(query=query, label=label, function=function, takes=takes, preview=preview, preview_columns=preview_columns)
18661866

@@ -4507,7 +4507,8 @@ def get_cluster_expression(cluster_short_form: str, return_dataframe=True, limit
45074507
iri: g.iri,
45084508
types: labels(g),
45094509
unique_facets: apoc.coll.sort(coalesce(g.uniqueFacets, [])),
4510-
symbol: coalesce(([]+g.symbol)[0], '')
4510+
symbol: coalesce(([]+g.symbol)[0], ''),
4511+
function: apoc.coll.sort([l IN labels(g) WHERE NOT l IN ['Entity','Class','Individual','Gene','Feature'] AND NOT l STARTS WITH 'has'])
45114512
}} AS gene,
45124513
primary
45134514
MATCH (a:Anatomy)<-[:composed_primarily_of]-(primary)
@@ -4525,6 +4526,7 @@ def get_cluster_expression(cluster_short_form: str, return_dataframe=True, limit
45254526
apoc.text.join(gene.unique_facets, '|') AS tags,
45264527
expression_level,
45274528
expression_extent,
4529+
apoc.text.join(coalesce(gene.function, []), '; ') AS function,
45284530
apoc.text.format("[%s](%s)", [anatomy.label, anatomy.short_form]) AS anatomy
45294531
ORDER BY expression_level DESC, gene.label
45304532
"""
@@ -4551,10 +4553,11 @@ def get_cluster_expression(cluster_short_form: str, return_dataframe=True, limit
45514553
"anatomy": {"title": "Cell type", "type": "markdown", "order": 1},
45524554
"expression_level": {"title": "Expression Level", "type": "numeric", "order": 2},
45534555
"expression_extent": {"title": "Expression Extent", "type": "numeric", "order": 3},
4554-
"tags": {"title": "Tags", "type": "tags", "order": 4}
4556+
"tags": {"title": "Tags", "type": "tags", "order": 4},
4557+
"function": {"title": "Function", "type": "text", "order": 5}
45554558
},
45564559
"rows": [
4557-
{key: row[key] for key in ["id", "name", "anatomy", "expression_level", "expression_extent", "tags"]}
4560+
{key: row[key] for key in ["id", "name", "anatomy", "expression_level", "expression_extent", "tags", "function"]}
45584561
for row in safe_to_dict(df, sort_by_id=False)
45594562
],
45604563
"count": total_count

0 commit comments

Comments
 (0)