omicverse.bulk2single.Single2Spatial¶
- omicverse.bulk2single.Single2Spatial(single_data: AnnData, spatial_data: AnnData, celltype_key: str, spot_key: list = ['xcoord', 'ycoord'], top_marker_num=500, marker_used=True, gpu: int | str = 0) None[source]¶
Deep-learning mapper that projects single-cell profiles onto spatial coordinates.
- Parameters:
single_data (anndata.AnnData) – Single-cell reference AnnData containing expression and cell types.
spatial_data (anndata.AnnData) – Spatial transcriptomics AnnData used as mapping target.
celltype_key (str) – Column name in
single_data.obscontaining cell-type labels.spot_key (list) – Column names in
spatial_data.obsstoring x/y coordinates.top_marker_num (int) – Number of marker genes used to train mapping model.
marker_used (bool) – Whether to restrict training features to marker genes.
gpu (Union[int,str]) – Compute device selector (CUDA index,
'mps', or CPU fallback).
- Returns:
Initializes single-cell to spatial mapping workflow.
- Return type:
None
Examples
>>> st_model = ov.bulk2single.Single2Spatial(single_data=single_data, spatial_data=st_data, celltype_key="Cell_type")