COSIE.data_preprocessing

Functions

clr_normalize_each_cell

Normalize each cell's protein counts using Centered Log-Ratio (CLR) normalization, following the approach used in Seurat and SpatialGLUE.

construct_metacell_data_dict

Apply metacell construction to all available AnnData objects in a multimodal dataset dictionary.

load_data

Process input spatial multi-modal data, returning processed feature matrices and spatial coordinates.

metacell_construction_optimized

Construct metacells by aggregating every 2×2 spatially adjacent grid of cells into one, using integer grid grouping for O(n) performance.

preprocess_adata

Preprocess an AnnData object based on the specified modality.

reconstruct_metacell_to_original

Expand metacell-level embeddings back to individual cells based on the metacell-to-original cell mapping.