def display(self): """ Display the Chromatogram """ self.constrain_zoom("x") display = Display(self.fig, self.ax) self.ax.clear() # Read the TIC from the tic.dat file in the experiment tarfile intensity_array, tic = self.experiment.tic_data # peak_list = load_peaks(os.path.join(ExprDir, "{}_peaks.dat".format(self.experiment.name))) display.plot_tic(tic, label=self.experiment.name, minutes=True) # display.plot_peaks(filtered_peak_list, "Peaks") # display.do_plotting('TIC and PyMS Detected Peaks') # display.do_plotting(f'{self.experiment.name} TIC') display.do_plotting('') x = [time / 60 for time in tic.time_list] self.ax.set_xlim(left=0, right=max(x)) self.ax.set_ylim(bottom=0) self.ax.set_xlabel("Retention Time") self.ax.set_ylabel("Intensity") self.fig.subplots_adjust(left=0.1, bottom=0.125, top=0.9, right=0.97) # figure.tight_layout() self.canvas.draw() self.setup_ylim_refresher(intensity_array, x)
area = peak_sum_area(im, peak) peak.area = area # print some details UID = peak.UID # height as sum of the intensities of the apexing ions height = sum(peak.get_mass_spectrum().mass_spec.tolist()) print(UID + f", {rt:.2f}, {height:.2f}, {peak.area:.2f}") # TIC from raw data tic = data.get_tic() # baseline correction for TIC tic_bc = tophat(tic, struct="1.5m") # Get Ion Chromatograms for all m/z channels n_mz = len(im.get_mass_list()) ic_list = [] for m in range(n_mz): ic_list.append(im.get_ic_at_index(m)) # Create a new display object, this time plot the ICs # and the TIC, as well as the peak list display = Display() display.plot_tic(tic_bc, 'TIC BC') for ic in ic_list: display.plot_ic(ic) display.plot_peaks(new_peak_list, 'Peaks') display.do_plotting('TIC, and PyMassSpec Detected Peaks') display.show_chart()