Commit 1ec48b68 authored by Vermaat's avatar Vermaat
Browse files

Warn on missing positioning scheme (fixes #114)

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@617 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent b3ca7327
......@@ -1353,6 +1353,18 @@ def process_variant(mutator, description, record, output):
'Variant description contains no mutation.')
raise _VariantError()
if not description.RefType:
# Mutalyzer assumes EST positioning scheme (like .g) in this case, but
# we should warn the user if the reference is not an EST (since it is
# probable he/she just forgot a c. or whatever).
# We currently give the warning if there is gene annotation in the
# reference.
if record.record.geneList:
output.addMessage(__file__, 2, 'WEST', 'No positioning scheme '
'specified, assuming EST. However, reference '
'does not look like an EST. Did you forget to '
'specify the positioning scheme?')
if description.RefType == 'r':
output.addMessage(__file__, 4, 'ERNA',
'Descriptions on RNA level are not supported.')
......
......@@ -102,6 +102,54 @@ class TestVariantchecker():
in self.output.getOutput('protDescriptions')
assert self.output.getOutput('newprotein')
def test_est_warning_nm_est(self):
"""
Warning for EST positioning on NM reference.
"""
check_variant('NM_003002.2:274del', self.output)
west = self.output.getMessagesWithErrorCode('WEST')
assert len(west) == 1
def test_no_est_warning_nm_c(self):
"""
No EST warning for c. positioning on NM reference.
"""
check_variant('NM_003002.2:c.274del', self.output)
west = self.output.getMessagesWithErrorCode('WEST')
assert len(west) == 0
def test_no_est_warning_nm_n(self):
"""
No EST warning for n. positioning on NM reference.
"""
check_variant('NM_003002.2:n.274del', self.output)
west = self.output.getMessagesWithErrorCode('WEST')
assert len(west) == 0
def test_est_warning_ng_est(self):
"""
Warning for EST positioning on NG reference.
"""
check_variant('NG_012772.1:128del', self.output)
west = self.output.getMessagesWithErrorCode('WEST')
assert len(west) == 1
def test_no_est_warning_ng_g(self):
"""
No EST warning for g. positioning on NG reference.
"""
check_variant('NG_012772.1:g.128del', self.output)
west = self.output.getMessagesWithErrorCode('WEST')
assert len(west) == 0
def test_no_est_warning_est_est(self):
"""
No warning for EST positioning on EST reference.
"""
check_variant('AA010203.1:54_55insG', self.output)
west = self.output.getMessagesWithErrorCode('WEST')
assert len(west) == 0
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