The DNA sequence generation function of Evo 2 is simple but powerful, as described below:
Operational Processes:
- Loading Models::
from evo2 import Evo2
model = Evo2('evo2_7b') # 使用7B参数模型 - Enter prompts and generate::
prompt = ["ACGT"] # 初始DNA序列
output = model.generate(prompt_seqs=prompt, n_tokens=400, temperature=1.0, top_k=4)
print(output.sequences[0]) # 输出400个核苷酸序列
Parameter Description:
n_tokens: control the length of the generated sequencetemperature: Control of randomness (recommended 0.8-1.2)top_k: Limit the sampling range to optimize the quality of results
The generated sequences can be used directly for downstream bioanalysis or as a starting point for further design.
This answer comes from the articleEvo2: An Open Source BioAI Tool to Support Genome Modeling and DesignThe































