BAITS.st.tl.dbscan_cluster#
- BAITS.st.tl.dbscan_cluster(adata_tmp, eps=50, min_samples=5, plot=True, spot_size=50, cmap='tab20_r', title='BLA_id')#
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.plot (bool, optional (default=True)) – If True, generates a spatial scatter plot visualizing the identified clusters.
spot_size (float, optional (default=50)) – Marker size for individual cells in the spatial visualization plot.
- Returns:
The updated AnnData object with a new column
BLA_idinobs, containing the DBSCAN cluster labels.- Return type:
AnnData