stlearn.spatial.sme.sme_impute0

stlearn.spatial.sme.sme_impute0(adata: AnnData, use_data: str = 'raw', weights: Literal['weights_matrix_all', 'weights_matrix_pd_gd', 'weights_matrix_pd_md', 'weights_matrix_gd_md', 'gene_expression_correlation', 'physical_distance', 'morphological_distance'] = 'weights_matrix_all', platform: Literal['Visium', 'Old_ST'] = 'Visium', copy: bool = False) AnnData | None[source]

Fill missing/zero expression values using spatial, morphological, and expression (SME) information when you what to correct for technical noise (dropouts) without altering existing biological signals.

This function replaces only zero/missing values with spatially-informed predictions while preserving all original non-zero expression measurements.

Parameters:
  • adata – Annotated data matrix must contain obsm[“X_morphology”] and obsm[“X_pca”].

  • use_data – input data, can be raw counts or log transformed data

  • weights (_WEIGHTING_MATRIX, default="weights_matrix_all") – Strategy for computing neighbor similarity weights: - “weights_matrix_all”: Combines spatial location (S) + morphological features (M) + gene expression correlation (E). - “weights_matrix_pd_gd”: Physical distance + gene expression correlation only. - “weights_matrix_pd_md”: Physical distance + morphological features only. - “weights_matrix_gd_md”: Gene expression + morphological features only. - “gene_expression_correlation”: Expression similarity only. - “physical_distance”: Spatial proximity only. - “morphological_distance”: Tissue morphology similarity only.

  • platformVisium or Old_ST

  • copy – If True, return a copy instead of writing to adata. If False, modify adata in place and return None.

Return type:

AnnData or None