Two-signal activation gate implementing the immunological principle that immune cell activation requires both antigen-specific recognition (Signal 1) AND costimulatory context (Signal 2).
Value
An R6Class generator. ActivationGate$new()
returns an ActivationGate object.
Details
Prevents spurious activation on isolated outliers. An antibody is only allowed to clone if both signals exceed their thresholds. This is biologically-principled regularization.
Signal 2 options:
"density": Local data density around the antibody"danger": User-provided danger signal vector"entropy": Local label entropy (classification only)
Public fields
signal2_typeType of costimulatory signal.
threshold1Minimum affinity for Signal 1 (antigen recognition).
threshold2Minimum costimulatory signal for Signal 2.
danger_signalsUser-provided danger signal vector (for "danger" type).
Methods
Method new()
Create a new ActivationGate.
Usage
ActivationGate$new(
signal2_type = "density",
threshold1 = 0.1,
threshold2 = 0.3,
danger_signals = NULL
)Method evaluate()
Evaluate which antibody-data interactions pass the two-signal gate.
Examples
# Two-signal activation gate
data(iris)
X <- as.matrix(iris[, 1:4])
A <- X[sample(150, 10), ]
rep <- ImmuneRepertoire$new(A)
gate <- ActivationGate$new(signal2_type = "density", threshold2 = 0.3)
aff <- rep$affinity_matrix(X, "gaussian")
activated <- gate$evaluate(aff, X, A)
sum(activated) # number of activated interactions
#> [1] 469
