scSLAT.model.utils.spatial_match
- scSLAT.model.utils.spatial_match(embds, reorder=True, top_n=20, smooth=True, smooth_range=20, scale_coord=True, adatas=None, verbose=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 numberstop_n (
typing.Optional
[int
]) – return top n of cosine similaritysmooth (
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 log
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