spacr.qt.widgets.organism_diagram

Offline SwissBioPics cells with selectable UniProt compartment labels.

The Toxoplasma hyperLOPIT-to-SL mapping follows Einar Olafsson’s Starplast celldiagram.py (MIT, revision 53703bafdf0604576a05b589400051a6b09e62ea). Artwork is by Philippe Le Mercier, SIB, CC BY 4.0; source records accompany the SVGs. Only the rendered copy loses hidden metadata and its credit logo; the original asset and visible attribution are retained. No PyQt6 import, network request or measured localization data is involved.

Attributes

APICOMPLEXAN_LABELS

Shared apicomplexan compartment labels mapped to UniProt SL identifiers.

COMPARTMENT_SL

Toxoplasma hyperLOPIT display labels mapped to UniProt SL identifiers.

YEAST_LABELS

Generic budding-yeast compartment labels mapped to UniProt SL identifiers.

Classes

OrganismDiagram

A cell illustration and keyboard-accessible compartment selector.

Module Contents

class spacr.qt.widgets.organism_diagram.OrganismDiagram(app_key: str, path: pathlib.Path, parent=None)[source]

Bases: PySide6.QtWidgets.QWidget

A cell illustration and keyboard-accessible compartment selector.

Parameters:
  • app_key – organism key; only Toxoplasma uses hyperLOPIT labels, and only the apicomplexan and Leishmania pages are turned upright.

  • path – bundled SVG path; no external resource is fetched.

  • parent – owning Qt widget.

Build upright artwork, a multi-select legend and compartment descriptions.

changeEvent(event) → None[source]

Recompute reserved text space after an explicit font or language change.

Parameters:

event – Qt change event; font and language changes invalidate the layout.

Returns:

None.

clear_components() → None[source]

Clear all persistent selections and the transient compartment highlight.

eventFilter(watched, event)[source]

End the legend’s transient highlight when the pointer leaves it.

Parameters:
  • watched – object receiving the event; only the legend viewport triggers highlight removal.

  • event – Qt event, inspected for a pointer-leave notification.

Returns:

the parent widget’s event-filter result.

resizeEvent(event) → None[source]

Reserve the longest caption once per width; hover never changes geometry.

Parameters:

event – Qt resize event forwarded to the parent widget.

Returns:

None.

spacr.qt.widgets.organism_diagram.APICOMPLEXAN_LABELS[source]

Shared apicomplexan compartment labels mapped to UniProt SL identifiers.

spacr.qt.widgets.organism_diagram.COMPARTMENT_SL[source]

Toxoplasma hyperLOPIT display labels mapped to UniProt SL identifiers.

Several labels share a location. The mitochondrial membrane label retains SL0171 as its identifier and uses the SL0173 outline when drawn.

spacr.qt.widgets.organism_diagram.YEAST_LABELS[source]

Generic budding-yeast compartment labels mapped to UniProt SL identifiers.