scphylo.pl.dendro_tree#

scphylo.pl.dendro_tree(tree, width=1200, height=500, dpi=300, cell_info=None, label_color='group_color', line_size=0.4, tiplab_size=2.5, inner_node_type='nmuts', inner_node_size=2, distance_labels_to_bottom=4, annotation=None, output_file=None)[source]#

Draw the tree in dendro fromat.

Parameters
  • tree (networkx.DiGraph) – The input tree.

  • width (int, optional) – Width of the figure, by default 8

  • height (int, optional) – Height of the figure, by default 3

  • dpi (int, optional) – The resolution, by default 300

  • cell_info (pandas.DataFrame, optional) – Information about cells such as color, expression values of genes and etc, by default None

  • label_color (str, optional) – The column name in which colors of cells are stored in the dataframe provided as cell_info, by default “group_color”

  • line_size (float, optional) – Line size of the tree, by default 0.4

  • tiplab_size (float, optional) – Cell name size in the tree, by default 2.5

  • inner_node_type (str, optional) –

    The format of the inner nodes (i.e. mutations), by default “nmuts” Values are:

    • nmuts: only number of mutations

    • nodeid: only node id

    • both: both number of mutations and node id

  • inner_node_size (int, optional) – Size of the inner nodes (i.e. mutations), by default 2

  • distance_labels_to_bottom (int, optional) – Distance cell names to the bottom of the figure, by default 4

  • annotation (list, optional) – List of gene names provided in the column dataframe of cell_info in to be annotated in the bottom of the tree, by default []

  • output_file (str, optional) – Path to a file for saving the tree in, by default None

Return type

None

Note

The cell names in the tree must be identical to the index of cell_info dataframe if it was provided.