diff --git a/mutalyzer/variantchecker.py b/mutalyzer/variantchecker.py index d0b5faef876f092917078832a62b63d6baa038c0..7b5dc5ed54b1c8e94e4c6b4236f0f04403e8c8fe 100644 --- a/mutalyzer/variantchecker.py +++ b/mutalyzer/variantchecker.py @@ -1223,7 +1223,7 @@ def _add_transcript_info(mutator, transcript, output): """ # Add transcript info to output. if transcript.transcribe: - output.addOutput('myTranscriptDescription', transcript.description) + output.addOutput('myTranscriptDescription', transcript.description or '=') output.addOutput('origMRNA', str(util.splice(mutator.orig, transcript.mRNA.positionList))) output.addOutput('mutatedMRNA', @@ -1661,7 +1661,7 @@ def check_variant(description, output): if ';' in record.record.description: generated_description = '[' + record.record.description + ']' else: - generated_description = record.record.description + generated_description = record.record.description or '=' output.addOutput('genomicDescription', '%s:%c.%s' % \ (reference, record.record.molType, generated_description)) @@ -1673,7 +1673,7 @@ def check_variant(description, output): if ';' in record.record.chromDescription: chromosomal_description = '[' + record.record.chromDescription + ']' else: - chromosomal_description = record.record.chromDescription + chromosomal_description = record.record.chromDescription or '=' output.addOutput('genomicChromDescription', '%s:%c.%s' % \ (record.record.recordId, record.record.molType, chromosomal_description)) @@ -1694,7 +1694,7 @@ def check_variant(description, output): if ';' in transcript.description: generated_description = '[' + transcript.description + ']' else: - generated_description = transcript.description + generated_description = transcript.description or '=' if record.record._sourcetype == 'LRG': if transcript.name: diff --git a/tests/test_variantchecker.py b/tests/test_variantchecker.py index 65d5c45cdd71784a0688ae390832e960fcdc98de..f5ae5034f58b5103f4dcf7c61bfb15484912771f 100644 --- a/tests/test_variantchecker.py +++ b/tests/test_variantchecker.py @@ -6,6 +6,7 @@ Tests for the variantchecker module. #import logging; logging.basicConfig() from nose.tools import * +from mutalyzer.util import skip from mutalyzer.output import Output from mutalyzer.variantchecker import check_variant @@ -496,3 +497,33 @@ class TestVariantchecker(): '31317229:n.105del') assert '31317229(FCER1A_v001):c.6del' \ in self.output.getOutput('descriptions') + + def test_nop_nm(self): + """ + Variant on NM without effect should be described as '='. + """ + check_variant('NM_002001.2:c.1_3delinsATG', self.output) + error_count, _, _ = self.output.Summary() + assert_equal(error_count, 0) + assert_equal(self.output.getIndexedOutput('genomicDescription', 0), + 'NM_002001.2:n.=') + assert 'NM_002001.2(FCER1A_v001):c.=' \ + in self.output.getOutput('descriptions') + + @skip + def test_nop_ud(self): + """ + Variant on UD without effect should be described as '='. + + Todo: We cannot use UD references in unit tests, unless we implement + a way to create them inside the unit test. + """ + check_variant('UD_127955523176:g.5T>T', self.output) + error_count, _, _ = self.output.Summary() + assert_equal(error_count, 0) + assert_equal(self.output.getIndexedOutput('genomicChromDescription', 0), + 'NC_000023.10:g.=') + assert_equal(self.output.getIndexedOutput('genomicDescription', 0), + 'UD_127955523176:g.=') + assert 'UD_127955523176(DMD_v001):c.=' \ + in self.output.getOutput('descriptions') diff --git a/tests/test_webservice.py b/tests/test_webservice.py index 7d179e6fc403805603c0cf773661de80300cab0c..f50ecc3e3597969755d9d69fd77982fdd8006e0a 100644 --- a/tests/test_webservice.py +++ b/tests/test_webservice.py @@ -8,6 +8,7 @@ from mutalyzer.util import monkey_patch_suds; monkey_patch_suds() import os from datetime import datetime, timedelta import mutalyzer +from mutalyzer.util import skip from mutalyzer.output import Output from mutalyzer.sync import CacheSync from mutalyzer import Db @@ -334,9 +335,13 @@ class TestWebservice(): assert_equal(r.sourceGi, '222352156') assert_equal(r.molecule, 'n') + @skip def test_runmutalyzer_reference_info_ud(self): """ Get reference info for a UD variant. + + Todo: We cannot use UD references in unit tests, unless we implement + a way to create them inside the unit test. """ r = self.client.service.runMutalyzer('UD_129433404385:g.1del') assert_equal(r.errors, 0)