goatpy.analysis_gui
Attributes
Classes
The canvas the figure renders into. |
|
Interactive spectrum panel — full imzML background + clickable peaks. |
|
Popup to choose glycans for heatmap plotting via select, type, or upload. |
|
Right-dock panel. |
Functions
|
Module Contents
- goatpy.analysis_gui.CONTINUOUS_CMAPS = ['inferno', 'magma', 'plasma', 'viridis', 'hot', 'RdBu_r', 'coolwarm', 'turbo', 'gray'][source]
- goatpy.analysis_gui.CATEGORICAL_CMAPS = ['tab10', 'tab20', 'Set1', 'Set2', 'Set3', 'Paired', 'hsv', 'Pastel1'][source]
- goatpy.analysis_gui.BASE_STYLE = Multiline-String[source]
Show Value
""" QWidget { background-color: #1e1e2e; color: #cdd6f4; font-family: 'Segoe UI', 'SF Pro Display', sans-serif; font-size: 11px; } QGroupBox { background-color: #2a2a3e; border: 1px solid #3d3d5c; border-radius: 6px; margin-top: 8px; padding-top: 8px; font-weight: bold; } QGroupBox::title { subcontrol-origin: margin; left: 8px; padding: 0 4px; color: #7c6af7; } QComboBox { background-color: #2a2a3e; border: 1px solid #3d3d5c; border-radius: 4px; padding: 4px 8px; color: #cdd6f4; } QComboBox::drop-down { border: none; } QComboBox QAbstractItemView { background-color: #2a2a3e; color: #cdd6f4; selection-background-color: #7c6af7; } QPushButton { background-color: #7c6af7; color: white; border: none; border-radius: 4px; padding: 6px 12px; font-weight: bold; } QPushButton:hover { background-color: #9b8df8; } QPushButton:pressed { background-color: #5d4ed6; } QPushButton:disabled { background-color: #3d3d5c; color: #6c7086; } QLabel { color: #cdd6f4; } QTabWidget::pane { border: 1px solid #3d3d5c; background-color: #2a2a3e; border-radius: 4px; } QTabBar::tab { background-color: #1e1e2e; color: #6c7086; padding: 6px 14px; border: 1px solid #3d3d5c; border-bottom: none; border-top-left-radius: 4px; border-top-right-radius: 4px; } QTabBar::tab:selected { background-color: #2a2a3e; color: #cdd6f4; } QCheckBox { color: #cdd6f4; spacing: 6px; } QScrollArea { border: none; background-color: transparent; } QSpinBox, QDoubleSpinBox { background-color: #2a2a3e; border: 1px solid #3d3d5c; border-radius: 4px; padding: 3px 6px; color: #cdd6f4; } QProgressBar { background-color: #2a2a3e; border: 1px solid #3d3d5c; border-radius: 3px; text-align: center; color: #cdd6f4; } QProgressBar::chunk { background-color: #7c6af7; border-radius: 3px; } """
- class goatpy.analysis_gui.MplCanvas(parent=None, width=8, height=3, dpi=90)[source]
Bases:
matplotlib.backends.backend_qt5agg.FigureCanvasQTAggThe canvas the figure renders into.
- class goatpy.analysis_gui.SpectrumWidget(sdata: spatialdata.SpatialData, peaks: list[float], glycan_df: pandas.DataFrame | None = None, table_name: str = 'maldi_adata', applied_tolerance: float = 0.1, parent=None)[source]
Bases:
qtpy.QtWidgets.QWidgetInteractive spectrum panel — full imzML background + clickable peaks.
- class goatpy.analysis_gui.GlycanSelectionDialog(glycan_names: list[str], peaks: list[float], label_to_mz: dict[str, float], parent=None)[source]
Bases:
qtpy.QtWidgets.QDialogPopup to choose glycans for heatmap plotting via select, type, or upload.
- class goatpy.analysis_gui.AnalysisSidebar(sdata: spatialdata.SpatialData, peaks: list[float], viewer: napari.Viewer, glycan_df: pandas.DataFrame | None = None, table_name: str = 'maldi_adata', parent=None)[source]
Bases:
qtpy.QtWidgets.QWidgetRight-dock panel. Glycan tab: selector + Violin/Box/Histogram (no spatial scatter — that is now rendered on the napari viewer directly).
- display_unregistered_ion_image(mz: float, tol: float)[source]
Compute per-pixel intensities for an arbitrary m/z (+/- tol) from the raw imzML and render them on the ‘pixels’ Shapes layer, exactly like the curated glycan ion maps (guarantees H&E alignment).
- select_peak_from_spectrum(mz: float, label: str)[source]
Called when the user clicks a peak in the spectrum widget.
- save_to_sdata(layers: list[Layer] | None = None, spatial_element_name: str | None = None, table_name: str | None = None, table_columns: list[str] | None = None, overwrite: bool = False) None[source]
Add the current selected napari layer(s) to the SpatialData object.
If the layer is newly added and not yet linked with a spatialdata object it will be automatically linked if only 1 spatialdata object is being visualized in the viewer.
Notes
Usage:
you can invoke this function by pressing Shift+E;
the selected layer (needs to be exactly one) will be saved;
if more than one SpatialData object is being shown with napari, before saving the layer you need to link it to a layer with a SpatialData object. This can be done by selecting both layers and pressing Shift+L.
Currently images and labels are not supported.
Currently updating existing elements is not supported.