plotTreeForceDual: Plot force-directed layout of tree

Description Usage Arguments Value Examples

View source: R/tree-force-layout.R

Description

This plots data on the force-directed layout of an URD tree, generated by treeForceDirectedLayout, using red and green (which become yellow when they overlap to display two pieces of data simultaneously. See plotTreeForce for more details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
plotTreeForceDual(
  object,
  label.red,
  label.green,
  label.red.type = "search",
  label.green.type = "search",
  view = "default",
  alpha = 0.8,
  alpha.fade = 0.025,
  size = 5,
  title = NULL,
  title.cex = 3,
  title.line = 0,
  label.tips = (!is.null(object@tree$segment.names) |
    !is.null(object@tree$segment.names.short)),
  use.short.names = !is.null(object@tree$segment.names.short),
  seg.show = NULL,
  cells.show = NULL,
  fade.below = (1/3),
  fade.method = c("max", "min", "mean"),
  density.alpha = T,
  label.spacing = 5,
  text.cex = 0.8
)

Arguments

object

An URD object

label.red

(Character) Data to use for coloring tree (red channel) (see data.for.plot)

label.green

(Character) Data to use for coloring tree (green channel) (see data.for.plot)

view

(Character) Name of view to use (i.e. the name of an entry in @tree$force.view.list) created by plotTreeForceStore3DView. Default is last view created.

alpha

(Numeric) Maximum transparency of points

alpha.fade

(Numeric) Minimum transparency of points

size

(Numeric) Size of points in the plot

title

(Character) Title to add to the plot. (This is sensitive to resizing the window after plotting, but if a view is stored, the window will be resized before the title is added, so it will be acceptable resolution for figures.)

title.cex

(Numeric) Adjust the title font size

title.line

(Numeric) Adjust the position of the title. Positive numbers move the title upward.

label.tips

(Logical) Should text identifying the tips of the tree be placed in the force directed layout? Defaults to TRUE if @tree$segment.names has been set.

use.short.names

(Logical) Should short names from @tree$segment.names.short be used? Defaults to TRUE if those values have been set.

seg.show

(Character vector) Segments of the tree to put on the plot (Default NULL is all segments)

cells.show

(Character vector) Cells of the tree to show (Default NULL is all cells)

fade.below

(Numeric) If desired, transparency can be lowered for points with low expression values (thereby highlighting the portions of the tree with expression). This value is the portion of the range of expression values to fade. (The default, 1/3, fades the bottom third of the expression values.) A fully 'faded' point will have alpha of alpha.fade.

fade.method

(Character: "max", "min", or "mean") Should fade be calculated on max expression of the two labels (emphasize any cells expressing either label), min expression of the two labels (emphasize only cells co-expressing both labels), or mean expression

density.alpha

(Logical) Should points with short distance to nearest neighbors (i.e. in denser regions of the plot) be more transparent?

label.spacing

(Numeric) How far should labels be from the detected tips

text.cex

(Numeric) Size of the label text

label.type.red

(Character) Where to find data for red channel label (default "search" auto-detects, see data.for.plot)

label.type.green

(Character) Where to find data for green channel label (default "search" auto-detects, see data.for.plot)

Value

Nothing. Produces a plot using the rgl package, displayed in an X11 window.

Examples

1
2
3
4
5
# Focus on all cells that express either gene
plotTreeForceDual(object, label.red="SOX17", label.green="SOX32", title="SOX32 (green) + SOX17 (red)")

# Focus on only the co-expressing cells by using fade.method="min"
plotTreeForceDual(object, label.red="SOX17", label.green="SOX32", title="SOX32 (green) + SOX17 (red)", fade.method="min")

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