Bering.graphs.BuildGraph

Bering.graphs.BuildGraph(bg, df_spots, n_neighbors=10, beta=1.0, **kwargs)[source]

Build nearest neighbor graph for mRNA/protein colocalization.

Parameters:
  • bg – Bering object

  • df_spots (DataFrame) – The table of spots from a defined spatial region

  • n_neighbors (int) – Number of neighbors in KNN

Returns:

: Graph of torch_geometric.data.Data, which can be used for training.