Skip to content

Commit

Permalink
Merge 05a968d into 804f95b
Browse files Browse the repository at this point in the history
  • Loading branch information
rjchallis committed Mar 23, 2021
2 parents 804f95b + 05a968d commit 4491916
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/genomehubs/lib/fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,14 @@ def track_missing_attribute_values(
for child_id, obj in missing_attributes[node["_source"]["taxon_id"]].items():
for key, attribute in attr_dict.items():
if key in obj["keys"]:
# update aggregation source here
# TODO: #51 include ancestral rank in aggregation source
# update aggregation source to include ancestral rank
obj["attributes"].append(
{**attribute, "aggregation_source": "ancestor"}
{
**attribute,
"aggregation_source": "ancestor",
"aggregation_rank": node["_source"]["taxon_rank"],
"aggregation_taxon_id": node["_source"]["taxon_id"],
}
)
obj["keys"].remove(key)
if obj["keys"]:
Expand Down
16 changes: 16 additions & 0 deletions src/genomehubs/templates/taxon.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,22 @@
"description": "Summary source (direct, ancestor, descendant)"
}
},
"aggregation_rank": {
"type": "keyword",
"ignore_above": 16,
"normalizer": "lowercase",
"meta": {
"description": "Source rank for ancestor derived values"
}
},
"aggregation_taxon_id": {
"type": "keyword",
"ignore_above": 16,
"normalizer": "lowercase",
"meta": {
"description": "Source taxon_id for ancestor derived values"
}
},
"comment": {
"type": "text",
"index": false
Expand Down

0 comments on commit 4491916

Please sign in to comment.