Af_cluster_node_features: Function to create a barplot of the cluster composition of...

View source: R/Af_cluster_node_features.R

Af_cluster_node_featuresR Documentation

Function to create a barplot of the cluster composition of selected features from each tree in an AntibodyForests-object

Description

Function to create a barplot of the cluster composition of selected features from each tree in an AntibodyForests-object

Usage

Af_cluster_node_features(
  input,
  features,
  clusters,
  fill,
  colors,
  text.size,
  significance
)

Arguments

input

AntibodyForests-object(s), output from Af_build()

features

Character vector of features to include in the barplot. (these features need to be present in the nodes of the trees)

clusters

Named vector with the cluster assignments of the trees, output from Af_compare_within_repertoires().

fill

identify each unique feature per tree (unique, default), or assign the most observed feature to the tree (max)

colors

Color palette to use for the features.

text.size

Size of the text in the plot. Default is 12.

significance

Logical, whether to add Chi-squared Test p-value to the plot. Default is FALSE.

Value

A list with barplots for each provided feature.

Examples

plot <- Af_cluster_node_features(input = AntibodyForests::small_af,
                                 clusters = AntibodyForests::compare_repertoire[["clustering"]],
                                 features = "isotype",
                                 fill = "max")
plot$isotype

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