ct.plot.topics {cellTree} | R Documentation

## Plot cell tree with topic distributions

### Description

Plots a backbone tree (or MST) that was computed with `compute.backbone.tree`, displaying each cell's topic distribution as a pie chart.

### Usage

    ct.plot.topics(tree, file.output = NULL, show.labels = FALSE,
      force.recompute.layout = FALSE, height = 20, width = 10,
      vertebrae.distance = 0, backbone.vertex.size = 0, vert.vertex.size = 0)

### Arguments

`tree` | An igraph tree, as returned by `compute.backbone.tree`
`file.output` | String (optional). Path of a file where the plot should be saved in PDF format (rendered to screen if omitted).
`show.labels` | Boolean (optional). Whether to write each cell's row number next to its vertex.
`force.recompute.layout` | Boolean (optional). If set to `TRUE`, recomputes the graph's layout coordinates even when present.
`height, width` | Numeric (optional). Height and width (in inches) of the plot.
`vertebrae.distance` | Numeric (optional). If non-zero: forces a specific plotting distance (in pixels) between backbone cells and related peripheral cells (‘vertebrae’).
`backbone.vertex.size, vert.vertex.size` | Numeric (optional). Diameter (in pixels) of backbone and vertebrae cell vertices.

### Value

An updated igraph object with `x` and `y` vertex coordinate attributes.

### Examples

    # Load pre-computed LDA model for skeletal myoblast RNA-Seq data from HSMMSingleCell package:
    data(HSMM_lda_model)

    # Recover sampling time (in days) for each cell:
    library(HSMMSingleCell)
    data(HSMM_sample_sheet)
    days.factor = HSMM_sample_sheet$Hours
    days = as.numeric(levels(days.factor))[days.factor]

    # Compute near-optimal backbone tree:
    b.tree = compute.backbone.tree(HSMM_lda_model, days)
    # Plot resulting tree with sampling time as a vertex group colour:
    ct.plot.grouping(b.tree)

[Package cellTree version 1.16.0 Index]