ct.plot.topics {cellTree} | R Documentation |
Plots a backbone tree (or MST) that was computed with compute.backbone.tree
, displaying each cell's topic distribution as a pie chart.
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)
tree |
An igraph tree, as returned by |
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 |
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. |
An updated igraph object with x
and y
vertex coordinate attributes.
# 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)