Commit 7bc44ba1 authored by Vermaat's avatar Vermaat
Browse files

Fix a bug in commit r324, allowing ordinary delins again.


git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/refactor-mutalyzer-branch@328 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent fb2e95c4
......@@ -1115,14 +1115,6 @@ def process_raw_variant(mutator, variant, record, transcript, output):
if variant.MutationType in ['del', 'dup', 'subst', 'delins']:
_check_argument(argument, mutator.orig, first, last, output)
# Check if the inserted sequence is not a range.
# Todo: Implement this feature.
if variant.MutationType in ['ins', 'delins']:
if not argument:
output.addMessage(__file__, 4, 'ENOTIMPLEMENTED',
'Insertion of a range is not implemented yet.')
raise _RangeInsertionError()
# Substitution.
if variant.MutationType == 'subst':
apply_substitution(first, argument, sequence, mutator, record, output)
......@@ -1142,10 +1134,22 @@ def process_raw_variant(mutator, variant, record, transcript, output):
# Insertion.
if variant.MutationType == 'ins':
# Check if the inserted sequence is not a range.
# Todo: Implement this feature.
if not argument:
output.addMessage(__file__, 4, 'ENOTIMPLEMENTED',
'Insertion of a range is not implemented yet.')
raise _RangeInsertionError()
apply_insertion(first, last, argument, mutator, record, output)
# DelIns.
if variant.MutationType == 'delins':
# Check if the inserted sequence is not a range.
# Todo: Implement this feature.
if not sequence:
output.addMessage(__file__, 4, 'ENOTIMPLEMENTED',
'Insertion of a range is not implemented yet.')
raise _RangeInsertionError()
apply_delins(first, last, argument, sequence, mutator, record, output)
#process_raw_variant
......
......@@ -42,6 +42,51 @@ class TestVariantchecker():
in self.output.getOutput('protDescriptions')
assert self.output.getOutput('newprotein')
def test_insertion_in_frame(self):
"""
Simple in-frame insertion should give a simple description on protein
level.
"""
check_variant('AL449423.14(CDKN2A_v001):c.161_162insATC',
self.config, self.output)
assert_equal(self.output.getIndexedOutput('genomicDescription', 0),
'AL449423.14:g.61938_61939insGAT')
assert 'AL449423.14(CDKN2A_v001):c.161_162insATC' \
in self.output.getOutput('descriptions')
assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsIleSer)' \
in self.output.getOutput('protDescriptions')
assert self.output.getOutput('newprotein')
def test_deletion_insertion_in_frame(self):
"""
Simple in-frame deletion/insertion should give a simple description on
protein level.
"""
check_variant('AL449423.14(CDKN2A_v001):c.161_162delinsATCCC',
self.config, self.output)
assert_equal(self.output.getIndexedOutput('genomicDescription', 0),
'AL449423.14:g.61938_61939delinsGGGAT')
assert 'AL449423.14(CDKN2A_v001):c.161_162delinsATCCC' \
in self.output.getOutput('descriptions')
assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsAsnPro)' \
in self.output.getOutput('protDescriptions')
assert self.output.getOutput('newprotein')
def test_deletion_insertion_in_frame_complete(self):
"""
Simple in-frame deletion/insertion should give a simple description on
protein level, also with the optional deleted sequence argument.
"""
check_variant('AL449423.14(CDKN2A_v001):c.161_162delTGinsATCCC',
self.config, self.output)
assert_equal(self.output.getIndexedOutput('genomicDescription', 0),
'AL449423.14:g.61938_61939delinsGGGAT')
assert 'AL449423.14(CDKN2A_v001):c.161_162delinsATCCC' \
in self.output.getOutput('descriptions')
assert 'AL449423.14(CDKN2A_i001):p.(Met54delinsAsnPro)' \
in self.output.getOutput('protDescriptions')
assert self.output.getOutput('newprotein')
def test_roll(self):
"""
Just a variant where we should roll.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment