-
Notifications
You must be signed in to change notification settings - Fork 0
/
Amino Acid Script.ahk
437 lines (405 loc) · 15 KB
/
Amino Acid Script.ahk
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
;Plasma Amino Acid Data entry Script
;Written by Dieter van der Westhuizen 08-01-2020
#SingleInstance, force
;#NoTrayIcon
#NoEnv
#Persistent
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetKeyDelay, 150
SendMode, Input
SetTitleMatchMode, 2
SetDefaultMouseSpeed, 0
SetMouseDelay, 0
SetWinDelay, 500
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Add Buttons ;;;;;;;;;;;;;;;;;;
Gui, Add, button, x2 y2 w75 h40 ,Plasma_AA
Gui, add, button,x2 y42 w75 h40 ,Urine_AA
;Gui, Add, button, x2 y42 w28 h20 ,EPR
;Gui, Add, button, x2 y64 w33 h20 ,FPSA
;Gui, Add, button, x2 y86 w45 h20 ,Verified
;Gui, Add, button, x2 y108 w57 h20 ,KeepOpen
;Gui, Add, button, w57 , VolVeri
;Gui, Add, button, x2 y130 w45 h20 ,More
Gui, Add, button, x2 y152 w32 h20 ,Close
Gui, Add, button, x45 y152 w20 h20 ,_i
;Gui, Add, Button, x6 y17 w100 h30 , Ok
;Gui, Add, Button, x116 y17 w100 h30 , Cancel
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Set Window Options ;;;;;;;;;;;;;;
;Gui, +AlwaysOnTop
Gui, -sysmenu +AlwaysOnTop
Gui, Show, , AA Transcribe
WinGetPos,,,,TrayHeight,ahk_class Shell_TrayWnd,,,
height := A_ScreenHeight-270
width := A_ScreenWidth-85
Gui, Margin, 0, 0
;Gui, Add, Picture, x0 y0 w411 h485, picture.png
;Gui -Caption -Border
Gui, Show, x%width% y%height% w80
return
;;;;;;;; This is to read the CSV called aa.csv, parse the data and send to TrakCare window, Results Entry.
ButtonPlasma_AA:
sleep, 500
IfWinNotExist, Result Entry
{
MsgBox, Please open the Result Entry Window
Return
}
WinActivate, Result Entry
;^!U::
FileName := aa.csv
Loop, read, aa.csv, aa.txt
{
LineNumber := A_Index
Loop, parse, A_LoopReadLine, CSV
if InStr(A_LoopField, "p.D")
{
EpisodeLine := LineNumber + 2
FileReadLine, lEpisode_outr, aa.csv, EpisodeLine
StringTrimRight, lEpisode_out, lEpisode_outr, 2
StringTrimLeft, Episode_out, lEpisode_out, 1
NorValineInternalStandardLine := LineNumber + 18
AlphaaminobutyrateLine := LineNumber + 19
AlanineLine := LineNumber + 20
BetaaminoisobutyrateLine := LineNumber + 21
AsparagineLine := LineNumber + 22
AspartateLine := LineNumber + 23
CystathionineLine := LineNumber + 24
CystineCCdisulfideLine := LineNumber + 25
GlutamateLine := LineNumber + 26
GlutamineLine := LineNumber + 27
GlycineLine := LineNumber + 28
GlycylprolinedipeptideLine := LineNumber + 29
HistidineLine := LineNumber + 30
OHProlineLine := LineNumber + 31
HydroxylysineLine := LineNumber + 32
IsoleucineLine := LineNumber + 33
LeucineLine := LineNumber + 34
LysineLine := LineNumber + 35
MethionineLine := LineNumber + 36
OrnithineLine := LineNumber + 37
PhenylalanineLine := LineNumber + 38
ProlineLine := LineNumber + 39
prolinehydroxyprolinedipeptideLine := LineNumber + 40
SarcosineLine := LineNumber + 41
SerineLine := LineNumber + 42
ThioprolineLine := LineNumber + 43
ThreonineLine := LineNumber + 44
TryptophanLine := LineNumber + 45
TyrosineLine := LineNumber + 46
ValineLine := LineNumber + 47
BetaAlanin_PLine := LineNumber + 48
ArgininoSuccinateLine := LineNumber + 49
HomocystineHcyHcyLine := LineNumber + 50
;FileAppend, Nor Valine Internal Standard is in line %NorValineInternalStandard%`n
FileReadLine, NorValineInternalStandard_out, aa.csv, NorValineInternalStandardLine
NorValineInternalStandardArray := StrSplit(NorValineInternalStandard_out, ",")
NorValineInternalStandardResult := NorValineInternalStandardArray[4]
FileReadLine, Alphaaminobutyrate_out, aa.csv, AlphaaminobutyrateLine
AlphaaminobutyrateArray := StrSplit(Alphaaminobutyrate_out, ",")
AlphaaminobutyrateResult := AlphaaminobutyrateArray[4]
FileReadLine, Alanine_out, aa.csv, AlanineLine
AlanineArray := StrSplit(Alanine_out, ",")
AlanineResult := AlanineArray[4]
FileReadLine, Betaaminoisobutyrate_out, aa.csv, BetaaminoisobutyrateLine
BetaaminoisobutyrateArray := StrSplit(Betaaminoisobutyrate_out, ",")
BetaaminoisobutyrateResult := BetaaminoisobutyrateArray[4]
FileReadLine, Asparagine_out, aa.csv, AsparagineLine
AsparagineArray := StrSplit(Asparagine_out, ",")
AsparagineResult := AsparagineArray[4]
FileReadLine, Aspartate_out, aa.csv, AspartateLine
AspartateArray := StrSplit(Aspartate_out, ",")
AspartateResult := AspartateArray[4]
FileReadLine, Cystathionine_out, aa.csv, CystathionineLine
CystathionineArray := StrSplit(Cystathionine_out, ",")
CystathionineResult := CystathionineArray[4]
FileReadLine, CystineCCdisulfide_out, aa.csv, CystineCCdisulfideLine
CystineCCdisulfideArray := StrSplit(CystineCCdisulfide_out, ",")
CystineCCdisulfideResult := CystineCCdisulfideArray[4]
FileReadLine, Glutamate_out, aa.csv, GlutamateLine
GlutamateArray := StrSplit(Glutamate_out, ",")
GlutamateResult := GlutamateArray[4]
FileReadLine, Glutamine_out, aa.csv, GlutamineLine
GlutamineArray := StrSplit(Glutamine_out, ",")
GlutamineResult := GlutamineArray[4]
FileReadLine, Glycine_out, aa.csv, GlycineLine
GlycineArray := StrSplit(Glycine_out, ",")
GlycineResult := GlycineArray[4]
FileReadLine, Glycylprolinedipeptide_out, aa.csv, GlycylprolinedipeptideLine
GlycylprolinedipeptideArray := StrSplit(Glycylprolinedipeptide_out, ",")
GlycylprolinedipeptideResult := GlycylprolinedipeptideArray[4]
FileReadLine, Histidine_out, aa.csv, HistidineLine
HistidineArray := StrSplit(Histidine_out, ",")
HistidineResult := HistidineArray[4]
FileReadLine, OHProline_out, aa.csv, OHProlineLine
OHProlineArray := StrSplit(OHProline_out, ",")
OHProlineResult := OHProlineArray[4]
FileReadLine, Hydroxylysine_out, aa.csv, HydroxylysineLine
HydroxylysineArray := StrSplit(Hydroxylysine_out, ",")
HydroxylysineResult := HydroxylysineArray[4]
FileReadLine, Isoleucine_out, aa.csv, IsoleucineLine
IsoleucineArray := StrSplit(Isoleucine_out, ",")
IsoleucineResult := IsoleucineArray[4]
FileReadLine, Leucine_out, aa.csv, LeucineLine
LeucineArray := StrSplit(Leucine_out, ",")
LeucineResult := LeucineArray[4]
FileReadLine, Lysine_out, aa.csv, LysineLine
LysineArray := StrSplit(Lysine_out, ",")
LysineResult := LysineArray[4]
FileReadLine, Methionine_out, aa.csv, MethionineLine
MethionineArray := StrSplit(Methionine_out, ",")
MethionineResult := MethionineArray[4]
FileReadLine, Ornithine_out, aa.csv, OrnithineLine
OrnithineArray := StrSplit(Ornithine_out, ",")
OrnithineResult := OrnithineArray[4]
FileReadLine, Phenylalanine_out, aa.csv, PhenylalanineLine
PhenylalanineArray := StrSplit(Phenylalanine_out, ",")
PhenylalanineResult := PhenylalanineArray[4]
FileReadLine, Proline_out, aa.csv, ProlineLine
ProlineArray := StrSplit(Proline_out, ",")
ProlineResult := ProlineArray[4]
FileReadLine, prolinehydroxyprolinedipeptide_out, aa.csv, prolinehydroxyprolinedipeptideLine
prolinehydroxyprolinedipeptideArray := StrSplit(prolinehydroxyprolinedipeptide_out, ",")
prolinehydroxyprolinedipeptideResult := prolinehydroxyprolinedipeptideArray[4]
FileReadLine, Sarcosine_out, aa.csv, SarcosineLine
SarcosineArray := StrSplit(Sarcosine_out, ",")
SarcosineResult := SarcosineArray[4]
FileReadLine, Serine_out, aa.csv, SerineLine
SerineArray := StrSplit(Serine_out, ",")
SerineResult := SerineArray[4]
FileReadLine, Thioproline_out, aa.csv, ThioprolineLine
ThioprolineArray := StrSplit(Thioproline_out, ",")
ThioprolineResult := ThioprolineArray[4]
FileReadLine, Threonine_out, aa.csv, ThreonineLine
ThreonineArray := StrSplit(Threonine_out, ",")
ThreonineResult := ThreonineArray[4]
FileReadLine, Tryptophan_out, aa.csv, TryptophanLine
TryptophanArray := StrSplit(Tryptophan_out, ",")
TryptophanResult := TryptophanArray[4]
FileReadLine, Tyrosine_out, aa.csv, TyrosineLine
TyrosineArray := StrSplit(Tyrosine_out, ",")
TyrosineResult := TyrosineArray[4]
FileReadLine, Valine_out, aa.csv, ValineLine
ValineArray := StrSplit(Valine_out, ",")
ValineResult := ValineArray[4]
FileReadLine, BetaAlanin_P_out, aa.csv, BetaAlanin_PLine
BetaAlanin_PArray := StrSplit(BetaAlanin_P_out, ",")
BetaAlanin_PResult := BetaAlanin_PArray[4]
FileReadLine, ArgininoSuccinate_out, aa.csv, ArgininoSuccinateLine
ArgininoSuccinateArray := StrSplit(ArgininoSuccinate_out, ",")
ArgininoSuccinateResult := ArgininoSuccinateArray[4]
FileReadLine, HomocystineHcyHcy_out, aa.csv, HomocystineHcyHcyLine
HomocystineHcyHcyArray := StrSplit(HomocystineHcyHcy_out, ",")
HomocystineHcyHcyResult := HomocystineHcyHcyArray[4]
IfWinActive, Result Entry - Single
WinClose, Result Entry - Single
IfWinNotActive, Result Entry
{
MsgBox, Please open the Result Entry Window
Return
}
;MsgBox, Now going to transcribe results for %Episode_out%
WinActivate, Result Entry
WinWaitActive, Result Entry
;Run, Notepad
;WinWaitActive, Notepad
sleep, 500
send, {AltDown}l{AltUp}
sleep, 300
;MouseClick, Left, 105, 112, 2, 100
;MouseClick, Left, 105, 500, 2, 100
sleep, 500
send, %Episode_out%
sleep, 300
send, {Tab}
sleep, 300
send, {Tab}
sleep, 300
send, AAQ
sleep, 200
send, {Enter}
sleep, 1000
MouseClick, Left, 150, 300
sleep, 1000
send, {AltDown}e{AltUp}
WinWaitActive, Result Entry - Single
sleep, 3000
send, %AlanineResult%
Loop, 3
{
send, {Tab}
sleep, 300
}
send, %AlphaaminobutyrateResult%
Loop, 6
{
send, {Tab}
sleep, 300
}
send, %AsparagineResult%
sleep, 300
send, {Tab}
sleep,300
send, %AspartateResult%
sleep,300
Loop, 4
{
send, {Tab}
sleep, 300
}
send, %CystineCCdisulfideResult%
sleep, 100
send, {TAB}
sleep, 300
send, %GlutamateResult%
sleep, 100
send, {TAB}
sleep, 300
send, %GlutamineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %GlycineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %HistidineResult%
sleep, 100
Loop, 5
{
send, {Tab}
sleep, 300
}
send, %IsoleucineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %LeucineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %LysineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %MethionineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %OrnithineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %PhenylalanineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %ProlineResult%
sleep, 100
Loop, 2
{
send, {Tab}
sleep, 300
}
send, %SerineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %ThreonineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %TryptophanResult%
sleep, 100
send, {TAB}
sleep, 300
send, %TyrosineResult%
sleep, 100
send, {TAB}
sleep, 300
send, %ValineResult%
sleep, 100
send, {TAB}
sleep, 300
send, {F6}
WinWaitActive, Comments
sleep, 300
send, \aaq{Space}
sleep, 500
WinClose, Comments
sleep, 300
send, {Tab}
sleep, 200
send, y
sleep, 300
send, {Tab}
sleep, 500
send, {AltDown}u{AltUp}
sleep, 1500
*/
send, {AltDown}c{AltUp}
sleep, 1000
send, {AltDown}l{AltUp}
sleep, 800
}
}
return
ButtonUrine_AA:
IfWinNotExist, Result Entry
{
MsgBox, Please open the Result Entry Window, enter the WorkSheet as: SGCAAU and the number underneath and click "Find".
Return
}
#IfWinActive, Result Entry - Single -
;MsgBox, Please make sure that Result Entry window has already been opened and that the WorkSheet entered: SGCAAU and the number has been entered underneath it.`nClick OK when done, or "ESC" if this hasn't been done yet.
MsgBox, 4, , Please make sure that Result Entry window has already been opened and that the WorkSheet entered: SGCAAU and the number has been entered underneath it. Then Click on the first episode's result and Click Enter. `nAre you sure you want to continue?
IfMsgBox No
return
else IfMsgBox Yes
InputBox, qty, Episodes, Enter number (quantity) of Episodes on worksheet, excluding QC:
sleep, 100
WinActivate, Result Entry
WinWaitActive, Result Entry
sleep, 2000
loop, %qty% ; how many times the process should be repeated
{
MouseClick, left, 1011, 696, 1 ;Click scroll down button
sleep, 500
MouseClick, left, 1011, 696, 1 ;Click scroll down button
sleep, 500
MouseClick, left, 256, 644, 1 ;Click "Interpretation" box
sleep, 500
send, AMINO ;Types "AMINO" into above box
sleep, 500
send, {TAB}
send, {F6}
WinWaitActive, Comments
sleep, 200
send, \amino{Space} ;Types the amino comment in the F6 comment field.
sleep, 500
send, {AltDown}{F4}{AltUp} ; closes the window
sleep, 500
send, {Tab}
sleep, 200
send, Y
sleep, 200
send, {Tab}
sleep, 500
Send, {AltDown}a{AltUp} ; Authorizes
sleep, 2500 ; waits for TrakCare to load Creatinine
send, {AltDown}>{AltUp}
sleep, 200
send, {Enter}
sleep, 7000 ;waits for Trak to load next Urine amino acid.
}
#IfWinActive
return
Escape::Reload
;ExitApp
Return
^!r::Reload ; Assign Ctrl-Alt-R as a hotkey to restart the script.
ButtonClose:
ExitApp
Button_i:
Run, http://github.com/dietervdwes/chemhelp