Repository 'saint_preprocessing'
hg clone https://toolshed.g2.bx.psu.edu/repos/bornea/saint_preprocessing

Changeset 40:8102ffab0f85 (2016-05-19)
Previous changeset 39:e414a55b4c42 (2016-05-19) Next changeset 41:ca0649bf68e3 (2016-05-19)
Commit message:
Uploaded
modified:
SAINT_preprocessing_mq_pep.py
b
diff -r e414a55b4c42 -r 8102ffab0f85 SAINT_preprocessing_mq_pep.py
--- a/SAINT_preprocessing_mq_pep.py Thu May 19 10:29:44 2016 -0400
+++ b/SAINT_preprocessing_mq_pep.py Thu May 19 10:35:15 2016 -0400
[
@@ -251,6 +251,7 @@
         bait_index.append(header.index(bait_item[0]))
     proteins = read_MaxQuant(MaxQuant_input).proteins
     errors = []
+    valid_prots = []
     for e in err:
         errors.append(e[0])
     for a in proteins:
@@ -260,18 +261,18 @@
         # Ditto for \r.
         seq = get_info(a).seqlength
         GN = get_info(a).genename
-        if seq == 'NA':
-            if GN == 'NA':
-                errors.append(a)
+        if seq != 'NA':
+            if GN != 'NA':
+                valid_prots.append(a)
     with open('inter.txt', 'w') as input_file:
         l = 0; a = 0
         for bb in bait:
             for lst in data:
-                if proteins[a] not in errors:
+                if valid_prots[a] not in errors:
                     input_file.write(header[bait_index[l]] + '\t' + bb[1] + '\t' + proteins[a] + '\t' 
                             + lst[bait_index[l]] + '\n')
                 a += 1
-                if a == len(proteins):
+                if a == len(valid_prots):
                     l += 1; a = 0