def calibrate_chromatogram(self): try: self.cal_file = filedialog.askopenfilename( title='Select Calibration File') if not self.cal_file: self.cal_file = None self.reference = self.functions.read_peak_list(self.cal_file) self.progress.reset_bar(self) for index, self.chrom in enumerate(self.data): progress = (float(index) / len(self.data)) * 100 self.counter.set(progress) self.progress.update_progress_bar(self) self.time_pairs = self.functions.find_peak(self) self.function = self.functions.determine_calibration_function( self) self.functions.apply_calibration_function(self) except Exception as e: self.logger.error(e) self.progress.fill_bar(self) self.axes.clear() for chrom in self.data: chrom.plot_chrom(self) finalize_plot(self)
def baseline_correction(self): try: self.axes.clear() for chrom in self.data: chrom.trace.baseline_correction(self) chrom.plot_chrom(self) finalize_plot(self) except Exception as e: self.logger.error(e)
def smooth_chromatogram(self): try: self.axes.clear() for chrom in self.data: chrom.trace.smooth_chrom(self) chrom.plot_chrom(self) finalize_plot(self) except Exception as e: self.logger.error(e)
def peak_detection(self): try: self.axes.clear() for self.chrom in self.data: self.detected_peaks = PeakDetection(self) self.detected_peaks.detect_peaks() self.detected_peaks.plot_peaks() self.chrom.plot_chromatogram() finalize_plot(self) except Exception as e: self.logger.error(e)
def open_chromatogram_window(self): files = filedialog.askopenfilenames(title='Open Chromatogram File(s)') data = [] if files: for file in files: foo = Chromatogram(Path(file)) data.append(foo) self.data = data self.axes.clear() for chrom in self.data: chrom.plot_chrom(self) finalize_plot(self)
def baseline_correction(self): try: self.task_label.set('Baseline Correcting') self.progress.reset_bar() self.axes.clear() for index, chrom in enumerate(self.data): self.progress.counter.set((float(index) / len(self.data))*100) self.progress.update_progress_bar() chrom.baseline_correction() chrom.plot_chromatogram() finalize_plot(self) self.task_label.set('Idle') self.progress.fill_bar() except Exception as e: self.logger.error(e)
def calibrate_chromatogram(self): try: self.process_parameters.calibration = True self.process_parameters.calibration_file = filedialog.askopenfilename( title='Select Calibration File') if not self.process_parameters.calibration_file: self.process_parameters.quantitation = False return self.reference = read_peak_list( self.process_parameters.calibration_file) self.progress.reset_bar() self.task_label.set('Calibrating Chromatograms') for index, self.chrom in enumerate(self.data): self.progress.counter.set((float(index) / len(self.data))*100) self.progress.update_progress_bar() self.chrom.determine_calibration_timepairs() # Still need to include a check against number of calibrants self.chrom.determine_calibration_function() self.chrom.calibrate_chromatogram() self.task_label.set('Idle') self.progress.fill_bar() self.process_parameters.quantitation = False except Exception as e: self.logger.error(e) self.progress.fill_bar() self.axes.clear() self.progress.reset_bar() self.task_label.set('Plotting Chromatograms') for index, chrom in enumerate(self.data): self.progress.counter.set((float(index) / len(self.data))*100) self.progress.update_progress_bar() chrom.plot_chromatogram() finalize_plot(self) self.task_label.set('Idle') self.progress.fill_bar()
def open_chromatogram_window(self): files = filedialog.askopenfilenames(title='Open Chromatogram File(s)') data = [] if files: self.task_label.set('Opening Chromatograms') self.progress.reset_bar() for index, filename in enumerate(files): self.progress.counter.set((float(index) / len(files)) * 100) self.progress.update_progress_bar() self.filename = Path(filename) chromatogram = Chromatogram(self) chromatogram.open_chromatogram() data.append(chromatogram) self.data = data self.task_label.set('Idle') self.progress.fill_bar() self.axes.clear() for chrom in self.data: chrom.plot_chromatogram() finalize_plot(self)