Skip to content

Commit 46e24ea

Browse files
committed
Remove new flags on sequence variants
1 parent 20ff742 commit 46e24ea

File tree

4 files changed

+0
-50
lines changed

4 files changed

+0
-50
lines changed

src/hgvs/sequencevariant.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class SequenceVariant:
2020
type = attr.ib()
2121
posedit = attr.ib()
2222
gene = attr.ib(default=None)
23-
shifts_into_exon_and_intron = attr.ib(default=False)
24-
is_shifted = attr.ib(default=False)
25-
at_boundary = attr.ib(default=False)
2623

2724
def format(self, conf=None):
2825
"""Formatting the stringification of sequence variants

src/hgvs/utils/altseqbuilder.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ def __init__(self, var_c, transcript_data, translation_table=TranslationTable.st
106106
# check reference for special characteristics
107107
self._ref_has_multiple_stops = self._transcript_data.aa_sequence.count("*") > 1
108108
self._translation_table = translation_table
109-
self.at_boundary = False
110109

111110
def build_altseq(self):
112111
"""given a variant and a sequence, incorporate the variant and return the new sequence
@@ -205,38 +204,32 @@ def get_variant_region(self):
205204
and self._var_c.posedit.pos.start.base in self._transcript_data.exon_start_positions
206205
and self._var_c.posedit.pos.start.offset == 0
207206
):
208-
self.at_boundary = True
209207
result = self.INTRON if global_config.mapping.ins_at_boundary_is_intronic else self.EXON
210208
elif (
211209
self._var_c.posedit.edit.type == "dup"
212210
and self._var_c.posedit.pos.end.base in self._transcript_data.exon_end_positions
213211
and self._var_c.posedit.pos.end.offset == 0
214212
):
215-
self.at_boundary = True
216213
result = self.INTRON if global_config.mapping.ins_at_boundary_is_intronic else self.EXON
217214
elif (
218215
self._var_c.posedit.edit.type == "ins"
219216
and self._var_c.posedit.pos.start.offset == -1 and self._var_c.posedit.pos.end.offset == 0
220217
):
221-
self.at_boundary = True
222218
result = self.INTRON if global_config.mapping.ins_at_boundary_is_intronic else self.EXON
223219
elif (
224220
self._var_c.posedit.edit.type == "ins"
225221
and self._var_c.posedit.pos.start.offset == 0 and self._var_c.posedit.pos.end.offset == 1
226222
):
227-
self.at_boundary = True
228223
result = self.INTRON if global_config.mapping.ins_at_boundary_is_intronic else self.EXON
229224
elif (
230225
self._var_c.posedit.edit.type == "dup"
231226
and self._var_c.posedit.pos.end.offset == -1
232227
):
233-
self.at_boundary = True
234228
result = self.INTRON if global_config.mapping.ins_at_boundary_is_intronic else self.EXON
235229
elif (
236230
self._var_c.posedit.edit.type == "dup"
237231
and self._var_c.posedit.pos.start.offset == 1
238232
):
239-
self.at_boundary = True
240233
result = self.INTRON if global_config.mapping.ins_at_boundary_is_intronic else self.EXON
241234
elif self._var_c.posedit.pos.start.offset != 0 or self._var_c.posedit.pos.end.offset != 0:
242235
# leave out anything else intronic for now

src/hgvs/variantmapper.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,6 @@ def c_to_p(self, var_c, pro_ac=None, alt_ac=None, alt_aln_method=hgvs.global_con
445445

446446
# attempt to shift ins/dup variants from the intron into the exon or vice versa
447447
if self.shift_over_boundary:
448-
shifts_into_exon_and_intron = False
449-
is_shifted = False
450448
original_region = builder.get_variant_region()
451449
if (
452450
var_c.posedit.edit.type in ['ins', 'dup']
@@ -462,10 +460,8 @@ def c_to_p(self, var_c, pro_ac=None, alt_ac=None, alt_aln_method=hgvs.global_con
462460
continue
463461
if original_region != shifted_region:
464462
# a shift is posible
465-
shifts_into_exon_and_intron = True
466463
if self.shift_over_boundary_preference.name.lower() == shifted_region:
467464
# and that shift is preferred
468-
is_shifted = True
469465
reference_data = shifted_reference_data
470466
builder = shifted_builder
471467
break
@@ -485,10 +481,6 @@ def c_to_p(self, var_c, pro_ac=None, alt_ac=None, alt_aln_method=hgvs.global_con
485481

486482
if self.add_gene_symbol:
487483
self._update_gene_symbol(var_p, var_c.gene)
488-
var_p.at_boundary = builder.at_boundary
489-
if self.shift_over_boundary:
490-
var_p.shifts_into_exon_and_intron = shifts_into_exon_and_intron
491-
var_p.is_shifted = is_shifted
492484

493485
return var_p
494486

tests/issues/test_714.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,97 +7,69 @@
77
"var_c": "NM_004119.2:c.1837+21_1837+22insCGAGAGAATATGAATATGATCTCAAATGGGAGTTTCCAAGAGAAAATTTAGAGTTTGGTAAGAATGGAATGTGCCAAA",
88
"exonic":{
99
"var_p": "NP_004110.2:p.(Lys614_Val615insAsnGlyMetCysGlnThrArgGluTyrGluTyrAspLeuLysTrpGluPheProArgGluAsnLeuGluPheGlyLys)",
10-
"shifts_into_exon_and_intron": True,
11-
"is_shifted": True,
1210
},
1311
"intronic": {
1412
"var_p": "NP_004110.2:p.?",
15-
"shifts_into_exon_and_intron": True,
16-
"is_shifted": False,
1713
},
1814
},
1915
{
2016
"name": "dup with splice region preserved",
2117
"var_c": "NM_004119.2:c.1835_1837+3dup",
2218
"exonic":{
2319
"var_p": "NP_004110.2:p.(Gly613_Lys614insIleGly)",
24-
"shifts_into_exon_and_intron": True,
25-
"is_shifted": True,
2620
},
2721
"intronic": {
2822
"var_p": "NP_004110.2:p.?",
29-
"shifts_into_exon_and_intron": True,
30-
"is_shifted": False,
3123
},
3224
},
3325
{
3426
"name": "dup with splice region preserved",
3527
"var_c": "NM_005228.4:c.2284-5_2290dup",
3628
"exonic":{
3729
"var_p": "NP_005219.2:p.(Ala763_Tyr764insPheGlnGluAla)",
38-
"shifts_into_exon_and_intron": True,
39-
"is_shifted": True,
4030
},
4131
"intronic": {
4232
"var_p": "NP_005219.2:p.?",
43-
"shifts_into_exon_and_intron": True,
44-
"is_shifted": False,
4533
},
4634
},
4735
{
4836
"name": "dup with splice region preserved",
4937
"var_c": "NM_004456.4:c.2196-1_2196dup",
5038
"exonic":{
5139
"var_p": "NP_004447.2:p.(Tyr733AspfsTer8)",
52-
"shifts_into_exon_and_intron": True,
53-
"is_shifted": True,
5440
},
5541
"intronic": {
5642
"var_p": "NP_004447.2:p.?",
57-
"shifts_into_exon_and_intron": True,
58-
"is_shifted": False,
5943
},
6044
},
6145
{
6246
"name": "dup with splice region preserved",
6347
"var_c": "NM_016222.3:c.27+2_27+5dup",
6448
"exonic":{
6549
"var_p": "NP_057306.2:p.(Arg10ValfsTer20)",
66-
"shifts_into_exon_and_intron": True,
67-
"is_shifted": True,
6850
},
6951
"intronic": {
7052
"var_p": "NP_057306.2:p.?",
71-
"shifts_into_exon_and_intron": True,
72-
"is_shifted": False,
7353
},
7454
},
7555
{
7656
"name": "dup with splice region preserved",
7757
"var_c": "NM_182758.2:c.2953-31_2953-26dup",
7858
"exonic":{
7959
"var_p": "NP_877435.2:p.?",
80-
"shifts_into_exon_and_intron": False,
81-
"is_shifted": False,
8260
},
8361
"intronic": {
8462
"var_p": "NP_877435.2:p.?",
85-
"shifts_into_exon_and_intron": False,
86-
"is_shifted": False,
8763
},
8864
},
8965
{
9066
"name": "dup with broken cigar mapping",
9167
"var_c": "NM_000267.3:c.8315-290_8457dup",
9268
"exonic":{
9369
"var_p": "NP_000258.1:p.?",
94-
"shifts_into_exon_and_intron": False,
95-
"is_shifted": False,
9670
},
9771
"intronic": {
9872
"var_p": "NP_000258.1:p.?",
99-
"shifts_into_exon_and_intron": False,
100-
"is_shifted": False,
10173
},
10274
}
10375
]
@@ -111,13 +83,9 @@ def test_real_c_to_p(case, parser, am37):
11183
var_c = parser.parse(case["var_c"])
11284
var_p = am37.c_to_p(var_c)
11385
assert str(var_p) == case["exonic"]["var_p"]
114-
assert var_p.shifts_into_exon_and_intron == case["exonic"]["shifts_into_exon_and_intron"]
115-
assert var_p.is_shifted == case["exonic"]["is_shifted"]
11686

11787
am37.shift_over_boundary_preference = ShiftOverBoundaryPreference.INTRON
11888

11989
var_c = parser.parse(case["var_c"])
12090
var_p = am37.c_to_p(var_c)
12191
assert str(var_p) == case["intronic"]["var_p"]
122-
assert var_p.shifts_into_exon_and_intron == case["intronic"]["shifts_into_exon_and_intron"]
123-
assert var_p.is_shifted == case["intronic"]["is_shifted"]

0 commit comments

Comments
 (0)