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 policy
was 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 thereference
using affine transformation.
spatial_key (
Optional
[str
]) – Key inobsm
where the spatial coordinates are stored. IfNone
, usespatial_key
.key_added (
Optional
[str
]) – Key inobsm
anduns
where to store the alignment.self (SpatialAlignmentMixinProtocol[K, B])
- Return type:
Optional
[Tuple
[ndarray
[Any
,dtype
[float64
]],Optional
[Dict
[TypeVar
(K
, bound=Hashable
),Optional
[ndarray
[Any
,dtype
[float64
]]]]]]]- Returns:
: Depending on the
key_added
:None
- returns the aligned coordinates and metadata. The metadata isNone
whenmode != 'affine'
.str
- updatesadata
with the following fields:obsm['{key_added}']
- the aligned spatial coordinates.uns['{key_added}']['alignment_metadata']
- the metadata.