moscot.base.problems.CompoundProblem.prepare#
- CompoundProblem.prepare(policy, key, subset=None, reference=None, xy_callback=None, x_callback=None, y_callback=None, xy_callback_kwargs=mappingproxy({}), x_callback_kwargs=mappingproxy({}), y_callback_kwargs=mappingproxy({}), **kwargs)#
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 inobs
for 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_callback (
Union
[Literal
['local-pca'
],Callable
[[Literal
['xy'
,'x'
,'y'
],AnnData
,Optional
[AnnData
]],Mapping
[Literal
['xy'
,'x'
,'y'
],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
]],Mapping
[Literal
['xy'
,'x'
,'y'
],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
]],Mapping
[Literal
['xy'
,'x'
,'y'
],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
.kwargs (
Any
) – Keyword arguments for the subproblems’prepare()
method.
- Return type:
BaseCompoundProblem
[TypeVar
(K
, bound=Hashable
),TypeVar
(B
, bound=OTProblem
)]- Returns:
: Returns self and updates the following fields: