moscot.base.problems.OTProblem¶
- class moscot.base.problems.OTProblem(adata, adata_tgt=None, src_obs_mask=None, tgt_obs_mask=None, src_var_mask=None, tgt_var_mask=None, src_key=None, tgt_key=None)[source]¶
Base class for all OT problems.
Notes
If source/target mask is specified,
adata_src
/adata_tgt
will be a view.Methods
estimate_marginals
(adata, *, source)Estimate the source or target marginals.
load
(path)Load the model from a file.
prepare
(xy, x, y[, a, b, marginal_kwargs])Prepare the OT problem.
pull
([data, subset, normalize, split_mass, ...])Pull data through the
transport_matrix
.push
([data, subset, normalize, split_mass, ...])Push data through the
transport_matrix
.save
(path[, overwrite])Save the problem to a file.
set_graph_x
(data[, cost, t])Set a graph for the source quadratic term.
set_graph_xy
(data[, cost, t])Set a graph for the linear term for graph based distances.
set_graph_y
(data[, cost, t])Set a graph for the target quadratic term.
set_solution
(solution, *[, overwrite])set_x
(data, tag)Set a cost/kernel matrix for the source quadratic term.
set_xy
(data, tag)Set a cost/kernel matrix for the linear term.
set_y
(data, tag)Set a cost/kernel matrix for the target quadratic term.
solve
([backend, solver_name, device])Solve the OT problem.
Attributes
Source marginals.
Source annotated data object.
Target annotated data object.
Target marginals.
Kind of the underlying problem.
Shape of the OT problem.
Solution of the OT problem.
OT solver.
Problem stage.
Geometry defining the source quadratic term.
Geometry defining the linear term.
Geometry defining the target quadratic term.