openvar / variantValidator

Public repository for VariantValidator project
GNU Affero General Public License v3.0
71 stars 21 forks source link

Internal server error: "local variable 'result' referenced before assignment" #593

Closed ifokkema closed 7 months ago

ifokkema commented 8 months ago

Describe the bug An internal server error occurs when running protein prediction of certain variants through the LOVD endpoint (others are untested).

To Reproduce See this URL: https://rest.variantvalidator.org/LOVD/lovd/hg19/NC_000001.10%3Ag.224621676G%3EA/refseq/all/False/False?content-type=application%2Fjson. The output is:

{
  "error": "local variable 'result' referenced before assignment"
}

Note that turning off the protein prediction prevents the error from happening: https://rest.variantvalidator.org/LOVD/lovd/hg19/NC_000001.10%3Ag.224621676G%3EA/refseq/all/tx/False?content-type=application%2Fjson

Other variants affected: NC_000006.11:g.57512931_57512932insT and NC_000002.11:g.38303017_38303018insG, although the latter throws a different internal server error.

Peter-J-Freeman commented 7 months ago

Related to https://github.com/openvar/variantValidator/issues/597

Peter-J-Freeman commented 7 months ago

Have fixed NC_000002.11:g.38303017_38303018insG and https://rest.variantvalidator.org/LOVD/lovd/hg19/NC_000001.10%3Ag.224621676G%3EA/refseq/all/False/False?content-type=application%2Fjson.

Working on NC_000006.11:g.57512931_57512932insT

Peter-J-Freeman commented 7 months ago

Also now fixed. PRIM2 was missing from our gap genbe list. Will be added.

Peter-J-Freeman commented 7 months ago

p.s. the alignment of this UTR is chaos

see the warning

{
"NC_000006.11:g.57512931_57512932insT": {
"NC_000006.11:g.57512931_57512932insT": {
"g_hgvs": "NC_000006.11:g.57512931_57512932insT",
"genomic_variant_error": null,
"hgvs_t_and_p": {
"NM_000947.5": {
"gap_statement": "NM_000947.5 contains 11 extra bases between c.*87_*88, and 3 fewer bases between c.*103_*104, and 1 extra bases between c.*234_*235, and 2 extra bases between c.*242_*243, and 3 extra bases between c.*367_*368, and 4 extra bases between c.*456_*457 than NC_000006.11",
"gapped_alignment_warning": "Submitted description does not represent a true variant because it is an artefact of aligning NM_000947.5 with NC_000006.11 (genome build GRCh37)",
"gene_info": {
"hgnc_id": "HGNC:9370",
"symbol": "PRIM2"
},
"p_hgvs_slc": "NP_000938.2:p.?",
"p_hgvs_tlc": "NP_000938.2:p.?",
"select_status": {
"mane_select": true,
"refseq_select": true
},
"t_hgvs": "NM_000947.5:c.*245del",
"transcript_variant_error": null
}
},
"p_vcf": "6:57512931:G:GT",
"selected_build": "hg19"
},
"errors": [],
"flag": null
},
"metadata": {
"variantformatter_version": "2.2.1.dev29+g3033271",
"variantvalidator_hgvs_version": "2.2.0",
"variantvalidator_version": "2.2.1.dev539+g8a3b4db.d20240412",
"vvdb_version": "vvdb_2023_8",
"vvseqrepo_db": "VV_SR_2024_01/master",
"vvta_version": "vvta_2024_01"
}
}
Peter-J-Freeman commented 7 months ago

@ifokkema Will update the servers in the next couple of weeks

Peter-J-Freeman commented 7 months ago

looking at this position, there are 2 additional bases in the transcript.

2 extra bases between c.*242_*243

The genomic description adds one of them in NC_000006.11:g.57512931_57512932insT, so we lost 1 transcript base.

so we are predicting NM_000947.5:c.*245del (which makes sense since it is a del and will likely 3 prime normalize away from the gap, but I have not checked the exact sequence).

ifokkema commented 7 months ago

I'm now also getting this failure for NC_000003.11:g.49568328G>T. Validating the variant by itself works, but trying to get a mapping to transcripts fails.

ifokkema commented 7 months ago

A variant close by, NC_000003.11:g.49568848_49568850del, also fails. More:

Peter-J-Freeman commented 7 months ago

@ifokkema . All fixed. Will push changes soon and update the servers