-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
178 lines (147 loc) · 6.14 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import formatPathwayGenes
import formatSpecies
import Control
import Align
import csv
def run(letter):
csv_out = letter + ".csv"
with open("Species\\files_info.csv", 'r') as species_in:
read_species = csv.reader(species_in, delimiter=',')
Align.openOutFile(csv_out)
for row in read_species:
if row[0][0] == letter:
current_species = row[0]
db = Align.buildSpeciesDB(row[0])
for protein in protein_names:
results = Align.alignSequence(current_species, protein, db)
Align.parseResults(results, current_species, protein, csv_out)
print(current_species + ": " + protein)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
out = "scored_results_50.csv"
Align.openOutFile3(out)
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for letter in alphabet:
Align.parseCSV("CSVResults\\" + letter + ".csv", out, 50)
out = "scored_results_60.csv"
Align.openOutFile3(out)
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for letter in alphabet:
Align.parseCSV("CSVResults\\" + letter + ".csv", out, 60)
protein_names = ["thiolase", "beta hydroxybutyryl-CoA dehydrogenase",
"crotonase", "butyryl-CoA dehydrogenase",
"electron transfer flavoprotein alpha-subunit",
"electron transfer flavoprotein beta-subunit",
"butyryl-COA-transferase", "phoasephate butyryltransferase",
"butyrate kinase"]
# Controls: Run on 3/15/2021 at 4:37 pm
# csv_out = "control.csv"
# with open("Species\\control_files_info.csv", 'r') as species_in:
# read_species = csv.reader(species_in, delimiter=',')
#
# Align.openOutFile(csv_out)
#
# for row in read_species:
# current_species = row[0]
# db = Align.buildSpeciesDB(row[0])
# for protein in protein_names:
# results = Align.alignSequence(current_species, protein, db)
# Align.parseResults(results, current_species, protein, csv_out)
# print(current_species + ": " + protein)
# Species that start with A: Run on 3/15/2021 at 4:50 pm
# csv_out = "A.csv"
# with open("Species\\files_info.csv", 'r') as species_in:
# read_species = csv.reader(species_in, delimiter=',')
#
# Align.openOutFile(csv_out)
#
# for row in read_species:
# if row[0][0] == 'A':
# current_species = row[0]
# db = Align.buildSpeciesDB(row[0])
# for protein in protein_names:
# results = Align.alignSequence(current_species, protein, db)
# Align.parseResults(results, current_species, protein, csv_out)
# print(current_species + ": " + protein)
# # Species that start with B: Run on 3/15/2021 at 5:15 pm
# letter = 'B'
# csv_out = letter + ".csv"
# with open("Species\\files_info.csv", 'r') as species_in:
# read_species = csv.reader(species_in, delimiter=',')
#
# Align.openOutFile(csv_out)
#
# for row in read_species:
# if row[0][0] == letter:
# current_species = row[0]
# db = Align.buildSpeciesDB(row[0])
# for protein in protein_names:
# results = Align.alignSequence(current_species, protein, db)
# Align.parseResults(results, current_species, protein, csv_out)
# print(current_species + ": " + protein)
# # Species that start with C: Run on 3/15/2021 at 5:35 pm
# letter = 'C'
# csv_out = letter + ".csv"
# with open("Species\\files_info.csv", 'r') as species_in:
# read_species = csv.reader(species_in, delimiter=',')
#
# Align.openOutFile(csv_out)
#
# for row in read_species:
# if row[0][0] == letter:
# current_species = row[0]
# db = Align.buildSpeciesDB(row[0])
# for protein in protein_names:
# results = Align.alignSequence(current_species, protein, db)
# Align.parseResults(results, current_species, protein, csv_out)
# print(current_species + ": " + protein)
# # Species that start with D: Run on 3/15/2021 at 6:39 pm
# letter = 'D'
# csv_out = letter + ".csv"
# with open("Species\\files_info.csv", 'r') as species_in:
# read_species = csv.reader(species_in, delimiter=',')
#
# Align.openOutFile(csv_out)
#
# for row in read_species:
# if row[0][0] == letter:
# current_species = row[0]
# db = Align.buildSpeciesDB(row[0])
# for protein in protein_names:
# results = Align.alignSequence(current_species, protein, db)
# Align.parseResults(results, current_species, protein, csv_out)
# print(current_species + ": " + protein)
# Species that start with E: Run on 3/15/2021 at 6:44 pm, 7:02
# run('E')
# Species that start with F&G: Run on 3/15/2021 at 7:03, 7:09
#run('F')
#run('G')
# Species that start with H&I: Run on 3/15/2021 at 7:09, 7:20
# run('H')
# run('I')
# Species that start with J&K: Run on 3/15/2021 at 7:21, 7:22
# run('J')
# run('K')
# Species that start with L&M: Run on 3/15/2021 at 7:23, 7:30
# run('L')
# run('M')
# Species that start with N&O: Run on 3/15/2021 at 7:31, 7:31
#run('N')
#run('O')
# Species that start with P&Q: Run on 3/15/2021 at 7:32, 7:38
# run('P')
# run('Q')
# Species that start with RSTUVW: Run on 3/15/2021 at 7:39, 7:46
# run('R')
# run('S')
# run('T')
# run('U')
# run('V')
# run('W')
# Species that start with XYZ: Run on 3/15/2021 at 7:46, 7:47
# run('X')
# run('Y')
# run('Z')