From 4e9bd5f224de48eba8c3225552293fbed6b0eb03 Mon Sep 17 00:00:00 2001
From: "J.F.J. Laros" <j.f.j.laros@lumc.nl>
Date: Wed, 28 Nov 2012 17:57:45 +0000
Subject: [PATCH] Frameshift detection error (#124) fixed.

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

diff --git a/mutalyzer/describe.py b/mutalyzer/describe.py
index 3ce67751..44e62646 100644
--- a/mutalyzer/describe.py
+++ b/mutalyzer/describe.py
@@ -256,6 +256,9 @@ def fitFS(peptide, altPeptide, FS):
     @arg FS: Frame shift table.
     @type FS: dict
     """
+    if len(peptide) < len(altPeptide):
+        return False
+
     pList = __makeOverlaps(peptide)
 
     for i in range(len(altPeptide)):
@@ -761,7 +764,9 @@ def protein_description(M, s1, s2, s1_start, s1_end, s2_start, s2_end):
         FS1, FS2 = makeFSTables(1) # Standard coding table.
 
         if (fitFS(s1[s1_start + 1:], s2[s2_start + 1:], FS1) or
-            fitFS(s1[s1_start + 1:], s2[s2_start + 1:], FS2)):
+            fitFS(s1[s1_start + 1:], s2[s2_start + 1:], FS2) or
+            fitFS(s2[s2_start + 1:], s1[s1_start + 2:], FS1) or
+            fitFS(s2[s2_start + 1:], s1[s1_start + 2:], FS2)): 
             return [RawVar(DNA=False, start=s1_start + 1, deleted=s1[s1_start],
                 inserted=s2[s2_start], term=len(s2) - s2_start, type="fs")]
     #if
-- 
GitLab