API#
Preprocessing#
|
Prepare aligned single-cell and spatial datasets for cellpin. |
|
Load the single-cell example dataset used by cellpin tutorials. |
|
Load the spatial example dataset used by cellpin tutorials. |
Tools#
|
Transfer cell type labels from scRNA to spatial data via kNN in cellpin latent space. |
Plotting#
|
Plot validation loss curves from a Lightning CSVLogger |
Models#
|
CellPin: hybrid two-view VAE for single-cell and spatial transcriptomics. |
Model methods#
|
Train CellPin: Stage 1 (pretrain) followed by Stage 2 (distillation). |
|
Stage-1 pretraining (full-gene view only, ELBO). |
|
Stage-2 main training (both views, full ELBO + invariance + SNN). |
|
Impute with MC averaging and optional count-space normalisation. |
|
Encode cells to the latent space via the panel encoder. |
Dataset#
|
scRNA-seq AnnData dataset wrapper. |
|
Spatial AnnData dataset aligned to a panel gene list. |