SC2Spa.tl.WassersteinD

SC2Spa.tl.WassersteinD(adata_ref: AnnData, adata_query: AnnData, WD_cutoff: float, sparse: bool, root='WDs/', save='WDs_T1')

Calculate Wassertein distances of genes between two datasets

Extract the shared genes that have a Wasserstein distance lower than WD_cutoff

between the reference data and the query data Only the select genes will be kept in the reference and query Anndata objects

Parameters

adata_ref

Reference anndata object. Gene expression matrix should be the shape of (cell, gene). Spatial information should be stored in adata_ref.obsm[‘spatial’] in np.array format

adata_query

Query anndata object. Gene expression matrix should be the shape of (cell, gene).

sparse

if gene expression is saved in sparse format

WD_cutoff

genes with Wasserstein distance lower than the cutoff will be selected

Returns

JGs

A list that contains the select genes

WDs

A table contains