Deconvolution¶
High-level API¶
deconvolution runs preprocessing, model training and prediction in one
call. It returns one composition DataFrame for each requested cell type
layer.
hide_deconv.deconvolution(adata, bulk, celltype_cols=None, n_genes=5000, n_train_bulks=10000, n_cells_per_bulk=100, n_iter=1000, domain_transfer=True, library_size_correction=True, seed=42)
¶
Run preprocessing, training and deconvolution in one call.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adata
|
AnnData
|
Annotated single-cell input data. |
required |
bulk
|
DataFrame
|
Bulk expression with genes as rows and samples as columns. |
required |
celltype_cols
|
list[str]
|
Cell type annotation columns in adata.obs. The first column is treated as the finest cell type layer. If no columns are specified, column cell_type is used. |
None
|
n_genes
|
int
|
Number of genes used for training and deconvolution. |
5000
|
n_train_bulks
|
int
|
Number of training bulks generated for training. |
10000
|
n_cells_per_bulk
|
int
|
Number of cells sampled per training bulk. |
100
|
n_iter
|
int
|
Number of training iterations. |
1000
|
domain_transfer
|
bool
|
Correct for domain transfer between Single Cell and Bulk data. |
True
|
library_size_correction
|
bool
|
Correct for library size differences between Single Cell and Bulk data. |
True
|
seed
|
int
|
Random seed for the simulated training bulks. |
42
|
Returns:
| Type | Description |
|---|---|
list[DataFrame]
|
List of estimated composition, same order as the celltype_cols list. |
Source code in src/hide_deconv/pipelines/lazy_deconvolution_pipeline.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 | |