B_HIT.st.tl.dbscan_filter

Contents

B_HIT.st.tl.dbscan_filter#

B_HIT.st.tl.dbscan_filter(adata_tmp, eps=50, min_samples=5)#

Perform DBSCAN clustering on spatial coordinates in an AnnData object.

Parameters:
  • adata_tmp – The AnnData object containing spatial coordinates in obsm['spatial'].

  • eps (default: 50) – The maximum distance between two samples for one to be considered as in the neighborhood of the other. Default is 50.

  • min_samples (default: 5) – The number of samples in a neighborhood for a point to be considered as a core point. Default is 5.

Returns:

AnnData The updated AnnData object with a new column Bcell_aggregate_index in obs, containing the DBSCAN cluster labels. A visualization of the clustering result is also generated.