spateo.tdr.interpolations.interpolation_dl#

Module Contents#

Functions#

deep_intepretation(→ anndata.AnnData)

Learn a continuous mapping from space to gene expression pattern with the deep neural net model.

spateo.tdr.interpolations.interpolation_dl.deep_intepretation(source_adata: anndata.AnnData, target_points: numpy.ndarray | None = None, keys: str | list = None, spatial_key: str = 'spatial', layer: str = 'X', max_iter: int = 1000, data_batch_size: int = 2000, autoencoder_batch_size: int = 50, data_lr: float = 0.0001, autoencoder_lr: float = 0.0001, **kwargs) anndata.AnnData[source]#

Learn a continuous mapping from space to gene expression pattern with the deep neural net model.

Parameters:
source_adata

AnnData object that contains spatial (numpy.ndarray) in the obsm attribute.

target_points

The spatial coordinates of new data point. If target_coords is None, generate new points based on grid_num.

keys

Gene list or info list in the obs attribute whose interpolate expression across space needs to learned.

spatial_key

The key in .obsm that corresponds to the spatial coordinate of each bucket.

layer

If 'X', uses .X, otherwise uses the representation given by .layers[layer].

max_iter

The maximum iteration the network will be trained.

data_batch_size

The size of the data sample batches to be generated in each iteration.

autoencoder_batch_size

The size of the auto-encoder training batches to be generated in each iteration. Must be no greater than batch_size. .

data_lr

The learning rate for network training.

autoencoder_lr

The learning rate for network training the auto-encoder. Will have no effect if network_dim equal data_dim.

**kwargs

Additional parameters that will be passed to the training step of the deep neural net.

Returns:

an anndata object that has interpolated expression.

Return type:

interp_adata