pyVIA.plotting_via.plot_atlas_view

pyVIA.plotting_via.plot_atlas_view(hammerbundle_dict=None, via_object=None, alpha_bundle_factor=1, linewidth_bundle=2, facecolor='white', cmap='plasma', extra_title_text='', alpha_milestones=0.3, headwidth_bundle=0.1, headwidth_alpha=0.8, arrow_frequency=0.05, show_arrow=True, sc_labels_sequential=None, sc_labels_expression=None, initial_bandwidth=0.03, decay=0.7, n_milestones=None, scale_scatter_size_pop=False, show_milestones=True, sc_labels=None, text_labels=False, lineage_pathway=[], dpi=300, fontsize_title=6, fontsize_labels=6, global_visual_pruning=0.5, use_sc_labels_sequential_for_direction=False, sc_scatter_size=3, sc_scatter_alpha=0.4, add_sc_embedding=True, size_milestones=5, colorbar_legend='pseudotime')[source]

Edges can be colored by time-series numeric labels, pseudotime, lineage pathway probabilities, or gene expression. If not specificed then time-series is chosen if available, otherwise falls back to pseudotime. to use gene expression the sc_labels_expression is provided as a list. To specify other numeric sequential data provide a list of sc_labels_sequential = [] n_samples in length. via_object.embedding must be an ndarray of shape (nsamples,2)

Parameters:
  • hammer_bundle_dict – dictionary with keys: hammerbundle object with coordinates of all the edges to draw. If hammer_bundle and layout are None, then this will be computed internally

  • via_object – type via object, if hammerbundle_dict is None, then you must provide a via_object. Ensure that via_object has embedding attribute

  • layout – coords of cluster nodes and optionally also contains the numeric value associated with each cluster (such as time-stamp) layout[[‘x’,’y’,’numeric label’]] sc/cluster/milestone level

  • CSM – cosine similarity matrix. cosine similarity between the RNA velocity between neighbors and the change in gene expression between these neighbors. Only used when available

  • velocity_weight – percentage weightage given to the RNA velocity based transition matrix

  • pt – cluster-level pseudotime

  • alpha_bundle – alpha when drawing lines

  • linewidth_bundle – linewidth of bundled lines

  • edge_color

  • alpha_milestones (float) – float 0.3 alpha of milestones

  • size_milestones (int) – scatter size of the milestones (use sc_size_scatter to control single cell scatter when using in conjunction with lineage probs/ sc embeddings)

  • arrow_frequency (float) – min dist between arrows (bundled edges otherwise have overcrowding of arrows)

  • show_direction – True will draw arrows along the lines to indicate direction

  • milestone_edges – pandas DataFrame milestoone_edges[[‘source’,’target’]]

  • milestone_numeric_values – the milestone average of numeric values such as time (days, hours), location (position), or other numeric value used for coloring edges in a sequential manner if this is None then the edges are colored by length to distinguish short and long range edges

  • arrow_frequency – 0.05. higher means fewer arrows

  • n_milestones (int) – int None. if no hammerbundle_dict is provided, but via_object is provided, then the user can specify level of granularity by setting the n_milestones. otherwise it will be automatically selected

  • scale_scatter_size_pop (bool) – bool default False

  • sc_labels_expression (list) – list single cell numeric values used for coloring edges and nodes of corresponding milestones mean expression levels (len n_single_cell samples) edges can be colored by time-series numeric (gene expression)/string (cell type) labels, pseudotime, or gene expression. If not specificed then time-series is chosen if available, otherwise falls back to pseudotime. to use gene expression the sc_labels_expression is provided as a list

  • sc_labels_sequential (list) – list single cell numeric sequential values used for directionality inference as replacement for pseudotime or via_object.time_series_labels (len n_samples single cell)

  • sc_labels (list) – list None list of single-cell level labels (categorial or discrete set of numerical values) to label the nodes

  • text_labels (bool) – bool False if you want to label the nodes based on sc_labels (or true_label if via_object is provided)

  • lineage_pathway (list) – list of terminal states to plot lineage pathways

  • use_sc_labels_sequential_for_direction (bool) – use the sequential data (timeseries labels or other provided by user) to direct the arrows

:param lineage_alpha_threshold number representing the percentile (0-100) of lineage likelikhood in a particular lineage pathway, below which edges will be drawn with lower alpha transparency factor :type sc_scatter_alpha: float :param sc_scatter_alpha: transparency of the background singlecell scatter when plotting lineages :type add_sc_embedding: bool :param add_sc_embedding: add background of single cell scatter plot for Atlas :param scatter_size_sc_embedding :param colorbar_legend str title of colorbar :return: fig, axis with bundled edges plotted