moscot.utils.subset_policy.ExplicitPolicy#

class moscot.utils.subset_policy.ExplicitPolicy(adata, key=None, verify_integrity=True)[source]#

Explicitly specified policy.

The policy graph is passed directly in create_graph().

Parameters:
  • adata (Union[AnnData, Series, Categorical]) – Annotated data object or a categorical data.

  • key (Optional[str]) – Key in obs where the categorical data is stored.

  • verify_integrity (bool) – Whether to check that the data has \(\ge 2\) categories.

Methods

add_node(node[, only_existing])

Add a node to the policy graph.

create_graph(**kwargs)

Create a policy graph.

create_mask(value, *[, allow_empty])

Create a mask used to subset the data.

create_masks([discard_empty])

Create masks based on the policy graph.

plan([filter, explicit_steps])

Compute a sequence of steps based on the policy graph.

remove_node(node)

Remove a node from the policy graph.

Attributes

key

Key in obs defining the policy.