moscot.problems.space.MappingProblem#

class moscot.problems.space.MappingProblem(adata_sc, adata_sp)[source]#

Class for mapping single cell omics data onto spatial data, based on [Nitzan et al., 2019].

Parameters:
  • adata_sc (AnnData) – Annotated data object containing the single-cell data.

  • adata_sp (AnnData) – Annotated data object containing the spatial data.

Methods

add_problem(key, problem, *[, overwrite])

Add a subproblem.

annotation_mapping(mapping_mode, ...[, ...])

Transfer annotations between distributions.

cell_transition(source[, target, ...])

Aggregate the transport matrix.

compute_entropy(source, target[, forward, ...])

Compute the conditional entropy per cell.

compute_feature_correlation(obs_key[, ...])

Compute correlation of push-forward or pull-back distribution with features.

correlate([var_names, corr_method])

Correlate true and predicted gene expression.

impute([var_names, device])

Impute the expression of specific genes.

load(path)

Load the model from a file.

prepare(sc_attr[, batch_key, spatial_key, ...])

Prepare the mapping problem problem.

pull(*args, **kwargs)

Pull mass from target to source.

push(*args, **kwargs)

Push mass from source to target.

remove_problem(key)

Remove a subproblem.

save(path[, overwrite])

Save the problem to a file.

solve([alpha, epsilon, tau_a, tau_b, rank, ...])

Solve the mapping problem.

spatial_correspondence([interval, max_dist, ...])

Compute structural correspondence between spatial and molecular distances.

Attributes

adata

Annotated data object.

adata_sc

Single-cell data.

adata_sp

Spatial data, alias for adata.

batch_key

Batch key in obs.

filtered_vars

Filtered variables.

problem_kind

Kind of the underlying problem.

problems

OT subproblems that define the biological problem.

solutions

Solutions to the problems.

spatial_key

Spatial key in obsm.

stage

Problem stage.