plotBranchpoint: Plot Data On Branchpoint Layout

Description Usage Arguments Value Examples

View source: R/branchpointPlot.R

Description

This plots gene expression or metadata on a branchpoint preference plot generated by branchpointPreferenceLayout.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
plotBranchpoint(
  object,
  branchpoint.layout,
  label,
  label.2 = NULL,
  label.type = "search",
  populations = NULL,
  visited.size = T,
  point.alpha = 0.2,
  pt.lim = NULL,
  color.scale = NULL,
  discrete.colors = NULL,
  ylab = "Pseudotime",
  xlab = "Preference",
  title = label,
  axis.lines = T,
  legend = T,
  fade.low = 0.5
)

Arguments

object

An URD object

branchpoint.layout

The output of branchpointPreferenceLayout

label

(Character) Value to plot

label.2

(Character) If dual-color plotting, the second value to plot.

label.type

(Character)

populations

(Character vector, length 2) Labels for the two populations on the x-axis.

visited.size

(Logical) Should the size of points reflect how frequently they were visited by the random walks (to emphasize the more confident data points)

point.alpha

(Numeric) Transparency of points

pt.lim

(Numeric vector) Pseudotime (y) axis limits. Default NULL lets ggplot determine them automatically.

color.scale

(Character vector) Vector of colors to use as a color scale if label is continuous values. Does not apply if a second label is given, in which case the color scale will be red-green.

discrete.colors

(Character vector) Vector of colors to use as a color scale if label is discrete values.

ylab

(Character) Y-axis label

xlab

(Character) X-axis label

title

(Character) Plot title

axis.lines

(Logical) Plot axis lines on the plot?

legend

(Logical) Plot an expression legend?

fade.low

(Numeric) The transparency of the lowest expression points are decreased by this factor in order to prevent them from blocking the visualization of expressing cells if they are intermixed.

Value

A ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Plot with a discrete label -- STAGE
plotBranchpoint(object, np.layout, label="stage.nice", 
point.alpha=0.5, populations = c("P", "N"), pt.lim=c(0.7,0.1), 
xlab="", ylab="", legend=T, axis.lines = F, fade.low=0, 
discrete.colors = stage.colors[c(1,3:12)], title="Stage")

# Define genes to plot
axial.genes.plot <- c("NANOG", "TA", "NOTO", "NTD5", 
"SHHA", "COL8A1A", "MEX3B", "GSC", "FRZB", "PRDM1A", 
"ICN", "HE1A")

# Plot expression of many genes on the branchpoint 
# npreference plot in a grid
axial.branchpoint.plots <- lapply(axial.genes.plot, function(gene) 
plotBranchpoint(object, np.layout, label=gene, point.alpha=1, 
populations = c("P", "N"), pt.lim=c(0.7,0.11), color.scale = pref.colors, 
xlab="", ylab="", title=gene, legend=F, axis.lines = F, fade.low=0.66))
gridExtra::grid.arrange(grobs=axial.branchpoint.plots, ncol=6)

farrellja/URD documentation built on June 17, 2020, 4:48 a.m.