Models T follicular helper (Tfh) cell selection pressure on B cells within a germinal center reaction. Implements resource competition where antibodies compete for Tfh help, and only helped antibodies survive.
Details
The germinal center is where B cells undergo affinity maturation through iterative cycles of mutation and selection. Tfh cells act as quality-control selectors:
Each Tfh evaluates B cell (antibody) quality using a task-aware metric
B cells compete for Tfh help (resource competition)
Only helped B cells survive to the next round
Selection pressure controls the stringency of the process
Public fields
nTfhNumber of Tfh selectors (determines how many antibodies survive).
selectionPressureNumeric [0,1]. 0 = no selection (all survive), 1 = only the very best survive.
roundsNumber of selection rounds per call.
Methods
Method new()
Create a new GerminalCenter.
Usage
GerminalCenter$new(nTfh = 10, selectionPressure = 0.5, rounds = 1)Method select()
Run germinal center selection on a repertoire.
Usage
GerminalCenter$select(
repertoire,
X,
y = NULL,
task = "clustering",
affinityFunc = "gaussian",
affinityParams = list(alpha = 1, c = 1, p = 2)
)Arguments
repertoireAn
ImmuneRepertoireobject.XNumeric matrix of training data.
yTarget vector (factor or numeric) or NULL for clustering.
taskCharacter: "clustering", "classification", or "regression".
affinityFuncCharacter. Affinity function for evaluation.
affinityParamsList. Parameters for affinity function.
Examples
# Germinal center selection on Iris
data(iris)
X <- as.matrix(iris[, 1:4])
gc <- GerminalCenter$new(nTfh = 5, selectionPressure = 0.5)
rep <- ImmuneRepertoire$new(X[sample(150, 20), ])
gc$select(rep, X, iris$Species, "classification")
rep$size() # fewer antibodies after selection
#> [1] 12
