plotSubtrees - Plots subtree statistics for multiple trees
plotSubtree plots distributions of normalized subtree statistics for a
set of lineage trees, broken down by annotation value.
plotSubtrees(graphs, field, stat, root = "Germline", exclude = c("Germline", NA), colors = NULL, main_title = "Subtrees", legend_title = "Annotation", style = c("box", "violin"), silent = FALSE, ...)
- list of igraph objects containing annotated lineage trees.
- string defining the annotation field.
- string defining the subtree statistic to plot. One of:
outdegree: distribution of normalized node outdegrees.
size: distribution of normalized subtree sizes.
depth: distribution of subtree depths.
pathlength: distribution of maximum pathlength beneath nodes.
- name of the root (germline) node.
- vector of strings defining
fieldvalues to exclude from plotting.
- named vector of colors for values in
field, with names defining annotation names
fieldcolumn and values being colors. Also controls the order in which values appear on the plot. If
NULLalphabetical ordering and a default color palette will be used.
- string specifying the plot title.
- string specifying the legend title.
- string specifying the style of plot to draw. One of:
"histogram": histogram of the annotation count distribution with a red dotted line denoting the observed value.
"cdf": cumulative distribution function of annotation counts with a red dotted line denoting the observed value and a blue dotted line indicating the p-value.
TRUEdo not draw the plot and just return the ggplot2 object; if
FALSEdraw the plot.
- additional arguments to pass to ggplot2::theme.
ggplot object defining the plot.
# Define example tree set graphs <- ExampleTrees[1-10] # Plot violins of outdegree by sample plotSubtrees(graphs, "SAMPLE", "out", main_title="Node outdegree", style="v")
# Plot violins of subtree by sample plotSubtrees(graphs, "SAMPLE", "size", style="v")
# Plot boxplot of pathlength by isotype plotSubtrees(graphs, "ISOTYPE", "path", colors=IG_COLORS, legend_title="Isotype", style="b")
Warning:The following are missing from the ‘colors’ argument and will be colored grey: IgA,IgG IgD,IgG
# Plot boxplot of depth by isotype plotSubtrees(graphs, "ISOTYPE", "depth", style="b")
Subtree statistics are calculated with summarizeSubtrees.