omicverse.bulk2single.Bulk2Single

omicverse.bulk2single.Bulk2Single(bulk_data: DataFrame, single_data: AnnData, celltype_key: str, bulk_group: Any | None = None, max_single_cells: int = 5000, top_marker_num: int = 500, ratio_num: int = 1, gpu: int | str = 0)[source]

VAE-based bulk-to-single framework for reconstructing pseudo single cells from bulk RNA-seq.

Parameters:
  • bulk_data (pd.DataFrame) – Bulk expression matrix with genes in rows and samples in columns.

  • single_data (anndata.AnnData) – Reference single-cell dataset used to learn cell-type expression patterns.

  • celltype_key (str) – Column in single_data.obs containing cell-type labels.

  • bulk_group (Optional[Any]) – Optional sample grouping information for averaging bulk replicates.

  • max_single_cells (int) – Maximum number of reference cells retained for model fitting.

  • top_marker_num (int) – Number of marker genes per cell type used by downstream preparation.

  • ratio_num (int) – Multiplier controlling total generated cell counts.

  • gpu (Union[int,str]) – Device selector for training (CUDA index, 'mps', or CPU fallback).

Returns:

Initializes bulk2single deconvolution and simulation workflow.

Return type:

None

Examples

>>> model = ov.bulk2single.Bulk2Single(bulk_data=bulk_data, single_data=single_data, celltype_key="Cell_type")