VenusREM
Model Introduction
VenusREM is a zero-shot model for protein mutation effect prediction. It builds on sequence-structure language model logits from ProSST and incorporates evolutionary information derived from homologous sequence alignments. Candidate mutation fitness scores are calculated through retrieval-based logits fusion.
VenusREM can score both single substitutions and mutations containing multiple amino acid substitutions.
The output score represents the model's relative preference for a candidate mutation compared with the wild-type sequence. It should not be interpreted as an experimental measurement with a universal physical unit.
Model Description
VenusREM uses ProSST-2048 as its base model:
- Represents the primary structure of a protein using its amino acid sequence;
- Quantizes the local three-dimensional environment of each residue into one of 2048 structural tokens;
- Jointly models sequence and structural information to generate amino acid logits at each residue position;
- Estimates evolutionary distributions from homologous sequence alignments in A2M, A3M, or FASTA format;
- Uses the
alphaparameter to fuse language-model logits with retrieved evolutionary logits; - Calculates mutation scores from the log-probability difference between the mutant and wild-type amino acids.
Use Cases
| Use Case | Description |
|---|---|
| Zero-shot mutation ranking | Rank candidate amino acid substitutions without target-protein-specific supervised labels. |
| ProteinGym evaluation | Generate per-protein mutation scores and summarize Spearman correlations on ProteinGym substitution datasets. |
| MSA-enhanced prediction | Integrate evolutionary information from homologous sequence alignments to improve context-aware mutation scoring. |
| ProSST baseline prediction | Set alpha=0 to use only sequence-structure language model logits. |
| Structural token generation | Optionally generate ProSST structural tokens when only PDB structures are available. |
Usage
1. OneCode
You can use the OneCode online environment for an intelligent one-click AI4S programming experience:
Try OneCode for AI4S Programming
2. Manual Installation
Hardware Requirements
- Supports both CPU and DCU execution in the OneScience DTK environment;
- DCU is recommended for full ProteinGym inference and PDB-to-structural-token preprocessing;
- CPU execution can be used for basic validation, but full-dataset inference and structural preprocessing are significantly slower.
Download the Model Package
Install the Hugging Face command-line tool and download the model repository:
python -m pip install -U huggingface_hub
hf download OneScience-Group/VenusREM --local-dir ./VenusREM
cd VenusREM
Install the Runtime Environment
DCU Environment
conda create -n onescience311 python=3.11 -y
conda activate onescience311
python -m pip install "onescience[bio-dcu]" \
-i http://mirrors.onescience.ai:3141/pypi/simple/ \
--trusted-host mirrors.onescience.ai
Install the additional VenusREM dependencies on top of the OneScience base environment:
python -m pip install --no-deps -r requirements.txt
Weights and Data Preparation
The official ProSST-2048 assets required for inference are located at:
| Asset | Relative Path | Purpose |
|---|---|---|
| Model weights | weight/ProSST-2048/model.safetensors |
ProSST-2048 parameters |
| Model configuration | weight/ProSST-2048/config.json |
Network architecture and vocabulary configuration |
| Model implementation | weight/ProSST-2048/modeling_prosst.py |
Custom Transformers model implementation |
| Configuration implementation | weight/ProSST-2048/configuration_prosst.py |
Custom Transformers configuration implementation |
| Amino acid vocabulary | weight/ProSST-2048/vocab.txt |
Sequence tokenization |
| Tokenizer configuration | weight/ProSST-2048/tokenizer_config.json |
Tokenizer parameters |
Inference datasets use the following relative directory structure:
conf/data/<dataset_name>/
├── aa_seq/
│ └── protein1.fasta
├── aa_seq_aln_a2m/
│ └── protein1.a2m
├── struc_seq/
│ └── 2048/
│ └── protein1.fasta
└── substitutions/
└── protein1.csv
The base filenames must match across the corresponding files. For example:
protein1.fasta
protein1.a2m
protein1.csv
must all refer to the same protein.
Each file under substitutions/*.csv must contain at least:
mutant: mutation notation such asA10V; multiple substitutions are separated by colons, for exampleA10V:G25D;DMS_score: experimental score used to calculate Spearman correlation during evaluation. If no experimental label is available, this field can be set to0, but the resulting correlation metric will not have evaluation significance.
Structural tokens are part of the required base-model input.
Even when alpha=0 is used to disable MSA-based retrieval enhancement, the following structural-token files are still required:
struc_seq/2048/*.fasta
Quick Inference
Purpose: Fuse ProSST-2048 sequence-structure logits with evolutionary information from residue-sequence MSAs.
This mode is suitable for full ProteinGym evaluation and formal mutation ranking when precomputed A2M/A3M alignments are available.
Run VenusREM inference on DCU using the ProSST-2048 weights and precomputed residue-sequence MSA:
export HIP_VISIBLE_DEVICES=0
export CUDA_VISIBLE_DEVICES=0
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name VenusREM_DCU \
--base_dir conf/data/proteingym_v1 \
--out_scores_dir output/proteingym_v1 \
--logit_mode aa_seq_aln \
--alpha 0.8
The output structure is:
output/proteingym_v1/
├── scores/
│ └── <protein_name>.csv
└── summary_performance.csv
Each per-protein CSV file contains an additional VenusREM_DCU score column.
summary_performance.csv records the Spearman correlation for each protein dataset.
ProSST Inference Without MSA
Purpose: Run the ProSST-2048 baseline without retrieval enhancement.
This mode can be used to:
- Compare mutation scores before and after MSA fusion;
- Perform ablation analysis;
- Run basic sequence-structure mutation scoring when homologous sequence alignments are unavailable.
Set alpha=0 to disable residue-sequence and structural-alignment logit fusion.
Amino acid sequences, structural tokens, and substitution files are still required:
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name ProSST-2048 \
--base_dir conf/data/proteingym_v1 \
--out_scores_dir output/prosst_2048 \
--alpha 0
Structural Sequence Alignment
Purpose: Use structural homolog information generated by Foldseek to enhance ProSST logits.
This mode is suitable when structural-alignment results have already been prepared and can be used to evaluate the contribution of structure-based retrieval or compare it with residue-sequence MSA retrieval.
If Foldseek structural-sequence alignments are available, run:
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name VenusREM_struc \
--base_dir conf/data/proteingym_v1 \
--out_scores_dir output/proteingym_v1_struc \
--logit_mode struc_seq_aln \
--alpha 0.8
The corresponding alignment files should be located at:
conf/data/proteingym_v1/struc_seq_aln_foldseek/<protein_name>.fasta
Convert PDB Structures to Structural Tokens
Purpose: Quantize the local three-dimensional environment of each residue in a protein PDB structure into structural tokens that can be processed by ProSST-2048.
The generated structural tokens are required inputs for the inference modes described above. This preprocessing step does not directly generate mutation fitness scores.
Run this step only when PDB structures are available but precomputed files under:
struc_seq/2048/*.fasta
are not available.
If official precomputed structural tokens are already provided, this step can be skipped.
For a single PDB file:
python model/data/get_struc_seq.py \
--pdb_file conf/data/proteingym_v1/pdbs/protein1.pdb \
--output_dir conf/data/proteingym_v1/struc_seq \
--vocab_size 2048 \
--overwrite
For multiple PDB files:
python model/data/get_struc_seq.py \
--pdb_dir conf/data/proteingym_v1/pdbs \
--output_dir conf/data/proteingym_v1/struc_seq \
--vocab_size 2048 \
--overwrite
Custom Data Inference
Purpose: Perform zero-shot fitness scoring for user-provided proteins and candidate mutations.
This workflow can be used for:
- Candidate prioritization before wet-lab experiments;
- Initial screening in protein engineering;
- Evaluation on custom mutation datasets.
Filenames must remain consistent across the amino acid sequence, MSA, structural-token, and substitution directories.
Create a relative directory structure such as:
conf/data/my_proteins/
├── aa_seq/
├── aa_seq_aln_a2m/
├── struc_seq/2048/
└── substitutions/
Then run:
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name VenusREM \
--base_dir conf/data/my_proteins \
--out_scores_dir output/my_proteins \
--logit_mode aa_seq_aln \
--alpha 0.8
If no substitution file is available, the provided helper script can be used to generate all possible single-amino-acid substitutions before further filtering:
python model/data/get_sav.py \
--fasta_file conf/data/my_proteins/aa_seq/protein1.fasta \
--output_csv conf/data/my_proteins/substitutions/protein1.csv
Training
The official VenusREM repository does not provide a directly executable training entry point, Dataset implementation, optimizer configuration, or complete training loop.
Therefore, this Hugging Face model package does not provide training scripts.
OneScience Official Resources
| Platform | OneScience Main Repository | Skills Repository |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
Citation and License
- VenusREM paper: From high-throughput evaluation to wet-lab studies: advancing mutation effect prediction with a retrieval-enhanced model
- Official implementation: https://github.com/ai4protein/VenusREM
- Base model: https://github.com/ai4protein/ProSST
- This project is provided under the
CC-BY-NC-ND-4.0license. - Model weights, source code, datasets, and third-party assets remain subject to their respective original licenses, copyright notices, and terms of use.
中文说明
模型简介
VenusREM 是一个用于蛋白质突变效应预测的零样本模型。它基于 ProSST 的序列-结构语言模型 logits 构建,并融合了从同源序列比对中提取的进化信息。候选突变的适应度分数通过基于检索的 logits 融合计算得到。
VenusREM 既可以对单点替换打分,也可以对包含多个氨基酸替换的突变打分。
输出分数表示模型对候选突变相对于野生型序列的相对偏好程度,不应被解读为具有通用物理单位的实验测量值。
模型描述
VenusREM 以 ProSST-2048 作为基础模型:
- 使用氨基酸序列表示蛋白质的一级结构;
- 将每个残基的局部三维环境量化为 2048 个结构 token 之一;
- 联合建模序列与结构信息,在每个残基位置生成氨基酸 logits;
- 从 A2M、A3M 或 FASTA 格式的同源序列比对中估计进化分布;
- 使用
alpha参数将语言模型 logits 与检索得到的进化 logits 融合; - 根据突变氨基酸与野生型氨基酸的对数概率差计算突变分数。
适用场景
| 适用场景 | 描述 |
|---|---|
| 零样本突变排序 | 在没有针对目标蛋白的有监督标签的情况下对候选氨基酸替换进行排序。 |
| ProteinGym 评测 | 生成每个蛋白的突变分数,并汇总 ProteinGym 替换数据集上的 Spearman 相关系数。 |
| MSA 增强预测 | 融合来自同源序列比对的进化信息,提升具备上下文感知能力的突变打分效果。 |
| ProSST 基线预测 | 设置 alpha=0,仅使用序列-结构语言模型 logits。 |
| 结构 token 生成 | 在仅有 PDB 结构时,可选地生成 ProSST 结构 token。 |
使用方法
1. OneCode
您可以使用 OneCode 在线环境,体验智能一键式 AI4S 编程:
2. 手动安装
硬件要求
- 在 OneScience DTK 环境中同时支持 CPU 与 DCU 运行;
- 推荐使用 DCU 进行完整的 ProteinGym 推理(inference)以及 PDB 到结构 token 的预处理;
- CPU 运行可用于基础验证,但全数据集推理和结构预处理会明显更慢。
下载模型包
安装 Hugging Face 命令行工具并下载模型仓库:
python -m pip install -U huggingface_hub
hf download OneScience-Group/VenusREM --local-dir ./VenusREM
cd VenusREM
安装运行环境
DCU 环境
conda create -n onescience311 python=3.11 -y
conda activate onescience311
python -m pip install "onescience[bio-dcu]" \
-i http://mirrors.onescience.ai:3141/pypi/simple/ \
--trusted-host mirrors.onescience.ai
在 OneScience 基础环境之上安装 VenusREM 的额外依赖:
python -m pip install --no-deps -r requirements.txt
权重与数据准备
推理所需的 ProSST-2048 官方资源位于:
| 资源 | 相对路径 | 用途 |
|---|---|---|
| 模型权重 | weight/ProSST-2048/model.safetensors |
ProSST-2048 参数 |
| 模型配置 | weight/ProSST-2048/config.json |
网络结构与词表配置 |
| 模型实现 | weight/ProSST-2048/modeling_prosst.py |
自定义 Transformers 模型实现 |
| 配置实现 | weight/ProSST-2048/configuration_prosst.py |
自定义 Transformers 配置实现 |
| 氨基酸词表 | weight/ProSST-2048/vocab.txt |
序列分词 |
| 分词器配置 | weight/ProSST-2048/tokenizer_config.json |
分词器参数 |
推理数据集使用如下的相对目录结构:
conf/data/<dataset_name>/
├── aa_seq/
│ └── protein1.fasta
├── aa_seq_aln_a2m/
│ └── protein1.a2m
├── struc_seq/
│ └── 2048/
│ └── protein1.fasta
└── substitutions/
└── protein1.csv
相互对应的文件之间,基础文件名必须一致。例如:
protein1.fasta
protein1.a2m
protein1.csv
必须全部指向同一个蛋白质。
substitutions/*.csv 下的每个文件至少必须包含:
mutant:突变表示法,例如A10V;多个替换之间用冒号分隔,例如A10V:G25D;DMS_score:评测时用于计算 Spearman 相关系数的实验分数。如果没有实验标签,该字段可以设为0,但得到的相关性指标将不具备评测意义。
结构 token 是基础模型必需的输入之一。
即使使用 alpha=0 关闭基于 MSA 的检索增强,仍然需要以下结构 token 文件:
struc_seq/2048/*.fasta
快速推理
目的: 将 ProSST-2048 的序列-结构 logits 与来自残基序列 MSA 的进化信息融合。
当已有预计算的 A2M/A3M 比对文件时,该模式适用于完整的 ProteinGym 评测和正式的突变排序。
在 DCU 上使用 ProSST-2048 权重和预计算的残基序列 MSA 运行 VenusREM 推理:
export HIP_VISIBLE_DEVICES=0
export CUDA_VISIBLE_DEVICES=0
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name VenusREM_DCU \
--base_dir conf/data/proteingym_v1 \
--out_scores_dir output/proteingym_v1 \
--logit_mode aa_seq_aln \
--alpha 0.8
输出结构为:
output/proteingym_v1/
├── scores/
│ └── <protein_name>.csv
└── summary_performance.csv
每个蛋白对应的 CSV 文件会增加一列 VenusREM_DCU 分数。
summary_performance.csv 记录每个蛋白数据集的 Spearman 相关系数。
不使用 MSA 的 ProSST 推理
目的: 在不做检索增强的情况下运行 ProSST-2048 基线。
该模式可用于:
- 对比 MSA 融合前后的突变分数;
- 进行消融分析;
- 在缺少同源序列比对时,运行基础的序列-结构突变打分。
设置 alpha=0 即可关闭残基序列与结构比对的 logits 融合。
氨基酸序列、结构 token 和替换文件仍然是必需的:
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name ProSST-2048 \
--base_dir conf/data/proteingym_v1 \
--out_scores_dir output/prosst_2048 \
--alpha 0
结构序列比对
目的: 使用 Foldseek 生成的结构同源信息来增强 ProSST logits。
当结构比对结果已经准备好时,该模式适用于评估基于结构的检索的贡献,或将其与残基序列 MSA 检索进行对比。
如果已有 Foldseek 结构序列比对结果,运行:
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name VenusREM_struc \
--base_dir conf/data/proteingym_v1 \
--out_scores_dir output/proteingym_v1_struc \
--logit_mode struc_seq_aln \
--alpha 0.8
对应的比对文件应位于:
conf/data/proteingym_v1/struc_seq_aln_foldseek/<protein_name>.fasta
将 PDB 结构转换为结构 token
目的: 将蛋白质 PDB 结构中每个残基的局部三维环境量化为 ProSST-2048 可处理的结构 token。
生成的结构 token 是上述各推理模式的必需输入。该预处理步骤本身并不直接生成突变适应度分数。
仅当有 PDB 结构但缺少以下路径下的预计算文件时,才需要运行此步骤:
struc_seq/2048/*.fasta
如果官方已经提供了预计算的结构 token,则可以跳过该步骤。
对于单个 PDB 文件:
python model/data/get_struc_seq.py \
--pdb_file conf/data/proteingym_v1/pdbs/protein1.pdb \
--output_dir conf/data/proteingym_v1/struc_seq \
--vocab_size 2048 \
--overwrite
对于多个 PDB 文件:
python model/data/get_struc_seq.py \
--pdb_dir conf/data/proteingym_v1/pdbs \
--output_dir conf/data/proteingym_v1/struc_seq \
--vocab_size 2048 \
--overwrite
自定义数据推理
目的: 对用户自行提供的蛋白质和候选突变进行零样本适应度打分。
该工作流可用于:
- 湿实验前的候选优先级排序;
- 蛋白质工程中的初步筛选;
- 在自定义突变数据集上进行评测。
氨基酸序列、MSA、结构 token 与替换文件各目录之间,文件名必须保持一致。
创建如下的相对目录结构:
conf/data/my_proteins/
├── aa_seq/
├── aa_seq_aln_a2m/
├── struc_seq/2048/
└── substitutions/
然后运行:
python scripts/compute_fitness.py \
--model_name weight/ProSST-2048 \
--model_out_name VenusREM \
--base_dir conf/data/my_proteins \
--out_scores_dir output/my_proteins \
--logit_mode aa_seq_aln \
--alpha 0.8
如果没有现成的替换文件,可以使用所提供的辅助脚本生成所有可能的单氨基酸替换,再做进一步筛选:
python model/data/get_sav.py \
--fasta_file conf/data/my_proteins/aa_seq/protein1.fasta \
--output_csv conf/data/my_proteins/substitutions/protein1.csv
训练
VenusREM 官方仓库并未提供可直接执行的训练入口、Dataset 实现、优化器配置或完整的训练循环。
因此,本 Hugging Face 模型包不提供训练脚本。
OneScience 官方资源
| 平台 | OneScience 主仓库 | Skills 仓库 |
|---|---|---|
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |
引用与许可
- VenusREM 论文:From high-throughput evaluation to wet-lab studies: advancing mutation effect prediction with a retrieval-enhanced model
- 官方实现:https://github.com/ai4protein/VenusREM
- 基础模型:https://github.com/ai4protein/ProSST
- 本项目基于
CC-BY-NC-ND-4.0许可证提供。 - 模型权重、源代码、数据集及第三方资源仍然受其各自原始许可证、版权声明和使用条款的约束。
- Downloads last month
- 8