SC2Spa.tl.NRD_impute
- SC2Spa.tl.NRD_impute(neighbors, dis, adata_ref, adata_query, ct_name=None, weight_constant=1, exclude_CTs=None)
Reconstruct the gene expression profile of ST beads based on the NRD_weight output
Predicted cell type proportion will be saved in adata_ref.obs.
Parameters
- neighbors
Matrix of single cell neighbors of ST beads with the shape of (n_beads, n_neighbors)
- dis
corresponding distance matrix of the neighbor matrix
- adata_ref
Reference anndata object. Gene expression matrix should be the shape of (cell, gene). Predicted coordinates should be stored in adata_ref.obs[[‘x_transfer’, ‘y_transfer’]]
- adata_query
Query anndata object. Gene expression matrix should be the shape of (cell, gene). Cell type annotation should be stored in adata_query.obs[ct_name] Predicted locations should be stored in adata_query.obs[[‘x_transfer’, ‘y_transfer’]]
- dis_min
Distance cutoff that determines if a ST bead and a single cell is paired
- exclude_CTs
A list that contains cell types to be excluded
Returns
- adata_impute
An Anndata object that stores the reconstructed gene expression profile of ST beads