Af_cluster_metrics: Function to make a grouped boxplot of metrics from clusters...

View source: R/Af_cluster_metrics.R

Af_cluster_metricsR Documentation

Function to make a grouped boxplot of metrics from clusters of clonotypes

Description

Function to compare metrics between clusters of clontoypes

Usage

Af_cluster_metrics(
  input,
  clusters,
  metrics,
  min.nodes,
  colors,
  text.size,
  significance,
  parallel,
  num.cores
)

Arguments

input
  • list - AntibodyForests-object as output from Af_build()

clusters
  • named integer - The clusters as output from Af_compare_within_repertoires()

metrics
  • string - The metrics to be calculated per tree '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 'group.depth' : Mean of the number of edges connecting each node per group (node.features of the AntibodyForests-object) to the germline. (default FALSE) 'sackin.index' : Sum of the number of nodes between each terminal node and the germline, normalized by the total 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

min.nodes

The minimum number of nodes for a tree to be included in this analysis (this included the germline). This should be the same as for the Af_compare_within_repertoires() functions.

colors
  • string - Optionally specific colors for the clusters

text.size

Font size in the plot (default 20).

significance
  • boolean - If TRUE, the significance of a T test between the groups is plotted (default FALSE)

parallel

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

num.cores

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

Value

  • list - A list with boxplots per metric

Examples

plot <- Af_cluster_metrics(input = AntibodyForests::small_af,
                            clusters = AntibodyForests::compare_repertoire[["clustering"]],
                            metrics = "mean.depth",
                            min.nodes = 8)
plot$mean.depth

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