moscot.problems.spatiotemporal.SpatioTemporalProblem.align¶
- SpatioTemporalProblem.align(reference=None, mode='warp', spatial_key=None, key_added=None)¶
Align the spatial data.
- Parameters:
reference (
Optional[TypeVar(K, bound=Hashable)]) – Reference key. If astar policywas used, its reference will always be used.mode (
Literal['warp','affine']) –Alignment mode. Valid options are:
'warp'- warp the data to thereference.'affine'- align the data to thereferenceusing affine transformation.
spatial_key (
Optional[str]) – Key inobsmwhere the spatial coordinates are stored. IfNone, usespatial_key.key_added (
Optional[str]) – Key inobsmandunswhere to store the alignment.
- Return type:
Optional[Tuple[Union[ndarray[tuple[int,...],dtype[floating]],Array],Optional[Dict[TypeVar(K, bound=Hashable),Union[ndarray[tuple[int,...],dtype[floating]],Array,None]]]]]- Returns:
: Depending on the
key_added:None- returns the aligned coordinates and metadata. The metadata isNonewhenmode != 'affine'.str- updatesadatawith the following fields:obsm['{key_added}']- the aligned spatial coordinates.uns['{key_added}']['alignment_metadata']- the metadata.