opendvp.pp.impute_marker_with_annotation

opendvp.pp.impute_marker_with_annotation#

impute_marker_with_annotation(adata, target_variable, target_annotation_column, quantile_for_imputation=0.05)#

Change value of a feature in an AnnData object for rows matching a specific annotation.

Using a specified quantile value from the variable’s distribution.

Parameters:
  • adata (anndata.AnnData) – The annotated data matrix.

  • target_variable (str) – The variable (gene/feature) to impute.

  • target_annotation_column (str) – The column in adata.obs to use for selecting rows to impute.

  • quantile_for_imputation (float, optional) – The quantile to use for imputation (default is 0.05).

Returns:

A copy of the AnnData object with imputed values.

Return type:

anndata.AnnData