sddb.SpatialDataCohort#
- class sddb.SpatialDataCohort(df: DataFrame, *, matched: dict[str, list[str]] | None = None, source: Source | None = None, filter: dict[str, Any] | None = None)#
An ordered, sliceable set of Dataset records from a query/search.
- __init__(df: DataFrame, *, matched: dict[str, list[str]] | None = None, source: Source | None = None, filter: dict[str, Any] | None = None) None#
Methods
__init__(df, *[, matched, source, filter])check_updates(catalog, *[, warn])Return
{pinned_uid: current_uid}for members a newer catalog version supersedes.citations(path, *[, bib_url])Write the BibTeX entries for the studies in this set to
path.citations_text(*[, bib_url])Return
(BibTeX text, entry count)for the studies in this set, without writing a file.count(value)coverage()Per-column counts of present vs. unknown values.
download(dest, *[, workers, pin_versions, ...])Download every store under
dest(resumable) and return the manifest.filter(**facets)Return a new cohort keeping rows matching every
column=value(a list/tuple/set means isin).freeze()Pin this selection to its exact members and a deterministic hash.
from_manifest(m, *[, catalog])Rebuild a cohort pinned to exactly the manifest's members (offline — no catalog re-query).
groupby(field)Count members per value of
field(missing values bucketed as"unknown").index(value, [start, [stop]])Raises ValueError if the value is not present.
licenses()Count members per license.
load(*[, elements])Open every member, localizing only
elements("kind/name") when given.modalities()Which modalities are present, from catalog flag columns only (no network).
split(*[, by])Group-safe deterministic split into
{fold: SpatialDataCohort}.summary()Headline numbers for this set.
to_anndata(*[, table, obs_columns, ...])Concatenate each member's table into one AnnData (outer join, obs[uid]+obs[study_id]).
to_df()Return the underlying rows as a DataFrame copy.
verify(*[, workers])Liveness check: raise
CohortDriftErrorif any pinned store no longer resolves.where(mask)Return a new cohort keeping rows where the boolean
mask(aligned tomembers) is True.Attributes
membersThe underlying catalog rows (a view; treat as read-only — use methods to derive new cohorts).
sdatasOpen every member as a full SpatialData (download-then-open; explicit and potentially large).