SPACEL.Spoint.base_model.SpointModel.deconv_spatial

SpointModel.deconv_spatial(st_data=None, min_prop=0.01, model_path=None, use_best_model=True, add_obs=True, add_uns=True)

Deconvolute spatial transcriptomic data.

Using well-trained Spoint model to predict the cell type porportion of spots in spatial transcriptomic data.

Parameters:
  • st_data – An AnnData object of spatial transcriptomic data to be deconvolute.

  • min_prop – A threshold value below which the predicted value will be set to 0.

  • model_path – A string representing the path of saved model file.

  • use_best_model – If True, the model with the least loss will be used, otherwise, the last trained model will be used.

  • add_obs – If True, the predicted results will be writen to the obs of input AnnData object of spatial transcriptomic data.

  • add_uns – If True, the name of predicted cell types will be writen to the uns of input AnnData object of spatial transcriptomic data

Returns:

A DataFrame contained deconvoluted results. Each row representing a spot, and each column representing a cell type.