Skip to content

Commit 5efbcea

Browse files
author
Chiara Rasi
committed
Parse conditionSet.MultipleConditionExplanatio value
1 parent e07be86 commit 5efbcea

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## [unreleased]
22
### Changed
33
- Updated version of external images in GitHub actions
4+
- Parse `conditionSet.MultipleConditionExplanation` value from `Explanation for multiple conditions` column of variants file
45
### Fixed
56
- Bump certifi from 2022.12.7 to 2023.7.22
67
- Description of the response returned by dry run endpoint in README file

preClinVar/file_parser.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,18 @@ def set_item_clin_sig(item, variant_dict):
6868
# customAssertionScore
6969

7070

71-
def set_item_condition_set(item, variant_dict):
71+
def set_item_condition_set(item: dict, variant_dict: dict):
7272
"""Set the conditionSet key/values for an API submission item
7373
Args:
7474
item(dict). An item in the clinvarSubmission.items list
7575
variant_dict(dict). Example: {'##Local ID': '1d9ce6ebf2f82d913cfbe20c5085947b', 'Linking ID': '1d9ce6ebf2f82d913cfbe20c5085947b', 'Gene symbol': 'XDH', 'Reference sequence': 'NM_000379.4', 'HGVS': 'c.2751del', ..}
7676
"""
77-
conditions = []
77+
conditions: list = []
7878

79-
# Check if phenotype was specified in Variant file
80-
cond_db = CONDITIONS_MAP.get(variant_dict.get("Condition ID type"))
81-
cond_values = variant_dict.get("Condition ID value")
79+
# Check if condition ID is specified in Variant file
80+
cond_db: str = CONDITIONS_MAP.get(variant_dict.get("Condition ID type"))
81+
cond_values: str = variant_dict.get("Condition ID value")
82+
multi_condition_explanation: str = variant_dict.get("Explanation for multiple conditions")
8283

8384
if cond_db and cond_values:
8485
cond_values = cond_values.split(";")
@@ -87,8 +88,8 @@ def set_item_condition_set(item, variant_dict):
8788
if conditions:
8889
item["conditionSet"] = {"condition": conditions}
8990

90-
# NOT parsing the following key/values for now:
91-
# condition.db.name
91+
if len(conditions) > 1 and multi_condition_explanation:
92+
item["conditionSet"]["MultipleConditionExplanation"] = multi_condition_explanation
9293

9394

9495
def set_item_local_id(item, variant_dict):

0 commit comments

Comments
 (0)