pyVIA.plotting_via.plot_piechart_viagraph

pyVIA.plotting_via.plot_piechart_viagraph(via_object, type_data='pt', gene_exp=[], cmap_piechart='rainbow', title='', cmap=None, ax_text=True, dpi=150, headwidth_arrow=0.1, alpha_edge=0.4, linewidth_edge=2, edge_color='darkblue', reference_labels=None, show_legend=True, pie_size_scale=0.8, fontsize=8, pt_visual_threshold=99, highlight_terminal_clusters=True, size_node_notpiechart=1, tune_edges=False, initial_bandwidth=0.05, decay=0.9, edgebundle_pruning=0.5)[source]

plot two subplots with a clustergraph level representation of the viagraph showing true-label composition (lhs) and pseudotime/gene expression (rhs) Returns matplotlib figure with two axes that plot the clustergraph using edge bundling left axis shows the clustergraph with each node colored by annotated ground truth membership. right axis shows the same clustergraph with each node colored by the pseudotime or gene expression

Parameters:
  • via_object – is class VIA (the same function also exists as a method of the class and an external plotting function

  • type_data – string default ‘pt’ for pseudotime colored nodes. or ‘gene’

  • gene_exp (list) – list of values (or column of dataframe) corresponding to feature or gene expression to be used to color nodes at CLUSTER level

  • cmap_piechart (str) – str cmap for piechart categories

  • title – string

  • cmap (str) – default None. automatically chooses coolwarm for gene expression or viridis_r for pseudotime

  • ax_text – Bool default= True. Annotates each node with cluster number and population of membership

  • dpi – int default = 150

  • headwidth_arrow – default = 0.1. width of arrowhead used to directed edges

  • reference_labels – None or list. list of categorical (str) labels for cluster composition of the piecharts (LHS subplot) length = n_samples.

  • pie_size_scale (float) – float default=0.8 scaling factor of the piechart nodes

  • pt_visual_threshold (int) – int (percentage) default = 95 corresponding to rescaling the visual color scale by clipping outlier cluster pseudotimes

:param highlight_terminal_clusters:bool = True (red border around terminal clusters) :type size_node_notpiechart: float :param size_node_notpiechart: scaling factor for node size of the viagraph (not the piechart part) :param initial_bandwidth: (float = 0.05) increasing bw increases merging of minor edges. Only used when tune_edges = True :param decay: (decay = 0.9) increasing decay increases merging of minor edges . Only used when tune_edges = True :param edgebundle_pruning (float = 0.5). takes on values between 0-1. smaller value means more pruning away edges that can be visualised. Only used when tune_edges = True :return: f, ax, ax1