changeset 9:dd0b4c901d0a draft

Uploaded
author bornea
date Wed, 23 Mar 2016 11:15:44 -0400
parents 355ad1ce474b
children c414a56f5874
files ProteinInteractions.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ProteinInteractions.py	Wed Mar 23 10:45:39 2016 -0400
+++ b/ProteinInteractions.py	Wed Mar 23 11:15:44 2016 -0400
@@ -81,6 +81,7 @@
 
 def get_info(uniprot_accession_in): 
     # Get aa lengths and gene name.
+    print uniprot_accession_in
     error = open('error proteins.txt', 'a+')
     i = 0
     while i == 0:
@@ -133,13 +134,14 @@
     data = read_listfile(listfile).data
     # Change to filtered list.
     SS = (read_listfile(listfile).header).index("SaintScore")
+    uni_ids = (read_listfile(listfile).header).index("PreyGene") - 1
     filt_data = []
     for i in data:
         if i[SS] >= SAINTscore:
             filt_data.append(i)
     accessions = []
     for i in filt_data:
-        accessions.append(get_info(i[1]).sp)
+        accessions.append(get_info(i[uni_ids]).sp)
     GO = []
     for i in CPDB[2:]:
         if i[3] >= CPDB_filter:
@@ -180,10 +182,11 @@
     with open('network.sif', 'wt') as y:
         data = read_listfile(listfile).data
         SS = (read_listfile(listfile).header).index("SaintScore")
+        uni_ids = (read_listfile(listfile).header).index("PreyGene") - 1
         filt_data = []
         for i in data:
             if i[SS] >= SAINTscore:
-                filt_data.append(get_info(i[1]).sp)
+                filt_data.append(get_info(i[uni_ids]).sp)
         for i in filt_data:
             if dd_network[i] != []:
                 lst = []