From 4535bcd7e2ff98daa5a8ed68b97c4eb95ffe96e8 Mon Sep 17 00:00:00 2001 From: Sally Grindstaff Date: Mon, 26 Aug 2024 09:26:41 -0700 Subject: [PATCH] Add error messages for VRS id lookups --- src/dcd_mapping/annotate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dcd_mapping/annotate.py b/src/dcd_mapping/annotate.py index f594a4e..88fb6b9 100644 --- a/src/dcd_mapping/annotate.py +++ b/src/dcd_mapping/annotate.py @@ -456,7 +456,8 @@ def _get_mapped_reference_sequence( raise ValueError(msg) vrs_id = get_vrs_id_from_identifier(tx_output.np) if vrs_id is None: - raise ValueError + msg = "ID could not be acquired from Seqrepo for transcript identifier" + raise ValueError(msg) return MappedReferenceSequence( sequence_type=TargetSequenceType.PROTEIN, sequence_id=vrs_id, @@ -465,7 +466,8 @@ def _get_mapped_reference_sequence( seq_id = get_chromosome_identifier(align_result.chrom) vrs_id = get_vrs_id_from_identifier(seq_id) if vrs_id is None: - raise ValueError + msg = "ID could not be acquired from Seqrepo for chromosome identifier" + raise ValueError(msg) return MappedReferenceSequence( sequence_type=TargetSequenceType.DNA, sequence_id=vrs_id,