From 5508f7e66ec8c12aabeb3ab9aba636b39260d249 Mon Sep 17 00:00:00 2001 From: Lauren Rekerle Date: Wed, 2 Oct 2024 12:35:06 -0500 Subject: [PATCH] Found bug if there are no protein features. Fixed it by skipping if hgvs_p is None. --- src/gpsea/view/_protein_viewer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gpsea/view/_protein_viewer.py b/src/gpsea/view/_protein_viewer.py index cc5e42e8c..d958c6f66 100644 --- a/src/gpsea/view/_protein_viewer.py +++ b/src/gpsea/view/_protein_viewer.py @@ -77,6 +77,8 @@ def _prepare_context(self, cohort: Cohort) -> typing.Mapping[str, typing.Any]: fields = hgvs_p.split(":") if len(fields) == 2: hgvs_p = fields[1] + else: + continue target_region = target_annot.protein_effect_location if target_region is None: # can happen for certain variant classes such as splice variant. Not an error @@ -105,7 +107,7 @@ def _prepare_context(self, cohort: Cohort) -> typing.Mapping[str, typing.Any]: 'variants': variant_list, } ) - + non_feature_count = len(non_feature_to_variant_list) non_feature_variants = "; ".join(set(non_feature_to_variant_list))