From a34e40d1443eb45fd4696f17a5c2eea228b38371 Mon Sep 17 00:00:00 2001
From: Martijn Vermaat <martijn@vermaat.name>
Date: Fri, 25 Feb 2011 15:15:48 +0000
Subject: [PATCH] Do not roll over splice sites in RNA.

This was already implemented, but I added a few comments to the code. This
fixes issue #37.



git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@191 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
---
 src/Mutalyzer.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Mutalyzer.py b/src/Mutalyzer.py
index fe1f1e65..9d7564c0 100644
--- a/src/Mutalyzer.py
+++ b/src/Mutalyzer.py
@@ -879,12 +879,15 @@ def checkDeletionDuplication(start_g, end_g, mutationType, MUU,
 
     roll = __roll(MUU.orig, start_g, end_g)
 
+    # In the case of RNA, check if we roll over a splice site. If so, make
+    # the roll shorter, just up to the splice site.
     shift = roll[1]
     if GenRecordInstance.record.molType == 'n' :
         mRNA = GenRecordInstance.record.geneList[0].transcriptList[0
             ].mRNA.positionList
         for i in mRNA :
             if end_g <= i and end_g + roll[1] > i :
+                # Do a shorter roll, just up to the splice site
                 print "ALARM"
                 shift = i - end_g
                 print shift
@@ -893,7 +896,6 @@ def checkDeletionDuplication(start_g, end_g, mutationType, MUU,
         #for
     #if
 
-
     if shift : # FIXME, The warning may not be apropriate.
         newStart = start_g + shift
         newStop = end_g + shift
@@ -977,12 +979,15 @@ def checkInsertion(start_g, end_g, Arg1, MUU, GenRecordInstance, O) :
     newStop = MUU.shiftpos(start_g) + insertionLength
     roll = __roll(MUU.mutated, newStart + 1, newStop)
 
+    # In the case of RNA, check if we roll over a splice site. If so, make
+    # the roll shorter, just up to the splice site.
     shift = roll[1]
     if GenRecordInstance.record.molType == 'n' :
         mRNA = GenRecordInstance.record.geneList[0].transcriptList[0
             ].mRNA.positionList
         for i in mRNA :
             if newStop <= i and newStop + roll[1] > i :
+                # Do a shorter roll, just up to the splice site
                 print "ALARM"
                 shift = i - newStop
                 print shift
-- 
GitLab