tangram.mapping_utils.pp_adatas

tangram.mapping_utils.pp_adatas(adata_sc, adata_sp, genes=None)

Pre-process AnnDatas so that they can be mapped. Specifically: - Remove genes that all entries are zero - Find the intersection between adata_sc, adata_sp and given marker gene list, save the intersected markers in two adatas - Calculate density priors and save it with adata_sp

Parameters
  • adata_sc (AnnData) – single cell data

  • adata_sp (AnnData) – spatial expression data

  • genes (List) – Optional. List of genes to use. If None, all genes are used.

Returns

update adata_sc by creating uns training_genes overlap_genes fields update adata_sp by creating uns training_genes overlap_genes fields and creating obs rna_count_based_density & uniform_density field