Mercurial > repos > bornea > saint_preprocessing
comparison SAINT_preprocessing_mq_pep.py @ 35:26cc583a4ae4 draft
Uploaded
author | bornea |
---|---|
date | Thu, 19 May 2016 10:02:48 -0400 |
parents | 05c5844e037b |
children | bc9c7764cc2f |
comparison
equal
deleted
inserted
replaced
34:05c5844e037b | 35:26cc583a4ae4 |
---|---|
126 if prey == 'true': | 126 if prey == 'true': |
127 make_prey(MaxQuant_input) | 127 make_prey(MaxQuant_input) |
128 no_error_inter(MaxQuant_input) | 128 no_error_inter(MaxQuant_input) |
129 os.rename('prey.txt', sys.argv[5]) | 129 os.rename('prey.txt', sys.argv[5]) |
130 elif prey == 'false': | 130 elif prey == 'false': |
131 if os.path.isfile('error proteins.txt') == True: | 131 if os.path.isfile('./error_proteins.txt') == True: |
132 no_error_inter(MaxQuant_input) | 132 no_error_inter(MaxQuant_input) |
133 pass | 133 pass |
134 elif prey != 'true' or 'false': | 134 elif prey != 'true' or 'false': |
135 sys.exit("Invalid Prey Argument: Y or N") | 135 sys.exit("Invalid Prey Argument: Y or N") |
136 os.rename('inter.txt', sys.argv[4]) | 136 os.rename('inter.txt', sys.argv[4]) |
137 os.rename("bait.txt", sys.argv[7]) | 137 os.rename("bait.txt", sys.argv[7]) |
138 | 138 |
139 | 139 |
140 def get_info(uniprot_accession_in): | 140 def get_info(uniprot_accession_in): |
141 # Get aa lengths and gene name. | 141 # Get aa lengths and gene name. |
142 error = open('error proteins.txt', 'a+') | 142 error = open('./error_proteins.txt', 'a+') |
143 data = open(fasta_db, 'r') | 143 data = open(fasta_db, 'r') |
144 data_lines = data.readlines() | 144 data_lines = data.readlines() |
145 db_len = len(data_lines) | 145 db_len = len(data_lines) |
146 seqlength = 0 | 146 seqlength = 0 |
147 count = 0 | 147 count = 0 |
237 output_file.close() | 237 output_file.close() |
238 | 238 |
239 | 239 |
240 def no_error_inter(MaxQuant_input): | 240 def no_error_inter(MaxQuant_input): |
241 # Remake inter file without protein errors from Uniprot. | 241 # Remake inter file without protein errors from Uniprot. |
242 err = readtab("error proteins.txt") | 242 err = readtab("./error_proteins.txt") |
243 bait = readtab(baitfile) | 243 bait = readtab(baitfile) |
244 data = read_MaxQuant(MaxQuant_input).data | 244 data = read_MaxQuant(MaxQuant_input).data |
245 header = read_MaxQuant(MaxQuant_input).header | 245 header = read_MaxQuant(MaxQuant_input).header |
246 header = [MQ_var.replace(r"\"", "") for MQ_var in header] | 246 header = [MQ_var.replace(r"\"", "") for MQ_var in header] |
247 header = [MQ_var.replace(r"Intensity.", r"") for MQ_var in header] | 247 header = [MQ_var.replace(r"Intensity.", r"") for MQ_var in header] |