Implements Jerne's idiotypic network theory for antibody repertoire regulation. Replaces crude epsilon-threshold suppression with principled network dynamics based on Varela & Coutinho's (1991) second- generation immune network model.
Details
The idiotypic network models antibody-antibody interactions where each antibody's variable region can be recognized by other antibodies. This creates a regulatory network with emergent properties:
- A bell-shaped (double-threshold) activation function: too little stimulation leads to cell death, moderate stimulation to activation, and excessive stimulation to suppression. - Population dynamics with source, decay, activation, and suppression terms. - Self-organized repertoire structure with memory and tolerance properties.
This is the single most novel contribution of the overhauled bHIVE package. No existing AIS implementation uses idiotypic network dynamics for repertoire regulation.
Public fields
theta_lowLower activation threshold. Below this, cells die.
theta_highUpper activation threshold. Above this, cells are suppressed.
source_rateRate of new cell generation (basal production).
decay_rateNatural cell death rate.
dtTime step for Euler integration.
timeStepsNumber of simulation time steps.
survival_thresholdMinimum population level to survive.
last_dynamicsResult from the last regulation step.
Methods
Method new()
Create a new IdiotypicNetwork regulator.
Usage
IdiotypicNetwork$new(
theta_low = 0.01,
theta_high = 0.5,
source_rate = 0.5,
decay_rate = 0.1,
dt = 0.1,
timeSteps = 20,
survival_threshold = 0.5
)Method regulate()
Run idiotypic network dynamics on an antibody repertoire.
Usage
IdiotypicNetwork$regulate(
repertoire,
affinityFunc = "gaussian",
affinityParams = list(alpha = 1, c = 1, p = 2)
)Arguments
repertoireAn
ImmuneRepertoireobject.affinityFuncCharacter. Affinity function for Ab-Ab interactions.
affinityParamsList. Parameters for the affinity function.
Examples
# Create and run idiotypic regulation
idi <- IdiotypicNetwork$new(theta_low = 0.01, theta_high = 0.5)
A <- matrix(rnorm(50), nrow = 10, ncol = 5)
rep <- ImmuneRepertoire$new(A)
idi$regulate(rep, "gaussian", list(alpha = 0.5))
#> Warning: Idiotypic regulation removed all antibodies. Consider adjusting thresholds (theta_low, theta_high).
print(idi)
#> <IdiotypicNetwork>
#> Activation window: [0.010, 0.500]
#> Dynamics: 20 steps (dt=0.100)
#> Source: 0.500 Decay: 0.100 Survival: 0.500
#> Last run: 0/10 antibodies survived
