maxfuse.model.Fusor.construct_graphs

Fusor.construct_graphs(n_neighbors1=15, n_neighbors2=15, svd_components1=None, svd_components2=None, resolution1=1, resolution2=1, randomized_svd=False, svd_runs=1, resolution_tol=0.1, leiden_runs=1, metric='correlation', leiden_seed=None, verbose=True)[source]

Construct neighborhood graphs and cluster them as needed.

Parameters:
  • n_neighbors1 (int, default=15) – Number of neighbors for graph construction for arr1.

  • n_neighbors2 (int, default=15) – Number of neighbors for graph construction for arr2.

  • svd_components1 (None or int, default=None) – If not None, perform SVD to reduce the dimension of self.active_arr1 before doing neighborhood search.

  • svd_components2 – If not None, perform SVD to reduce the dimension of self.active_arr2 before doing neighborhood search.

  • resolution1 (int, default=1) – Resolution parameter for Leiden algorithm when clustering the graphs for arr1.

  • resolution2 (int, default=1) – Resolution parameter for Leiden algorithm when clustering the graphs for arr2.

  • randomized_svd (bool, default=False) – Whether to perform randomized SVD.

  • svd_runs (int, default=1) – Perform multiple runs of SVD and select the one with lowest Frobenious reconstruction error is selected.

  • resolution_tol (float, default=0.1) – Any resolution within the range of plus/minus resolution_tol will not be differentiated.

  • leiden_runs (int, default=1) – Perform multiple runs of Leiden algorithm and the one with highest modularity is selected.

  • metric (string, default='correlation') – The metric to use in nearest neighbor search.

  • leiden_seed (None or int, default=None) – Random seed for Leiden algorithm. If leiden_runs>1, leiden_seed will be reset to None.

  • verbose (bool, default=True) – Whether to print the progress.

Returns:

None