Skip to content

Commit

Permalink
Merge pull request #22 from monarch-initiative/fix-limiting-of-closur…
Browse files Browse the repository at this point in the history
…e-fields

fix limiting of closure fields
  • Loading branch information
kevinschaper authored Jan 15, 2025
2 parents e3f9d8d + 95e8e9a commit faf9327
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions closurizer/closurizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ def edge_columns(field: str, include_closure_fields: bool =True):
column_text = f"""
{field}.name as {field}_label,
{field}.category as {field}_category,
{field}.namespace as {field}_namespace,
list_aggregate({field}_closure.closure, 'string_agg', '|') as {field}_closure,
list_aggregate({field}_closure_label.closure_label,'string_agg', '|') as {field}_closure_label,
{field}.namespace as {field}_namespace,
"""
if include_closure_fields:
column_text += f"""
{field}_closure.closure as {field}_closure,
{field}_closure_label.closure_label as {field}_closure_label,
"""

if field in ['subject', 'object']:
column_text += f"""
{field}.in_taxon as {field}_taxon,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "closurizer"
version = "0.7.0"
version = "0.7.1"
description = "Add closure expansion fields to kgx files following the Golr pattern"
authors = ["Kevin Schaper <[email protected]>"]

Expand Down

0 comments on commit faf9327

Please sign in to comment.