changeset 58:4f843e0c6c40 draft

Uploaded
author bornea
date Sat, 27 Aug 2016 21:03:57 -0400
parents 677d224656e0
children 5ad68d3a11cc
files Protein_report_processing.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Protein_report_processing.py	Sat Aug 27 21:03:24 2016 -0400
+++ b/Protein_report_processing.py	Sat Aug 27 21:03:57 2016 -0400
@@ -91,6 +91,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]
@@ -105,6 +106,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
@@ -121,6 +124,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