Bering.tools.cell_segmentation
- Bering.tools.cell_segmentation(bg, use_image=True, positive_edge_thresh=0.6, leiden_resolution=0.01, num_edges_perSpot=300, graph_n_neighbors=10, num_iters=100)[source]
Run cell segmentation for all spots.
- Parameters:
bg (BrGraph) – Bering graph object
use_image (bool) – Whether to use image features for cell segmentation
positive_edge_thresh (float) – Minimal threshold of prediction probability for edges to be considered as positive
leiden_resolution (float) – Resolution for Leiden clustering in the segmentation step
num_edges_perSpot (int) – Number of nearest edges for each spot to be considered in the graph construction
graph_n_neighbors (int) – Number of neighbors for graph construction if
bg.graph_all==Noneandbg.z_all==Nonenum_iters (int) – Number of iterations for edge label prediction. This is only used when number of edges are to large. It can avoid memory overflow.