Bering.graphs.BuildWindowGraphs
- Bering.graphs.BuildWindowGraphs(bg, n_cells_perClass=10, window_width=10.0, window_height=10.0, n_neighbors=10, min_points=20, use_unsegmented_ratio=0.8, max_unsegmented_thresh=0.4, cell_percentile_from_border=10, window_shift_ratio=0.25, n_windows_per_cell=5, min_spots_outside=5, **kwargs)[source]
Build Graphs for originally segemented cells. We randomly select a subset of cells and get their neighboring regions (windows) to construct graphs.
- Parameters:
bg (
Bering_Graph) – Bering_Graph objectn_cells_perClass (
int) – Number of cells per cell class for trainingwindow_width (
float) – Width of each selected region for graph constructionwindow_height (
float) – Height of each selected region for graph constructionn_neighbors (
int) – Number of neighbors in KNNmin_points (
int) – Minimum number of points in a windowuse_unsegmented_ratio (
float) – Proportion of unsegmented spots used in a windowmax_unsegmented_thresh (
float) – Maximum proportion of unsegmented spots in a windowcell_percentile_from_border (
float) – Remove cells in the border that are too close (within the defined percentile) to the image borderwindow_shift_ratio (
float) – To balance the transcripts within cells and out of cells, we shift the window to the centroid of the cell by a ratio of the cell diametern_windows_per_cell (
int) – Number of windows per cell. Available options are 1, 3, 5min_spots_outside (
int) – Minimum number of spots outside the cell**kwargs – Other arguments for BuildGraph
- Returns:
:
Bering_Graph.Graphs_golden:BrGraph()object with a list of graphs (torch_geometric.data.Data) for training