diff --git a/mutalyzer/GenRecord.py b/mutalyzer/GenRecord.py index cd2eace40f56efc011a1ae26b2a1572d2885a2d5..05f40be534875e36fdb3dc6f3fe9dee975996d02 100644 --- a/mutalyzer/GenRecord.py +++ b/mutalyzer/GenRecord.py @@ -511,6 +511,15 @@ class GenRecord() : for j in i.transcriptList : if not j.mRNA : usableExonList = self.__checkExonList(j.exon, j.CDS) + if self.record.molType == 'n' and j.exon: + if not all(p1 + 1 == p2 for p1, p2 in + util.grouper(j.exon.positionList[1:-1])): + code = 'WEXON_ANNOTATION' if j.current else 'WEXON_ANNOTATION_OTHER' + self.__output.addMessage(__file__, 2, code, + "Exons for gene %s, transcript variant %s were " + "found not to be adjacent. This signifies a " + "possible problem in the annotation of the " + "reference sequence." % (i.name, j.name)) if not j.exon or not usableExonList : if self.record.molType == 'g' : code = 'WNOMRNA' if j.current else 'WNOMRNA_OTHER' diff --git a/tests/test_variantchecker.py b/tests/test_variantchecker.py index 4ef4dab5eb85c349262336bdf6090dde64b217b9..b4fc0a50e269aa023f95ea39c957090d89a590a7 100644 --- a/tests/test_variantchecker.py +++ b/tests/test_variantchecker.py @@ -829,3 +829,21 @@ class TestVariantchecker(): wnomrna = self.output.getMessagesWithErrorCode('WNOMRNA') wnomrna_other = self.output.getMessagesWithErrorCode('WNOMRNA_OTHER') assert len(wnomrna) == len(wnomrna_other) == 1 + + def test_mrna_ref_adjacent_exons_warn(self): + """ + Warning for mRNA reference where exons are not adjacent. + + In L41870.1 exon 15 ends on 1558 and 16 starts on 1636. + """ + check_variant('L41870.1:c.1del', self.output) + w_exon_annotation = self.output.getMessagesWithErrorCode('WEXON_ANNOTATION') + assert len(w_exon_annotation) == 1 + + def test_mrna_ref_adjacent_exons_no_warn(self): + """ + No warning for mRNA reference where exons are adjacent. + """ + check_variant('NM_133378.3:c.1del', self.output) + w_exon_annotation = self.output.getMessagesWithErrorCode('WEXON_ANNOTATION') + assert len(w_exon_annotation) == 0