moscot.problems.space.MappingProblem.prepare

MappingProblem.prepare(sc_attr, batch_key=None, spatial_key='spatial', var_names=None, normalize_spatial=True, joint_attr=None, cost='sq_euclidean', cost_kwargs=mappingproxy({}), a=None, b=None, xy_callback=None, x_callback=None, y_callback=None, xy_callback_kwargs=mappingproxy({}), x_callback_kwargs=mappingproxy({}), y_callback_kwargs=mappingproxy({}), subset=None, reference=None)[source]

Prepare the mapping problem problem.

See also

Parameters:
Return type:

MappingProblem[TypeVar(K, bound= Hashable)]

Returns:

: Returns self and updates the following fields:

  • problems - the prepared subproblems.

  • solutions - set to an empty dict.

  • spatial_key - key in obsm where the spatial coordinates are stored.

  • batch_key - key in obs where batches are stored.

  • stage - set to 'prepared'.

  • problem_kind - set to 'quadratic' (if both spatial_key and sc_attr are passed)

    or 'linear' (if both spatial_key and sc_attr are None).