Editing
Protein Engineering
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Zero-shot protein variant prediction with ESM-2:''' <syntaxhighlight lang="python"> import torch from transformers import EsmTokenizer, EsmForMaskedLM import numpy as np from itertools import product tokenizer = EsmTokenizer.from_pretrained("facebook/esm2_t33_650M_UR50D") model = EsmForMaskedLM.from_pretrained("facebook/esm2_t33_650M_UR50D") model.eval() AMINO_ACIDS = "ACDEFGHIKLMNPQRSTVWY" def compute_variant_scores(wild_type_seq: str) -> dict: """ Compute zero-shot fitness scores for all single-site mutants. Uses ESM-2 masked marginal log-likelihood. """ encoded = tokenizer(wild_type_seq, return_tensors='pt') N = len(wild_type_seq) scores = {} with torch.no_grad(): # Get wild-type log-likelihoods at each position for pos in range(N): masked_input = encoded['input_ids'].clone() masked_input[0, pos + 1] = tokenizer.mask_token_id # +1 for [CLS] output = model(input_ids=masked_input, attention_mask=encoded['attention_mask']) log_probs = torch.log_softmax(output.logits[0, pos + 1], dim=-1) wt_aa = wild_type_seq[pos] wt_score = log_probs[tokenizer.convert_tokens_to_ids(wt_aa)].item() for mut_aa in AMINO_ACIDS: if mut_aa == wt_aa: continue mut_score = log_probs[tokenizer.convert_tokens_to_ids(mut_aa)].item() delta_llr = mut_score - wt_score # Positive = preferred over WT scores[f"{wt_aa}{pos+1}{mut_aa}"] = delta_llr return scores # Rank mutations by predicted fitness improvement scores = compute_variant_scores("MKTAYIAKQRQISFVK...") top_mutations = sorted(scores.items(), key=lambda x: x[1], reverse=True)[:20] print("Top predicted beneficial mutations:") for variant, score in top_mutations: print(f" {variant}: {score:.3f}") # Combinatorial design: combine top singles via in silico directed evolution # 1. Select top 5 single mutants # 2. Generate all pairwise combinations # 3. Score each combination # 4. Prioritize top combinations for experimental validation </syntaxhighlight> ; Protein engineering AI tools : '''Variant prediction (zero-shot)''' β ESM-2 (Meta), EVE, ProteinGym benchmark : '''Inverse folding (sequence design)''' β ProteinMPNN, LigandMPNN, ESM-IF : '''De novo backbone design''' β RFDiffusion, Chroma (Generate Biomedicines), FrameDiff : '''Antibody engineering''' β AntiFold, AbMap, IgLM, Absolut : '''Structure-based design''' β PyRosetta, Boltz-1, AlphaFold3 + design </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information