changeset 53:26b5bd96332e draft

Uploaded
author bornea
date Sat, 27 Aug 2016 20:25:09 -0400
parents 8031a47f67c6
children 0f5028e0c39c
files SAINT_preprocessing.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/SAINT_preprocessing.py	Wed Jun 08 10:36:32 2016 -0400
+++ b/SAINT_preprocessing.py	Sat Aug 27 20:25:09 2016 -0400
@@ -110,6 +110,7 @@
     db_len = len(data_lines)
     seqlength = 0
     count = 0
+    last_line = data_lines[-1]
     for data_line in data_lines:
         if ">sp" in data_line:
             namer = data_line.split("|")[2]
@@ -124,6 +125,8 @@
                 while ">sp" not in data_lines[match]:
                     if match <= db_len:
                         seqlength = seqlength + len(data_lines[match].strip())
+                        if data_lines[match] == last_line:
+                            break
                         match = match + 1
                     else:
                         break
@@ -140,6 +143,8 @@
             while ">sp" not in data_lines[match]:
                 if match <= db_len:
                     seqlength = seqlength + len(data_lines[match].strip())
+                    if data_lines[match] == last_line:
+                        break
                     match = match + 1
                 else:
                     break