SC2Spa.tl.pp_Mapping

SC2Spa.tl.pp_Mapping(adata_ref: AnnData, adata_query: AnnData, JGs: list, sparse=True, WD_cutoff=None)

Extract gene expression matrices sharing the same genes and the reference coordinates

Extract the reference gene expression matrix and the query gene expression matrix that contain the shared genes, and the reference coordinates from 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).

JGs

List of genes used for training

sparse

if gene expression is saved in sparse format

WD_cutoff

genes with Wasserstein distance lower than the cutoff will be selected

Returns

X_ref

reference shared gene expression array

X_query

query shared gene exression array

Y_ref

reference spatial coordinates