ct.plot.grouping {cellTree}R Documentation

Plot cell tree with grouping information

Description

Plots a backbone tree (or MST) that was computed with compute.backbone.tree, displaying each cell's grouping.

Usage

ct.plot.grouping(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

Numeric (optional). Height and width (in inches) of the plot.

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

Numeric (optional). Diameter (in pixels) of backbone and vertebrae cell vertices.

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.22.0 Index]