pygecko.visualization package

Submodules

pygecko.visualization.utilities module

class pygecko.visualization.utilities.Flags(value)

Bases: Enum

An enumeration.

overlap = 1
static return_flags_value(flags: list[str]) int

Returns an array of the flags.

Parameters:

flags (list[str]) – List of flags.

Returns:

Array of the flags.

Return type:

np.ndarray[int]

pygecko.visualization.utilities.create_discrete_cmap(name: str, color_list: list[str], bounds: list[float]) tuple[ListedColormap, BoundaryNorm]

Creates a discrete colormap with the given name, color list and bounds.

Parameters:
  • name (str) – The desired name of the colormap.

  • color_list (list[str]) – List of colors for the colormap.

  • bounds (list[float]) – List of bounds for the colormap.

Returns:

Tuple containing the colormap and the norm.

Return type:

tuple[mpl.colors.ListedColormap, mpl.colors.BoundaryNorm]

pygecko.visualization.visuals module

class pygecko.visualization.visuals.Visualization

Bases: object

static compare_mass_spectra(peaks: tuple[MS_Peak, MS_Peak], path: str | None = None, **kwargs) None

Visualizes two mass spectra as m/z/intensity plot.

Parameters:
  • peaks (tuple['MS_Peak', 'MS_Peak']) – Tuple of MS_Peak objects containing the mass spectra to visualize.

  • path (str|None, optional) – Path to save the figure to. Defaults to None.

  • **kwargs – Keyword arguments for the plot.

static stack_chromatograms(injections: list[Injection], path: str | None = None, **kwargs) None

Visualizes a list of chromatograms as a stack plot.

Parameters:
  • injections (list['Injection']) – List of Injection objects containing the chromatograms to visualize.

  • path (str|None, optional) – Path to save the figure to. Defaults to None.

  • **kwargs – Keyword arguments for the plot.

static view_chromatogram(injection: MS_Injection | FID_Injection, path: str | None = None, **kwargs)

Visualizes a chromatogram as time/intensity plot.

Parameters:
  • injection ('MS_Injection'|'FID_Injection') – Injection object containing the chromatogram to visualize.

  • path (str|None, optional) – Path to save the figure to. Defaults to None.

  • **kwargs – Keyword arguments for the plot.

static view_mass_spectrum(peak: MS_Peak, path: str | None = None, **kwargs) None

Visualizes a mass spectrum as m/z/intensity plot.

Parameters:
  • peak (MS_Peak) – MS_Peak object containing the mass spectrum to visualize.

  • path (str|None, optional) – Path to save the figure to. Defaults to None.

  • **kwargs – Keyword arguments for the plot.

static visualize_plate(data: ndarray, path: str | None = None, well_labels=True, show_flags: bool = False, **kwargs) None

Visualizes a well plate as a heatmap of yields and saves the figure if a path is given.

Parameters:
  • data (np.ndarray) – A numpy array containing the yields of the reactions.

  • results (str, optional) – The type results to visualize. Defaults to ‘hit’.

  • path (str|None, optional) – Path to save the figure to. Defaults to None.

Module contents