From 4c3fccaac3aaf9408a14411de16d91680f8b84cd Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 31 Jul 2020 13:35:29 -0400 Subject: [PATCH 1/3] min/max bug fix --- Crow_GC/Pull_GC.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Crow_GC/Pull_GC.py b/Crow_GC/Pull_GC.py index 648c181..245c021 100644 --- a/Crow_GC/Pull_GC.py +++ b/Crow_GC/Pull_GC.py @@ -102,7 +102,9 @@ def pulldatacallback(): for suspect in peaksinwindow: if suspect[2] == i: poss.append(suspect[0:2]) - if len(poss) == 1: # only one possible peak was found + if len(poss) == 0: + keep = "Not found" + elif len(poss) == 1: # only one possible peak was found keep = poss[0][1] elif ( self.pickingmethod.get() == 1 @@ -117,8 +119,15 @@ def pulldatacallback(): elif self.pickingmethod.get() == 3: # keep all areas keep = [j[1] for j in poss] else: - keep = "Not found" + keep = "Error" self.datalist[int(temp[C.globals_GC.welltarg[0]][C.globals_GC.welltarg[1]].text)-1, i] = str(keep).replace("\"", "").replace("]", "").replace("[", "") + except IndexError as ie: + if C.globals_GC.debug: + C.globals_GC.mylog(e) + warningmessage = ( + "Please select files in order starting from 1 to end" + ) + C.messagebox.showwarning(title="Warning", message=warningmessage) except Exception as e: if C.globals_GC.debug: C.globals_GC.mylog(e) From 6bdf274f539b2fb3f1c26d1d4a2df1b6a62fc453 Mon Sep 17 00:00:00 2001 From: JacksonBurns Date: Fri, 31 Jul 2020 15:05:19 -0400 Subject: [PATCH 2/3] add option to keep retention times --- .../__pycache__/ParseXML.cpython-38.pyc | Bin 569 -> 0 bytes .../__pycache__/RequestFiles.cpython-38.pyc | Bin 942 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 helper_functions/__pycache__/ParseXML.cpython-38.pyc delete mode 100644 helper_functions/__pycache__/RequestFiles.cpython-38.pyc diff --git a/helper_functions/__pycache__/ParseXML.cpython-38.pyc b/helper_functions/__pycache__/ParseXML.cpython-38.pyc deleted file mode 100644 index 8a0352c94f6f21c1228290c2e04c618bb3650e4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmYjO%}T>S5Z+Bv8zQ|3dX%{qq~KLVger>vpn`;eq{+02Y_er{V^!Ll57HjJ_&~XO z@)bNe8>w_)hMC!!Z@!tm?{or25)|-w&Kdi%!KyeE9Fpp7GAT>BU0)JkU~920>=vkt*XY(IStHTxB_~ma zVvOo>Se1#%WvQbZJMH1}qBnl6{bk_U+gf g3fEV1%KmcG*05YLZF;Ev{X(XdzytfS+SYEkzk+|3bN~PV diff --git a/helper_functions/__pycache__/RequestFiles.cpython-38.pyc b/helper_functions/__pycache__/RequestFiles.cpython-38.pyc deleted file mode 100644 index 074ddb98f8957f800f6be7424c6f684e8aed8c33..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 942 zcmYjPO>Yx15cPfp($Gr%0UWHJSShsPS|Nngs&Hy0+Fn*GMb3JXIN8{X?ac=YC%Ez- z;K+^Nvsc7{zrY1%oV3)Ez3b=koA<_ZdvMTWIQHgz@GEBQCv6@M#Mo<`?kO&k$*5xU zD39iG9!E^ZGWpE%M5fm)>-@$Dmc?yvq$-d~RA$`9H?uM!d^b}3c5t5IbbVYr`@}vb zo8)WsjYZ7I(_|CNXu~$qC>}>L{(@(NbdyXeMIwGgjP*EN6Ygp#)kuNk&I=ndNoAq*#;$uIjHm~6?G!^SNhyu?LTUOHe4C>7 z%4kjkPx;bsQkoZ_^YgKN8Y zzge1x>!G@Nfa%%Vlx(#rwZ(U4sm=dfmZ!z71M7 Date: Fri, 31 Jul 2020 15:05:27 -0400 Subject: [PATCH 3/3] Update Pull_GC.py --- Crow_GC/Pull_GC.py | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/Crow_GC/Pull_GC.py b/Crow_GC/Pull_GC.py index 245c021..6d9742f 100644 --- a/Crow_GC/Pull_GC.py +++ b/Crow_GC/Pull_GC.py @@ -52,7 +52,7 @@ def pulldatacallback(): # after passing all validation, continue to remainder of method. # iterate through each and pull relevant data self.datalist = C.np.empty( # empty array the size of len(datafile) x number of products - [len(C.globals_GC.datafiles), len(self.rettimes)], dtype=object + [len(C.globals_GC.datafiles)-1, len(self.rettimes)], dtype=object ) # iterate through each data test for file in C.globals_GC.datafiles: @@ -105,19 +105,31 @@ def pulldatacallback(): if len(poss) == 0: keep = "Not found" elif len(poss) == 1: # only one possible peak was found - keep = poss[0][1] + if self.retinclude.get(): + keep = poss[0] + else: + keep = poss[0][1] elif ( self.pickingmethod.get() == 1 ): # pick peak closest to the center of the window possrettimes = [j[0] for j in poss] possareas = [j[1] for j in poss] - keep = possareas[possrettimes.index(min(possrettimes, key=lambda x: abs(x-self.rettimes[i])))] + if self.retinclude.get(): + keep = poss[possrettimes.index(min(possrettimes, key=lambda x: abs(x-self.rettimes[i])))] + else: + keep = possareas[possrettimes.index(min(possrettimes, key=lambda x: abs(x-self.rettimes[i])))] elif ( self.pickingmethod.get() == 2 ): # keep max, just pick max area - keep = max([j[1] for j in poss]) + if self.retinclude.get(): + keep = max(poss, key=lambda x: x[1]) + else: + keep = max([j[1] for j in poss]) elif self.pickingmethod.get() == 3: # keep all areas - keep = [j[1] for j in poss] + if self.retinclude.get(): + keep = poss + else: + keep = [j[1] for j in poss] else: keep = "Error" self.datalist[int(temp[C.globals_GC.welltarg[0]][C.globals_GC.welltarg[1]].text)-1, i] = str(keep).replace("\"", "").replace("]", "").replace("[", "") @@ -138,6 +150,11 @@ def pulldatacallback(): ) C.messagebox.showwarning(title="Warning", message=warningmessage) with open(C.globals_GC.exportdatapath + self.expname.get() + ".csv", "w") as file: + # write header + for i in range(len(self.rettimes)): + file.write("eluate "+str(i+1)+"\t") + file.write("\n") + # write all lines to a file in a tab separated value format for row in self.datalist: for entry in row: file.write(entry+"\t") @@ -165,6 +182,17 @@ def pulldatacallback(): yiterator += 30 # set max as default selection self.pickingmethod.set(2) + # set up chechbox for whether or not to include retention times + self.retinclude = C.tk.IntVar() + C.tk.Checkbutton( + self, + text='Include retention times?', + variable=self.retinclude, + onvalue=1, + offvalue=0).place( + x=280, + y=415) + # clear entries button C.tk.Button(self, text="Clear Entries", command=clearentriescallback).place( x=167, y=245