Mercurial > repos > bornea > saint_preprocessing
comparison SAINT_preprocessing.py @ 14:c22c1209e65f draft
Uploaded
author | bornea |
---|---|
date | Tue, 12 Apr 2016 14:55:25 -0400 |
parents | febb6def95cb |
children | 876af85d782c |
comparison
equal
deleted
inserted
replaced
13:febb6def95cb | 14:c22c1209e65f |
---|---|
55 bait_line = baits[i] + "\t" + baits[i+1] + "\t" + T_C + "\n" | 55 bait_line = baits[i] + "\t" + baits[i+1] + "\t" + T_C + "\n" |
56 read_infile = open(infile, "r") | 56 read_infile = open(infile, "r") |
57 for input_line in read_infile: | 57 for input_line in read_infile: |
58 input_line = input_line.strip() | 58 input_line = input_line.strip() |
59 temp = input_line.split('\t') | 59 temp = input_line.split('\t') |
60 if "Accession Number" in str(temp): | 60 bait_cache.append((number_bait, str(bait_line))) |
61 if baits[i] in temp: | |
62 number_bait = temp.index(str(baits[i])) | |
63 number_bait = number_bait - 9 | |
64 bait_cache.append((number_bait, str(bait_line))) | |
65 # Locates the Bait names in the column names and then sets the Baits in the | |
66 # correct order in the cache thus the - 9 because the baits start at the 9th | |
67 # column. | |
68 else: | |
69 print "Error: bad bait " + str(baits[i]) | |
70 sys.exit() | |
71 else: | |
72 pass | |
73 i = i + 3 | 61 i = i + 3 |
74 | 62 |
75 bait_cache.sort() | 63 bait_cache.sort() |
76 for cache_line in bait_cache: | 64 for cache_line in bait_cache: |
77 bait_file_tmp.write(cache_line[1]) | 65 bait_file_tmp.write(cache_line[1]) |
211 elif "_YEAST" in prot_id: | 199 elif "_YEAST" in prot_id: |
212 proteins.append(prot_id) | 200 proteins.append(prot_id) |
213 elif "_MOUSE" in prot_id: | 201 elif "_MOUSE" in prot_id: |
214 proteins.append(prot_id) | 202 proteins.append(prot_id) |
215 else: | 203 else: |
216 print "Accession must be uniprot ID or gene name" | 204 print "Accession must be uniprot ID or gene" |
217 return ReturnValue2(data, proteins, header) | 205 return ReturnValue2(data, proteins, header) |
218 | 206 |
219 | 207 |
220 def make_inter(Scaffold_input): | 208 def make_inter(Scaffold_input): |
221 bait = readtab(baitfile) | 209 bait = readtab(baitfile) |