コード例 #1
0
    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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
ファイル: HappyTools.py プロジェクト: johnmetta/HappyTools
 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)
コード例 #5
0
    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)
コード例 #6
0
ファイル: HappyTools.py プロジェクト: johnmetta/HappyTools
 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)
コード例 #7
0
ファイル: HappyTools.py プロジェクト: johnmetta/HappyTools
    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()
コード例 #8
0
    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)