Plexora

ProjectData

Everything a plugin can read about one project: its image, mask, feature table and column schema.

Generated from Plexora 0.0.55View source
from plexora.api import ProjectData

Also available as plexora.api.Dataset.

ProjectData(
    name: str,
    image: ImageHandle,
    segmentation: SegHandle,
    table: TableHandle,
    schema: DatasetSchema | None,
    project: Project,
)

Called Dataset until a Dataset became the folder a cohort of projects lives in (plexora.create_dataset) -- two things one word could not be, and this was the one that was always misnamed: it is not a dataset, it is the data of one project. Dataset stays as an alias for a plugin already using the old name.

Fields

namestrrequired

The project's name.

imageImageHandlerequired

The project's image.

segmentationSegHandlerequired

The project's segmentation mask, if it has one.

tableTableHandlerequired

The project's feature table, if it has one.

schemaDatasetSchema | Nonerequired

Which column holds each role, or None if this project has no feature table.

projectProjectrequired

The underlying project record. Most plugins do not need it directly; it is here for a call, such as plexora.api.layers, that takes one.

Properties

source_kind

source_kind: str | None

The feature table's format.

str | None

One of "csv", "parquet", "anndata" or "spatialdata", or None if this project has no feature table.

Methods

not_called

not_called(markers=())

Rows QC says cannot be called for any of markers -- a cell inside a QC region, or one QC flagged that marker unreliable in -- under the current call mode (plexora.agent.cell_exclusions).

markerslistdefault ()

Marker columns; empty means the cells not called for every marker.

Value

A boolean numpy array, one entry per row of table.geometry(), True where the cell is not called; None when every row is called (no QC, or nothing failed).

annotations

annotations() -> dict

Per-cell values plugins derive for this project's cells -- QC's status and category, say -- without a write into the user's file (Plugin.cell_annotations_factory).

dict

\{name: \{kind, values, categories, colors, label, provider, fingerprint\}\}; values holds one entry per row of table.frame() (None where nothing is said). Empty without a table or a provider.

calls

calls(gates: Mapping[str, tuple], mode: str = 'and')

A gate's call per row, with QC's third state.

gatesdictrequired

{column: (low, high)} ranges.

modestrdefault 'and'

"and" or "or", as table.range_mask.

Value

An int8 numpy array, one entry per row: 1 positive, 0 negative, -1 not called (QC failed the cell for one of the gated markers; not_called). The gate's thresholds are unchanged by QC.

Examples

from plexora import api

data = api.project_data("my_project")
data.image.channel_names
data.table.markers
data.schema.x

On this page