Skip to content

Commit 8c77d7d

Browse files
committed
fix: Update score assignment to handle None values correctly in allele mapping
1 parent 1170947 commit 8c77d7d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/dcd_mapping/annotate.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def _annotate_allele_mapping(
303303
post_mapped=post_mapped,
304304
vrs_version=vrs_version,
305305
mavedb_id=mapped_score.accession_id,
306-
score=float(mapped_score.score) if mapped_score.score else None,
306+
score=float(mapped_score.score) if mapped_score.score is not None else None,
307307
annotation_layer=mapped_score.annotation_layer,
308308
error_message=mapped_score.error_message,
309309
)
@@ -403,7 +403,9 @@ def annotate(
403403
score_annotations.append(
404404
ScoreAnnotationWithLayer(
405405
mavedb_id=mapped_score.accession_id,
406-
score=float(mapped_score.score) if mapped_score.score else None,
406+
score=float(mapped_score.score)
407+
if mapped_score.score is not None
408+
else None,
407409
vrs_version=vrs_version,
408410
error_message=mapped_score.error_message,
409411
)
@@ -433,7 +435,9 @@ def annotate(
433435
post_mapped=mapped_score.post_mapped,
434436
vrs_version=vrs_version,
435437
mavedb_id=mapped_score.accession_id,
436-
score=float(mapped_score.score) if mapped_score.score else None,
438+
score=float(mapped_score.score)
439+
if mapped_score.score is not None
440+
else None,
437441
error_message=f"Multiple issues with annotation: Inconsistent variant structure (Allele and Haplotype mix).{' ' + mapped_score.error_message if mapped_score.error_message else ''}",
438442
)
439443
)

0 commit comments

Comments
 (0)