From 36f8b58229b56ade2e1d7711997edd43445c425c Mon Sep 17 00:00:00 2001 From: "Husen M. Umer" Date: Tue, 15 Nov 2022 11:45:24 +0300 Subject: [PATCH] fixes issue #72 --- pypgatk/cgenomes/cgenomes_proteindb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pypgatk/cgenomes/cgenomes_proteindb.py b/pypgatk/cgenomes/cgenomes_proteindb.py index ed8b128..1ba0efd 100644 --- a/pypgatk/cgenomes/cgenomes_proteindb.py +++ b/pypgatk/cgenomes/cgenomes_proteindb.py @@ -121,6 +121,8 @@ def get_mut_pro_seq(snp, seq): if "Missense" in snp.type: mut_aa = snp.aa_mut[-1] + if not mut_aa.isalpha(): + return '' index = int(positions[0]) - 1 mut_pro_seq = protein_seq[:index] + mut_aa + protein_seq[index + 1:] elif "Nonsense" in snp.type: @@ -146,6 +148,8 @@ def get_mut_pro_seq(snp, seq): except ValueError: return '' mut_aa = snp.aa_mut[index + 1:] + if not mut_aa.replace('*','').isalpha(): + return '' if "deletion" in snp.type: del_index1 = int(positions[0]) - 1 del_index2 = int(positions[1])