scSLAT.model.utils.spatial_match
- scSLAT.model.utils.spatial_match(embds, reorder=True, smooth=True, smooth_range=20, scale_coord=True, adatas=None, return_euclid=False, verbose=False, get_null_distri=False)[source]
Use embedding to match cells from different datasets based on cosine similarity
- Parameters:
embds (
typing.List[torch.Tensor]) – list of embeddingsreorder (
typing.Optional[bool]) – if reorder embedding by cell numberssmooth (
typing.Optional[bool]) – if smooth the mapping by Euclid distancesmooth_range (
typing.Optional[int]) – use how many candidates to do smoothscale_coord (
typing.Optional[bool]) – if scale the coordinate to [0,1]adatas (
typing.Optional[typing.List[anndata._core.anndata.AnnData]]) – list of adata objectverbose (
typing.Optional[bool]) – if print logget_null_distri (
typing.Optional[bool]) – if get null distribution of cosine similarity
Note
Automatically use larger dataset as source
- Return type:
- Returns:
Best matching, Top n matching and cosine similarity matrix of top n
Note
Use faiss to accelerate, refer https://github.com/facebookresearch/faiss/issues/95