HieDiff.run_HieDiff#
- HieDiff.run_HieDiff(adata, n_epochs=1000, n_hidden=128, n_latent=10, batch_key=None, covar_key=None, device=None, copy=False)[source]#
Hierarchical flow diffusion for spatial transcriptomics.
- Parameters:
- adata :
AnnData Annotated data matrix.
- n_epochs :
int(default:1000) Number of epochs for training neural network. Default to 1000.
- n_hidden :
int(default:128) Number of neurons in the hidden layer. Default to 128.
- n_latent :
int(default:10) Number of neurons in the latent layer. Default to 10.
- batch_key :
str|NoneOptional[str] (default:None) The key to retriving batch information in adata.obs[batch_key]. If not specified, the batch correction is not considered.
- covar_key :
str|NoneOptional[str] (default:None) The key to retriving covariates in adata.obsm[covar_key]. If not specified, the covariates is not considered.
- device :
str|NoneOptional[str] (default:None) The desired device for PyTorch computation. By default uses cuda if cuda is avaliable cpu otherwise.
- copy :
bool(default:False) Return a copy instead of writing to
adata.
- adata :
- Return type:
- Returns:
: Depending on
copy, returns or updatesadatawith the following fields.- .obsm[‘qz’]
ndarray The latent representation of gene expression.
- .varp[‘W’]
csr_matrix The gene-by-gene relation matrix.
- .layers[‘x4’]
ndarray The denoised gene expression matrix.
- .obsm[‘qz’]