deepspatial.core.DeepSpatial.setup_data#
- DeepSpatial.setup_data(adata_list: list[AnnData], spatial_key: str = 'spatial', z_key: str = 'z_coord', label_key: str = 'cell_class', batch_size: int = 128, num_workers: int = 4, n_samples_base: int = 50000, alpha_spatial: float = 0.5, cell_type_penalty: float = 50.0, uot_reg: float = 0.8, uot_tau: float = 0.05, uot_num_itermax: int = 50, uot_stop_thr: float = 0.01, mode: str = 'fit')[source]#
Prepares the data pipeline and calculates physical normalization statistics.
- Parameters:
adata_list – List of AnnData objects (slices).
spatial_key – Key in .obsm for XY coordinates.
z_key – Key in .obs for the physical Z coordinate.
label_key – Key in .obs for cell type annotations.
batch_size – Number of samples per training batch.
num_workers – Multi-process data loading workers.
n_samples_base – Total trajectory-pair budget allocated across adjacent slice pairs.
alpha_spatial – UOT spatial distance weight.
cell_type_penalty – UOT cost for pairing cells of different types.
uot_reg – Entropy regularization for UOT.
uot_tau – Marginal relaxation for UOT.
uot_num_itermax – Maximum number of Sinkhorn iterations.
uot_stop_thr – Sinkhorn convergence threshold.
mode – Dataset mode (‘fit’ for training, ‘predict’ for inference).