Af_distance_boxplot: Function to make a grouped boxplot of distance between nodes...

View source: R/Af_distance_boxplot.R

Af_distance_boxplotR Documentation

Function to make a grouped boxplot of distance between nodes from specific groups and the germline of lineage trees constructed with AntibodyForests.

Description

Function to compare trees.

Usage

Af_distance_boxplot(
  AntibodyForests_object,
  distance,
  min.nodes,
  groups,
  node.feature,
  unconnected,
  colors,
  text.size,
  x.label,
  group.order,
  significance,
  parallel,
  output.file
)

Arguments

AntibodyForests_object

AntibodyForests-object, output from Af_build()

distance
  • string - How to calculate the distance to the germline. 'node.depth' : Average of the sum of edges on the shortest parth between germline and nodes from this group. 'edge.length' : Average of the sum of edge length of the shortest path between germline and nodes from this group. (Default)

min.nodes

The minimum number of nodes for a tree to be included in this analysis (this included the germline)

groups

Which groups to compare. These groups need to be in the node features of the AntibodyForests-object. Set to NA if all features should displayed. (default is NA) If you want to compare IgM and IgG for example, groups should be c("IgM, "IgG") (not "Isotypes")

node.feature

Node feature in the AntibodyForests-object to compare.

unconnected

If TRUE, trees that don't have all groups will be plotted, but not included in significance analysis. (default FALSE)

colors

Optionally specific colors for the group (Will be matched to the groups/names on alphabetical order).

text.size

Font size in the plot (default 20).

x.label

Label for the x-axis (default is the node feature).

group.order

Order of the groups on the x-axis. (default is alphabetical/numerical)

significance

If TRUE, the significance of the difference (paired t-test) between the groups is plotted. (default FALSE)

parallel

If TRUE, the metric calculations are parallelized across clonotypes. (default FALSE)

output.file

string - specifies the path to the output file (PNG of PDF). Defaults to NULL.

Value

A ggplot2 object with the boxplot.

Examples

Af_distance_boxplot(AntibodyForests::small_af,
                    distance = "edge.length",
                    min.nodes = 5,
                    groups = c("IGHA", "IgG1"),
                    node.feature = "isotype",
                    unconnected = TRUE)


AntibodyForests documentation built on April 4, 2025, 4:45 a.m.