pyVIA.plotting_via.make_edgebundle_milestone

pyVIA.plotting_via.make_edgebundle_milestone(embedding=None, sc_graph=None, via_object=None, sc_pt=None, initial_bandwidth=0.03, decay=0.7, n_milestones=None, milestone_labels=[], sc_labels_numeric=None, weighted=True, global_visual_pruning=0.5, terminal_cluster_list=[], single_cell_lineage_prob=None, random_state=0)[source]

Perform Edgebundling of edges in a milestone level to return a hammer bundle of milestone-level edges. This is more granular than the original parc-clusters but less granular than single-cell level and hence also less computationally expensive requires some type of embedding (n_samples x 2) to be available

Parameters:
  • embedding (ndarray) – optional (not required if via_object is provided) embedding single cell. also looks nice when done on via_mds as more streamlined continuous diffused graph structure. Umap is a but “clustery”

  • graph – optional (not required if via_object is provided) igraph single cell graph level

  • via_object – via_object (best way to run this function by simply providing via_object)

  • sc_graph – igraph graph set as the via attribute self.ig_full_graph (affinity graph)

  • initial_bandwidth – increasing bw increases merging of minor edges

  • decay – increasing decay increases merging of minor edges #https://datashader.org/user_guide/Networks.html

  • milestone_labels (list) – default list=[]. Usually autocomputed. but can provide as single-cell level labels (clusters, groups, which function as milestone groupings of the single cells)

  • sc_labels_numeric (list) – default is None which automatically chooses via_object’s pseudotime or time_series_labels (when available). otherwise set to a list of numerical values representing some sequential/chronological information

  • terminal_cluster_list (list) – default list [] and automatically uses all terminal clusters. otherwise set to any of the terminal cluster numbers within a list

Returns:

dictionary containing keys: hb_dict[‘hammerbundle’] = hb hammerbundle class with hb.x and hb.y containing the coords hb_dict[‘milestone_embedding’] dataframe with ‘x’ and ‘y’ columns for each milestone and hb_dict[‘edges’] dataframe with columns [‘source’,’target’] milestone for each each and [‘cluster_pop’], hb_dict[‘sc_milestone_labels’] is a list of milestone label for each single cell