Skip to content

Commit

Permalink
Minor readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-bushuiev committed Jan 18, 2025
1 parent 695a9fe commit d64e519
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ import esm
import biotite.structure.io as bsio
from proteinttt.models.esmfold import ESMFoldTTT, DEFAULT_ESMFOLD_TTT_CFG

# Set your sequence
sequence = "GIHLGELGLLPSTVLAIGYFENLVNIICESLNMLPKLEVSGKEYKKFKFTIVIPKDLDANIKKRAKIYFKQKSLIEIEIPTSSRNYPIHIQFDENSTDDILHLYDMPTTIGGIDKAIEMFMRKGHIGKTDQQKLLEERELRNFKTTLENLIATDAFAKEMVEVIIEE"

# Load model
model = esm.pretrained.esmfold_v1()
model = model.eval().cuda()

sequence = "GIHLGELGLLPSTVLAIGYFENLVNIICESLNMLPKLEVSGKEYKKFKFTIVIPKDLDANIKKRAKIYFKQKSLIEIEIPTSSRNYPIHIQFDENSTDDILHLYDMPTTIGGIDKAIEMFMRKGHIGKTDQQKLLEERELRNFKTTLENLIATDAFAKEMVEVIIEE"

def predict_structure(model, sequence):
with torch.no_grad():
output = model.infer_pdb(sequence)
Expand All @@ -43,16 +44,15 @@ predict_structure(model, sequence)

# ================ TTT ================
ttt_cfg = DEFAULT_ESMFOLD_TTT_CFG
ttt_cfg.seed = 0 # Trying TTT with several different seeds may enable finding structure with higher pLDDT
ttt_cfg.steps = 10
ttt_cfg.steps = 10 # This is how you can modify config
model = ESMFoldTTT.ttt_from_pretrained(model, esmfold_config=model.cfg)
model.ttt(sequence)
# =====================================

predict_structure(model, sequence)
# pLDDT: 78.69619

# Rest model to original state (after this model.ttt can be called again on another protein)
# Reset model to original state (after this model.ttt can be called again on another protein)
# ================ TTT ================
model.ttt_reset()
# =====================================
Expand Down

0 comments on commit d64e519

Please sign in to comment.