Skip to content

🖼️ Visualize Data

Open In Colab

After initializing the ChromAnalyzer, the loaded spectra and identified peaks can be visualized in different ways. Eight all spectra can be plotted in a single interactive plot, or individual spectra and the quantified peaks can be plotted separately, providing means for visual inspection prior to further analysis and processing.

Visualize all spectra simultaneously

The visualize_spectra method plots all spectra in a single interactive plot. The spectra are colored according to the sample name. The plot can be zoomed in and out. When specifying dark_mode=True, the plot will be displayed in dark mode.

Example

from chromatopy import ChromAnalyzer

data_dir = "data/asm"

# Initialize the ChromAnalyzer
analyzer = ChromAnalyzer.read_asm(
    path=data_dir,
    ph=7.4,
    temperature=25,
    mode="timecourse",
)

# and visualize the spectra
analyzer.visualize_spectra()

Please reload the page if the visualization is not displayed correctly

051015202530050M100M150M200M250M300M350M400M450M
N6BENZYLADOONB_RNCOMT_TIME0N6BENZYLADOONB_RNCOMT_TIME1N6BENZYLADOONB_RNCOMT_TIME2N6BENZYLADOONB_RNCOMT_TIME3retention time [min]Intensity

Visualize Peaks and Spectra

The visualize_all method plots the identified peaks and the corresponding spectra. The spectra are colored according to the sample name. The plot can be zoomed in and out. When specifying dark_mode=True, the plot will be displayed in dark mode. Furthermore, when setting assigned_only=True, only the peaks that have been assigned to a molecule are plotted. How assignemt of molecule to peaks is done is explained in the next chapter.

Example

analyzer.visualize_all(dark_mode=False)
0510152025300100M200M300M400M
Peak 1.44Peak 9.84Peak 11.89Peak 12.63Peak 13.61Peak 13.94Peak 15.69Peak 16.58Peak 16.85Peak 19.01Peak 20.49Peak 20.70Peak 21.08SignalChromatogram: N6BENZYLADOONB_RNCOMT_TIME0N6BENZYLADOONB_RNCOMT_TIME0N6BENZYLADOONB_RNCOMT_TIME1N6BENZYLADOONB_RNCOMT_TIME2N6BENZYLADOONB_RNCOMT_TIME3retention time [min]Intensity