liveBook · Manning

Variable region

As explained in Build AI Drug Discovery Pipelines

A variable region is the sequence-diverse portion of an antibody that determines much of its antigen-binding specificity.

A variable region is the sequence-diverse portion of an antibody that determines much of its antigen-binding specificity. It physically docks onto an antigen, such as a viral spike protein. section 12.3.4

For computational screening, analyze the antibody heavy-chain sequence containing the variable region and classify its likely viral target. Sequence patterns can distinguish antibodies targeting HIV-1 from those targeting SARS-CoV-2. section 12.3.4

Listing 12.3 Transformer-based Classifier for Antibody Sequences
class AntibodyClassifier(nn.Module):
    def __init__(
        self, vocab_size, padding_idx, embedding_dim,
        num_layers, num_heads, ffn_dim, dropout, num_classes,
    ):
        super().__init__()
 
        self.embedding = nn.Embedding(    #A
            vocab_size, embedding_dim, padding_idx
        )
        self.pe = PositionalEncoding(embedding_dim)
        self.encoder = Encoder(
            num_layers=num_layers,
            embedding_dim=embedding_dim,
            num_heads=num_heads,
            ffn_dim=ffn_dim,
            dropout=dropout,
        )
 
        self.classifier = nn.Sequential(    #B
            nn.Linear(embedding_dim, embedding_dim),
            nn.LayerNorm(embedding_dim),
            nn.LeakyReLU(),
            nn.Linear(embedding_dim, num_classes),
        )
 
    def forward(self, batch):
        input_ids = batch["input_ids"]
        attention_mask = batch["attention_mask"]
 
        x = self.embedding(input_ids)
        x = self.pe(x)    #C
        x = self.encoder(x, attention_mask)
 
        x = self.mean_pooling(x, attention_mask)    #D
        logits = self.classifier(x)    #E
        return logits

A Transformer classifier converts antibody sequences into representations and predicts their target class, providing a practical sequence-level use of variable-region information. section 12.3.4

How Build AI Drug Discovery Pipelines covers it

How deep it goes
Explains antigen docking and sequence-based specificity, then stops short of detailed molecular binding mechanics.
Examples
Uses HIV-1- and SARS-CoV-2-targeting antibodies and viral spike proteins as concrete examples.
What it assumes
Defines antibodies, antigens, and amino-acid sequences before applying heavy-chain sequence classification.
What you can do after
Evaluate antibody sequences by ranking whether they target HIV-1 or SARS-CoV-2.
How it connects
Connects variable regions with antibodies, antigens, antibody heavy chains, protein language models, and supervised classification.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI Drug Discovery Pipelines. The section links point to the parts of the book it draws on.