Af_compare_across_repertoires: A function to compare dynamics of B cell evolution across...

View source: R/Af_compare_across_repertoires.R

Af_compare_across_repertoiresR Documentation

A function to compare dynamics of B cell evolution across different repertoires.

Description

Compare tree topology metrics across different (groups) of AntibodyForests objects.

Usage

Af_compare_across_repertoires(
  AntibodyForests_list,
  metrics,
  plot,
  text.size,
  colors,
  significance,
  parallel,
  num.cores
)

Arguments

AntibodyForests_list

A list of AntibodyForests objects to compare.

metrics

Which metrics to use for comparison. Options are: . betweenness : The number of shortest paths that pass through each node (Default) . degree : The number of edges connected to each node (Default) 'nr.nodes' : The total number of nodes 'nr.cells' : The total number of cells in this clonotype 'mean.depth' : Mean of the number of edges connecting each node to the germline 'mean.edge.length' : Mean of the edge lengths between each node and the germline 'sackin.index' : Sum of the number of nodes between each terminal node and the germline, normalized by the number of terminal nodes 'spectral.density' : Metrics of the spectral density profiles (calculated with package RPANDA)

  • peakedness : Tree balance

  • asymmetry : Shallow or deep branching events

  • principal eigenvalue : Phylogenetic diversity

  • modalities : The number of different structures within the tree

plot

What kind of plot to make. boxplot (default) freqpoly

text.size

Font size in the plot (default 20).

colors

Optionally specific colors for the groups. If not provided, the default ggplot2 colors are used.

significance

If TRUE, the significance of a T test between the groups is plotted in the boxplot (default FALSE)

parallel

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

num.cores

Number of cores to be used when parallel = TRUE. (Defaults to all available cores - 1)

Value

Plots to compare the repertoires on the supplied metrics.

Examples

boxplots <- Af_compare_across_repertoires(list("S1" = AntibodyForests::small_af[1],
            "S2" = AntibodyForests::small_af[2]),
            metrics = c("betweenness", "degree"),
            plot = "boxplot")
boxplots$betweenness

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