Skip to content

Commit

Permalink
Several documented tweaks for recent issues, see VV code changes and …
Browse files Browse the repository at this point in the history
…issues
  • Loading branch information
Peter Causey-Freeman committed Sep 12, 2022
1 parent a2599f5 commit a8a18a1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion VariantFormatter/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion VariantFormatter/gapGenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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"] \
Expand Down Expand Up @@ -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)
Expand Down
15 changes: 9 additions & 6 deletions VariantFormatter/variantformatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit a8a18a1

Please sign in to comment.