cascade.data.neighbor_impute
- cascade.data.neighbor_impute(adata, k, use_rep, use_batch=None, X_agg='sum', obs_agg=None, obsm_agg=None, layers_agg=None)[source]
Impute data by aggregating nearest neighbors
- Parameters:
adata (
AnnData) – Dataset to be imputedk (
int) – Number of nearest neighborsuse_rep (
str) – Key inobsmcontaining the representation to be used for nearest neighbor searchuse_batch (
str|None) – Key inobsused to group cells for nearest neighbor search (e.g., intervention label)X_agg (
str|None) – Aggregation function forX, must be one of{"sum", "mean", ``None}``. Setting toNonediscards theXmatrix.obs_agg (
Mapping[str,str] |None) – Aggregation methods forobs, indexed by obs columns, must be one of{"sum", "mean"}. Fields not specified will be discarded.obsm_agg (
Mapping[str,str] |None) – Aggregation methods forobsm, indexed by obsm keys, must be one of{"sum", "mean"}. Fields not specified will be discarded.layers_agg (
Mapping[str,str] |None) – Aggregation methods forlayers, indexed by layer keys, must be one of{"sum", "mean"}. Fields not specified will be discarded.
- Return type:
- Returns:
Imputed dataset