moscot.base.problems.CompoundProblem.prepare¶
- CompoundProblem.prepare(policy, key, subset=None, reference=None, xy=mappingproxy({}), x=mappingproxy({}), y=mappingproxy({}), xy_callback=None, x_callback=None, y_callback=None, xy_callback_kwargs=mappingproxy({}), x_callback_kwargs=mappingproxy({}), y_callback_kwargs=mappingproxy({}), a=None, b=None, marginal_kwargs=mappingproxy({}))¶
Prepare the individual OT subproblems.
See also
See Subset policy on how to use different policies.
- Parameters:
policy (
Literal['sequential','star','external_star','explicit','triu','tril']) – Rule which defines how to construct the subproblems.key (
Optional[str]) – Key inobsfor theSubsetPolicy.subset (
Optional[Sequence[Tuple[TypeVar(K, bound=Hashable),TypeVar(K, bound=Hashable)]]]) – Subset ofobs['{key}']for theExplicitPolicy. Only used whenpolicy = 'explicit'.reference (
Optional[Any]) – Reference for theSubsetPolicy. Only used whenpolicy = 'star'.xy (
Mapping[str,Any]) – Data for the linear term.x (
Mapping[str,Any]) – Data for the source quadratic term.y (
Mapping[str,Any]) – Data for the target quadratic term.xy_callback (
Union[Literal['local-pca'],Callable[[Literal['xy','x','y'],AnnData,Optional[AnnData]],Optional[TaggedArray]],None]) – Callback function used to prepare the data in the linear term.x_callback (
Union[Literal['local-pca'],Callable[[Literal['xy','x','y'],AnnData,Optional[AnnData]],Optional[TaggedArray]],None]) – Callback function used to prepare the data in the source quadratic term.y_callback (
Union[Literal['local-pca'],Callable[[Literal['xy','x','y'],AnnData,Optional[AnnData]],Optional[TaggedArray]],None]) – Callback function used to prepare the data in the target quadratic term.xy_callback_kwargs (
Mapping[str,Any]) – Keyword arguments for thexy_callback.x_callback_kwargs (
Mapping[str,Any]) – Keyword arguments for thex_callback.y_callback_kwargs (
Mapping[str,Any]) – Keyword arguments for they_callback.a (
Union[bool,str,ndarray[tuple[int,...],dtype[floating]],Array,None]) –Source marginals. Valid options are:
b (
Union[bool,str,ndarray[tuple[int,...],dtype[floating]],Array,None]) –Target marginals. Valid options are:
marginal_kwargs (
Mapping[str,Any]) – Keyword arguments for theestimate_marginals()method.
- Return type:
BaseCompoundProblem[TypeVar(K, bound=Hashable),TypeVar(B, bound=OTProblem)]- Returns:
: Returns self and updates the following fields: