- dynamo.vf.streamline_clusters(adata, basis='umap', features=['speed', 'divergence', 'acceleration', 'curvature', 'curl'], method='sparsevfc', xy_grid_nums=[50, 50], density=5, curvature_method=1, feature_bins=10, clustering_method='leiden', assign_fixedpoints=False, reversed_fixedpoints=False, **kwargs)
Cluster 2D streamlines based on vector field features. Initialize a grid over the state space and compute the flow of data through the grid using plt.streamplot with a given density. For each point individual streamline, computes the vector field ‘features’ of interest and stores the data via histograms. Add fixed points and “reversed fixed points” (sources of the streamlines) to the feature data dataframe based on the ‘assigned_fixedpoints’ and ‘reversed_fixedpoints’ args. Finally, then cluster the streamlines based on these features using the given ‘clustering_method’.
AnnData) – An AnnData object representing the network to be analyzed.
str) – The basis to use for creating the vector field, either “umap” or “tsne”. Defaults to “umap”.
list) – A list of features to calculate for each point in the vector field. Defaults to [“speed”, “divergence”, “acceleration”, “curvature”, “curl”].
str) – The method to use for calculating the flow of data through the grid, either “sparsevfc” or “gaussian”. Defaults to “sparsevfc”.
list) – The number of points to use in the x and y dimensions of the grid. Defaults to [50, 50].
float) – The density of the grid. Defaults to 5.
int) – The method to use for calculating curvature. Defaults to 1.
int) – The number of bins to use for discretizing the data. Defaults to 10.
str) – The method to use for clustering the data into modules, either “louvain” or “leiden”. Defaults to “leiden”.
bool) – A boolean indicating whether to assign fixed points to the data. Defaults to False.
bool) – A boolean indicating whether to reverse the fixed points assignment. Defaults to False.
- Return type:
- None, but updates the adata object with the following fields of the adata.uns[“streamline_clusters_” + basis]