tangram.utils.compare_spatial_geneexp
- tangram.utils.compare_spatial_geneexp(adata_ge, adata_sp, adata_sc=None, genes=None)
Compares generated spatial data with the true spatial data
- Parameters
adata_ge (AnnData) – generated spatial data returned by project_genes
adata_sp (AnnData) – gene spatial data
adata_sc (AnnData) – Optional. When passed, sparsity difference between adata_sc and adata_sp will be calculated. Default is None.
genes (list) – Optional. When passed, returned output will be subset on the list of genes. Default is None.
- Returns
- a dataframe with columns: ‘score’, ‘is_training’, ‘sparsity_sp’(spatial data sparsity).
Columns - ‘sparsity_sc’(single cell data sparsity), ‘sparsity_diff’(spatial sparsity - single cell sparsity) returned only when adata_sc is passed.
- Return type
Pandas Dataframe