ProGen2 API¶
ProGen2, with models up to 6.4B parameters, is adept at generating viable protein sequences and predicting their fitness. It's utilized in protein design, trained on data from genomic and metagenomic sources.
API Call with Python requests¶
We need to make sure we have the Python requests module loaded first.
import time
from biolmai import BioLM
from IPython.display import JSON # Helpful UI for JSON displayProGen2 Medium¶
data = {
"params": {
"temperature": 0.1, # Temperature
"top_p": 0.6, # Nucleus sampling probability
"num_samples": 2, # Number of proteins to generate
"max_length": 175 # Max length of generated proteins
},
"items": [
{
"context": "MA" # Starting amino acid(s) for protein
}
]
}
result = BioLM(entity="progen2-medium", action="generate", items=data["items"], params=data["params"])
resultWe can view this a bit more easily below:
JSON(result)ProGen2 OAS¶
data = {
"params": {
"temperature": 0.7, # Temperature
"top_p": 0.6, # Nucleus sampling probability
"num_samples": 2, # Number of proteins to generate
"max_length": 175 # Max length of generated proteins
},
"items": [
{
"context": "EVQ" # Starting amino acids for Antibody
}
]
}
result = BioLM(entity="progen2-oas", action="generate", items=data["items"], params=data["params"])
resultJSON(result)ProGen2 BFD90¶
data = {
"params": {
"temperature": 0.7, # Temperature
"top_p": 0.6, # Nucleus sampling probability
"num_samples": 2, # Number of proteins to generate
"max_length": 175 # Max length of generated proteins
},
"items": [
{
"context": "M" # Starting amino acid(s) for protein
}
]
}
result = BioLM(entity="progen2-bfd90", action="generate", items=data["items"], params=data["params"])
resultJSON(result)Next Steps¶
Check out additional tutorials at jupyter.biolm.ai, or head over to our BioLM Documentation to explore additional models and functionality.
See more use-cases and APIs on your BioLM Console Catalog.¶
BioLM hosts deep learning models and runs inference at scale. You do the science.¶
Contact us to learn more.¶
<span></span>
