Implements antibody isotype/class switching, allowing antibodies to change their matching breadth. Inspired by real B cell class switching from IgM (broad, pentameric) to IgG (specific, monomeric) to IgA (mucosal).
Details
In bHIVE, class switching modifies the effective affinity kernel width:
IgM: Broad matching (large kernel width) – good for initial exploration and capturing general patternsIgG: Specific matching (small kernel width) – good for fine-grained discrimination after patterns are identifiedIgA: Boundary patrol (medium kernel width) – good for maintaining coverage at decision boundaries
Public fields
alpha_IgMKernel width for IgM mode (broad).
alpha_IgGKernel width for IgG mode (specific).
alpha_IgAKernel width for IgA mode (boundary).
Methods
Method new()
Create a new ClassSwitcher.
Usage
ClassSwitcher$new(alpha_IgM = 0.1, alpha_IgG = 5, alpha_IgA = 1)Method switch_isotypes()
Determine appropriate isotype for each antibody based on its microenvironment zone.
Arguments
repertoireAn
ImmuneRepertoire.zonesCharacter vector from Microenvironment assessment.
Examples
# Switch antibody isotypes based on microenvironment zones
A <- matrix(rnorm(50), nrow = 10, ncol = 5)
rep <- ImmuneRepertoire$new(A)
cs <- ClassSwitcher$new(alpha_IgM = 0.1, alpha_IgG = 5.0)
zones <- sample(c("stable", "explore", "boundary"), 10, replace = TRUE)
alphas <- cs$switch_isotypes(rep, zones)
table(rep$metadata$isotype) # IgM, IgG, IgA distribution
#>
#> IgA IgG IgM
#> 1 3 6
