Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions VariantValidator/modules/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,18 +759,28 @@ def transcripts_to_gene(variant, validator, select_transcripts_dict_plus_version
hgvs_refseq = 'RefSeqGene record not available'

# Predicted effect on protein
logger.info(f"Translating {hgvs_coding} in transcripts_to_gene")
try:
protein_dict = validator.myc_to_p(hgvs_coding, variant.evm, re_to_p=False, hn=variant.hn)
except NotImplementedError as e:
# import traceback
# traceback.print_exc()
logger.info(f"Protein dict creation failed with exception: {str(e)}")
protein_dict = {'hgvs_protein': None, 'error': str(e)}
variant.warnings.append(str(e))
except vvhgvs.exceptions.HGVSDataNotAvailableError as e:
# import traceback
# traceback.print_exc()
logger.info(f"Protein dict creation failed with exception: {str(e)}")
protein_dict = {'hgvs_protein': None, 'error': str(e)}
variant.warnings.append(str(e))
else:
logger.info(f"Protein dict creation successful: {protein_dict}")

if protein_dict['error'] == '':
if protein_dict['error'] == '' or protein_dict['error'].startswith('ProteinTranslationInfo:'):
hgvs_protein = protein_dict['hgvs_protein']
if protein_dict['error']:
variant.warnings.append(protein_dict['error'])
else:
error = protein_dict['error']
if not error.startswith('ProteinTranslationError:' ):
Expand Down Expand Up @@ -829,8 +839,10 @@ def transcripts_to_gene(variant, validator, select_transcripts_dict_plus_version
try:
# Predicted effect on protein
protein_dict = validator.myc_to_p(c_for_p, variant.evm, re_to_p=False, hn=variant.hn)
if protein_dict['error'] == '':
if protein_dict['error'] == '' or protein_dict['error'].startswith('ProteinTranslationInfo:'):
hgvs_protein = protein_dict['hgvs_protein']
if protein_dict['error']:
variant.warnings.append(protein_dict['error'])
else:
error = protein_dict['error']
if error == 'Cannot identify an in-frame Termination codon in the variant mRNA sequence':
Expand All @@ -846,8 +858,10 @@ def transcripts_to_gene(variant, validator, select_transcripts_dict_plus_version
if hgvs_coding.posedit.pos.start.offset == 0 and hgvs_coding.posedit.pos.start.offset == 0 and \
'?' in str(hgvs_protein):
protein_dict = validator.myc_to_p(hgvs_coding, variant.evm, re_to_p=False, hn=variant.hn)
if protein_dict['error'] == '':
if protein_dict['error'] == '' or protein_dict['error'].startswith('ProteinTranslationInfo:'):
hgvs_protein = protein_dict['hgvs_protein']
if protein_dict['error']:
variant.warnings.append(protein_dict['error'])
else:
error = protein_dict['error']
if error == 'Cannot identify an in-frame Termination codon in the variant mRNA sequence':
Expand Down
2 changes: 0 additions & 2 deletions VariantValidator/modules/seq_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,6 @@ def to_accession(chr_num, primary_assembly):
'HSCHR1_6_CTG31': 'NW_025791755.1',
'HG1384_PATCH': 'NW_021159988.1',
'HG2231_HG2496_PATCH': 'NW_025791767.1',
'NW_025791768.1': 'NW_025791768.1',
'HG2052_PATCH' : 'NW_025791766.1',
'HSCHR2_6_CTG1': 'NW_025791763.1',
'HSCHR2_10_CTG7_2': 'NW_025791760.1',
Expand Down Expand Up @@ -3305,7 +3304,6 @@ def to_chr_num_refseq(accession, primary_assembly):
'NW_025791755.1': 'HSCHR1_6_CTG31',
'NW_021159988.1': 'HG1384_PATCH',
'NW_025791767.1': 'HG2231_HG2496_PATCH',
'NW_025791768.1': 'NW_025791768.1',
'NW_025791766.1': 'HG2052_PATCH',
'NW_025791763.1': 'HSCHR2_6_CTG1',
'NW_025791760.1': 'HSCHR2_10_CTG7_2',
Expand Down
2 changes: 2 additions & 0 deletions VariantValidator/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ def pro_inv_info(prot_ref_seq, prot_var_seq):
"""
Function which predicts the protein effect of c. inversions
"""
logger.info("pro_inv_info function called")
info = {
'variant': 'true',
'prot_del_seq': '',
Expand Down Expand Up @@ -392,6 +393,7 @@ def pro_inv_info(prot_ref_seq, prot_var_seq):


def pro_delins_info(prot_ref_seq, prot_var_seq, in_frame=False):
logger.info(f"pro_delins_info function called")
info = {
'variant': 'true',
'prot_del_seq': '',
Expand Down
Loading