diff --git a/VariantFormatter/formatter.py b/VariantFormatter/formatter.py index d130780..cfe053f 100644 --- a/VariantFormatter/formatter.py +++ b/VariantFormatter/formatter.py @@ -306,7 +306,6 @@ def remove_reference(hgvs_nucleotide): def gap_checker(hgvs_transcript, hgvs_genomic, genome_build, vfo): - tx_id = hgvs_transcript.ac if re.match('ENST', tx_id): hn = vfo.genebuild_normalizer diff --git a/VariantFormatter/gapGenes.py b/VariantFormatter/gapGenes.py index 10a3784..40fd8af 100644 --- a/VariantFormatter/gapGenes.py +++ b/VariantFormatter/gapGenes.py @@ -50,7 +50,6 @@ def compensate_g_to_t(hgvs_tx, vm, vfo) hgvs_tx_returns = [normalized_tx, False, None, None, None] - else: gene_symbol = hdp.get_tx_identity_info(hgvs_tx.ac)[6] @@ -102,6 +101,7 @@ def compensate_g_to_t(hgvs_tx, nw_rel_var[0], "") + # Populate output list gap_compensated_tx_2 = [nw_rel_var[0]] if "does not represent a true variant" in data["gapped_alignment_warning"] \ @@ -162,6 +162,7 @@ def fully_normalize(hgvs_tx, hgvs_genomic, hn, reverse_normalizer, vm, vfo): # Obtain the orientation of the transcript wrt selected genomic accession exon_alignments = vfo.tx_exons(tx_id, hgvs_genomic.ac, alt_aln_method) orientation = int(exon_alignments[0]['alt_strand']) + # Normalize the genomic variant 5 prime if antisense or 3 prime if sense if orientation == -1: hgvs_genomic = rhn.normalize(hgvs_genomic) diff --git a/VariantFormatter/variantformatter.py b/VariantFormatter/variantformatter.py index e3516c8..3f1c0ce 100644 --- a/VariantFormatter/variantformatter.py +++ b/VariantFormatter/variantformatter.py @@ -13,13 +13,8 @@ import collections import copy import vvhgvs.exceptions - -# import VF import VariantFormatter.formatter as formatter -# import VV import VariantValidator.modules.liftover as lo -import VariantValidator.modules.gapped_mapping -from VariantValidator.modules.variant import Variant # Custom Exceptions @@ -348,7 +343,7 @@ def __init__(self, variant_description, genome_build, vfo, transcript_model=None tx_id = tx_alignment_data[0] hgvs_transcript_dict = formatter.hgvs_genomic2hgvs_transcript(g_hgvs, tx_id, self.vfo) - # Gap checking + # Gap checking try: am_i_gapped = formatter.gap_checker(hgvs_transcript_dict['hgvs_transcript'], g_hgvs, self.genome_build, self.vfo) @@ -456,6 +451,14 @@ def __init__(self, variant_description, genome_build, vfo, transcript_model=None specified_tx_variant=specified_tx_variant ) + if "am_i_gapped" in current_lift.keys(): + if order_my_tp['gapped_alignment_warning'] is "": + order_my_tp['gapped_alignment_warning'] = current_lift['am_i_gapped'][ + 'gapped_alignment_warning'] + if order_my_tp['gap_statement'] is "": + order_my_tp['gap_statement'] = current_lift['am_i_gapped']['gap_position'] + current_lift.pop("am_i_gapped") + if g_to_g_lift == {}: g_to_g_lift = current_lift