def batch_process(self): if self.process_parameters.data_folder: self.process_window = BatchProcessProgressWindow(self) self.process_window.create_window() # Calibration if self.process_parameters.calibration_file: self.reference = read_peak_list( self.process_parameters.calibration_file) self.files = self.get_calibration_files() # Read data self.read_data() # Perform calibration progress = self.process_window.calibration_progress_bar for index, self.chrom in enumerate(self.data): progress.counter.set((float(index) / len(self.data)) * 100) 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() progress.fill_bar() # Quantitation if self.process_parameters.quantitation_file: self.reference = read_peak_list( self.process_parameters.quantitation_file) self.files = self.get_quantitation_files() # Read data if not self.data: self.data = self.read_data() # Perform quantitation progress = self.process_window.quantitation_progress_bar for index, self.chrom in enumerate(self.data): progress.counter.set((float(index) / len(self.data)) * 100) progress.update_progress_bar() self.chrom.quantify_chromatogram() progress.fill_bar() # Generate summary file output = Output(self) output.init_output_file() output.build_output_file() # Report generation if self.output_parameters.pdf_report.get() == True: progress = self.process_window.report_progress_bar for index, self.chrom in enumerate(self.data): progress.counter.set((float(index) / len(self.data)) * 100) progress.update_progress_bar() self.chrom.generate_pdf_report() progress.fill_bar()
def quantify_chromatogram(self): try: self.process_parameters.quantitation = True self.process_parameters.quanititation_file = filedialog.askopenfilename( title='Select Quantitation File') if not self.process_parameters.quanititation_file: self.process_parameters.quantitation = False return self.reference = read_peak_list( self.process_parameters.quanititation_file) self.progress.reset_bar() self.task_label.set('Quantifying Chromatograms') for index, chrom in enumerate(self.data): self.progress.counter.set((float(index) / len(self.data))*100) self.progress.update_progress_bar() chrom.quantify_chromatogram() self.task_label.set('Idle') self.progress.fill_bar() if self.output_parameters.pdf_report.get() == True: self.generate_pdf_reports() self.output = Output(self) self.output.init_output_file() self.output.build_output_file() self.process_parameters.quantitation = False 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()