# HG changeset patch # User bornea # Date 1472343934 14400 # Node ID 0f5028e0c39c843943592bd307c5f413bd0ecdb3 # Parent 26b5bd96332e9935521d5f17db88ec299cd8dc8f Uploaded diff -r 26b5bd96332e -r 0f5028e0c39c SAINT_preprocessing_mq_pep.py --- a/SAINT_preprocessing_mq_pep.py Sat Aug 27 20:25:09 2016 -0400 +++ b/SAINT_preprocessing_mq_pep.py Sat Aug 27 20:25:34 2016 -0400 @@ -145,6 +145,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: if uniprot_accession_in == data_line.split("|")[1]: @@ -158,6 +159,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 @@ -264,7 +267,6 @@ if seq != 'NA': if GN != 'NA': valid_prots.append(a) - print valid_prots with open('inter.txt', 'w') as input_file: l = 0; a = 0 for bb in bait: