Skip to content

Commit 0d1726f

Browse files
committed
fix: add check for nullable score set urn
1 parent a2cc796 commit 0d1726f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/mavedb/scripts/tabular_clinvar_submission.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,13 @@ def _write_tabular(
285285
rows = []
286286
for v in variants:
287287
v_urn = v.variant.urn
288+
ss_urn = v.variant.score_set.urn
288289
if not v_urn:
289290
logger.warning(f"Mapped variant ID {v.id} is missing URN; skipping")
290291
continue
292+
if not ss_urn:
293+
logger.warning(f"Mapped variant URN {v_urn} is missing score set URN; skipping")
294+
continue
291295

292296
fully_qualified_assay_hgvs = v.hgvs_assay_level
293297
if not fully_qualified_assay_hgvs:
@@ -301,7 +305,9 @@ def _write_tabular(
301305
)
302306
continue
303307

304-
variant_url = f"{MAVEDB_FRONTEND_URL}/score-sets/{quote_plus(v.variant.score_set.urn, safe='')}?variant={quote_plus(v.variant.urn, safe='')}"
308+
variant_url = (
309+
f"{MAVEDB_FRONTEND_URL}/score-sets/{quote_plus(ss_urn, safe='')}?variant={quote_plus(v_urn, safe='')}"
310+
)
305311

306312
condition_id = "MedGen" # the database used for condition IDs.
307313
condition_value = "C0012634" # example condition ID for generic disease, which is what is exported via VA-Spec. Should we be more specific?

0 commit comments

Comments
 (0)