Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jan 3, 2024
1 parent 97ecf0f commit deec92d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gene/etl/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,16 @@ def record_order(record: Dict) -> Tuple:
"ensembl_biotype": set(),
"strand": set(),
}
if len(records) > 1:
merged_attrs["xrefs"] = list({r["concept_id"] for r in records[1:]})

# merge from constituent records
set_fields = ["aliases", "previous_symbols", "strand"]
scalar_fields = ["symbol", "symbol_status", "label", "location_annotations"]
scalar_fields = [
"symbol",
"symbol_status",
"label",
"location_annotations",
"xrefs",
]
for record in records:
for field in set_fields:
merged_attrs[field] |= set(record.get(field, set()))
Expand Down

0 comments on commit deec92d

Please sign in to comment.