ProteinMPNN:基于 PyTorch 的蛋白质序列设计项目

用户可利用该项目根据蛋白质骨架结构生成或设计氨基酸序列,支持单链/多链设计、固定特定位置、添加氨基酸偏好等功能,提供多种模型权重及示例脚本,适用于蛋白质工程研究。【此简介由AI生成】

分支1Tags2
文件最后提交记录最后更新时间
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
4 年前
4 年前
3 年前
3 年前
3 年前

ProteinMPNN

ProteinMPNN 阅读 ProteinMPNN 论文

要运行 ProteinMPNN,请克隆此 github 仓库并安装 Python>=3.0、PyTorch、Numpy。

完整蛋白质骨架模型:vanilla_model_weights/v_48_002.pt、v_48_010.pt、v_48_020.pt、v_48_030.ptsoluble_model_weights/v_48_010.pt、v_48_020.pt

仅 CA 模型:ca_model_weights/v_48_002.pt、v_48_010.pt、v_48_020.pt。使用这些模型时需启用 --ca_only 标志。

辅助脚本:helper_scripts - 用于解析 PDB 文件、指定待设计的链、待固定的残基、添加氨基酸偏好、残基关联等的辅助函数。

代码结构:

  • protein_mpnn_run.py - 初始化和运行模型的主脚本。
  • protein_mpnn_utils.py - 主脚本的实用工具函数。
  • examples/ - 简单的代码示例。
  • inputs/ - 示例的输入 PDB 文件。
  • outputs/ - 示例的输出结果。
  • colab_notebooks/ - Google Colab 示例。
  • training/ - 用于重新训练模型的代码和数据。

protein_mpnn_run.py 的输入标志:

    argparser.add_argument("--suppress_print", type=int, default=0, help="0 for False, 1 for True")
    argparser.add_argument("--ca_only", action="store_true", default=False, help="Parse CA-only structures and use CA-only models (default: false)")
    argparser.add_argument("--path_to_model_weights", type=str, default="", help="Path to model weights folder;")
    argparser.add_argument("--model_name", type=str, default="v_48_020", help="ProteinMPNN model name: v_48_002, v_48_010, v_48_020, v_48_030; v_48_010=version with 48 edges 0.10A noise")
    argparser.add_argument("--use_soluble_model", action="store_true", default=False, help="Flag to load ProteinMPNN weights trained on soluble proteins only.")
    argparser.add_argument("--seed", type=int, default=0, help="If set to 0 then a random seed will be picked;")
    argparser.add_argument("--save_score", type=int, default=0, help="0 for False, 1 for True; save score=-log_prob to npy files")
    argparser.add_argument("--path_to_fasta", type=str, default="", help="score provided input sequence in a fasta format; e.g. GGGGGG/PPPPS/WWW for chains A, B, C sorted alphabetically and separated by /")
    argparser.add_argument("--save_probs", type=int, default=0, help="0 for False, 1 for True; save MPNN predicted probabilites per position")
    argparser.add_argument("--score_only", type=int, default=0, help="0 for False, 1 for True; score input backbone-sequence pairs")
    argparser.add_argument("--conditional_probs_only", type=int, default=0, help="0 for False, 1 for True; output conditional probabilities p(s_i given the rest of the sequence and backbone)")
    argparser.add_argument("--conditional_probs_only_backbone", type=int, default=0, help="0 for False, 1 for True; if true output conditional probabilities p(s_i given backbone)")
    argparser.add_argument("--unconditional_probs_only", type=int, default=0, help="0 for False, 1 for True; output unconditional probabilities p(s_i given backbone) in one forward pass")
    argparser.add_argument("--backbone_noise", type=float, default=0.00, help="Standard deviation of Gaussian noise to add to backbone atoms")
    argparser.add_argument("--num_seq_per_target", type=int, default=1, help="Number of sequences to generate per target")
    argparser.add_argument("--batch_size", type=int, default=1, help="Batch size; can set higher for titan, quadro GPUs, reduce this if running out of GPU memory")
    argparser.add_argument("--max_length", type=int, default=200000, help="Max sequence length")
    argparser.add_argument("--sampling_temp", type=str, default="0.1", help="A string of temperatures, 0.2 0.25 0.5. Sampling temperature for amino acids. Suggested values 0.1, 0.15, 0.2, 0.25, 0.3. Higher values will lead to more diversity.")
    argparser.add_argument("--out_folder", type=str, help="Path to a folder to output sequences, e.g. /home/out/")
    argparser.add_argument("--pdb_path", type=str, default='', help="Path to a single PDB to be designed")
    argparser.add_argument("--pdb_path_chains", type=str, default='', help="Define which chains need to be designed for a single PDB ")
    argparser.add_argument("--jsonl_path", type=str, help="Path to a folder with parsed pdb into jsonl")
    argparser.add_argument("--chain_id_jsonl",type=str, default='', help="Path to a dictionary specifying which chains need to be designed and which ones are fixed, if not specied all chains will be designed.")
    argparser.add_argument("--fixed_positions_jsonl", type=str, default='', help="Path to a dictionary with fixed positions")
    argparser.add_argument("--omit_AAs", type=list, default='X', help="Specify which amino acids should be omitted in the generated sequence, e.g. 'AC' would omit alanine and cystine.")
    argparser.add_argument("--bias_AA_jsonl", type=str, default='', help="Path to a dictionary which specifies AA composion bias if neededi, e.g. {A: -1.1, F: 0.7} would make A less likely and F more likely.")
    argparser.add_argument("--bias_by_res_jsonl", default='', help="Path to dictionary with per position bias.")
    argparser.add_argument("--omit_AA_jsonl", type=str, default='', help="Path to a dictionary which specifies which amino acids need to be omited from design at specific chain indices")
    argparser.add_argument("--pssm_jsonl", type=str, default='', help="Path to a dictionary with pssm")
    argparser.add_argument("--pssm_multi", type=float, default=0.0, help="A value between [0.0, 1.0], 0.0 means do not use pssm, 1.0 ignore MPNN predictions")
    argparser.add_argument("--pssm_threshold", type=float, default=0.0, help="A value between -inf + inf to restric per position AAs")
    argparser.add_argument("--pssm_log_odds_flag", type=int, default=0, help="0 for False, 1 for True")
    argparser.add_argument("--pssm_bias_flag", type=int, default=0, help="0 for False, 1 for True")
    argparser.add_argument("--tied_positions_jsonl", type=str, default='', help="Path to a dictionary with tied positions")

例如,创建一个用于运行ProteinMPNN的conda环境:

  • conda create --name mlfold - 创建名为mlfold的conda环境
  • source activate mlfold - 激活该环境
  • conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch - 按照https://pytorch.org/上的步骤安装pytorch

以下是提供的examples/目录中的文件:

  • submit_example_1.sh - 简单的单体示例
  • submit_example_2.sh - 简单的多链示例
  • submit_example_3.sh - 直接从.pdb路径运行
  • submit_example_3_score_only.sh - 仅返回分数(模型的不确定性)
  • submit_example_3_score_only_from_fasta.sh - 从fasta文件加载序列,仅返回分数(模型的不确定性)
  • submit_example_4.sh - 固定某些残基位置
  • submit_example_4_non_fixed.sh - 指定要设计的位置
  • submit_example_5.sh - 将某些位置关联在一起(对称性)
  • submit_example_6.sh - 同源寡聚体示例
  • submit_example_7.sh - 返回序列的无条件概率(类似PSSM)
  • submit_example_8.sh - 添加氨基酸偏好
  • submit_example_pssm.sh - 设计序列时使用PSSM偏好

输出示例:

>3HTN, score=1.1705, global_score=1.2045, fixed_chains=['B'], designed_chains=['A', 'C'], model_name=v_48_020, git_hash=015ff820b9b5741ead6ba6795258f35a9c15e94b, seed=37
NMYSYKKIGNKYIVSINNHTEIVKALNAFCKEKGILSGSINGIGAIGELTLRFFNPKTKAYDDKTFREQMEISNLTGNISSMNEQVYLHLHITVGRSDYSALAGHLLSAIQNGAGEFVVEDYSERISRTYNPDLGLNIYDFER/NMYSYKKIGNKYIVSINNHTEIVKALNAFCKEKGILSGSINGIGAIGELTLRFFNPKTKAYDDKTFREQMEISNLTGNISSMNEQVYLHLHITVGRSDYSALAGHLLSAIQNGAGEFVVEDYSERISRTYNPDLGLNIYDFER
>T=0.1, sample=1, score=0.7291, global_score=0.9330, seq_recovery=0.5736
NMYSYKKIGNKYIVSINNHTEIVKALKKFCEEKNIKSGSVNGIGSIGSVTLKFYNLETKEEELKTFNANFEISNLTGFISMHDNKVFLDLHITIGDENFSALAGHLVSAVVNGTCELIVEDFNELVSTKYNEELGLWLLDFEK/NMYSYKKIGNKYIVSINNHTDIVTAIKKFCEDKKIKSGTINGIGQVKEVTLEFRNFETGEKEEKTFKKQFTISNLTGFISTKDGKVFLDLHITFGDENFSALAGHLISAIVDGKCELIIEDYNEEINVKYNEELGLYLLDFNK
>T=0.1, sample=2, score=0.7414, global_score=0.9355, seq_recovery=0.6075
NMYKYKKIGNKYIVSINNHTEIVKAIKEFCKEKNIKSGTINGIGQVGKVTLRFYNPETKEYTEKTFNDNFEISNLTGFISTYKNEVFLHLHITFGKSDFSALAGHLLSAIVNGICELIVEDFKENLSMKYDEKTGLYLLDFEK/NMYKYKKIGNKYVVSINNHTEIVEALKAFCEDKKIKSGTVNGIGQVSKVTLKFFNIETKESKEKTFNKNFEISNLTGFISEINGEVFLHLHITIGDENFSALAGHLLSAVVNGEAILIVEDYKEKVNRKYNEELGLNLLDFNL
  • score - 在设计的残基上取平均值,即采样氨基酸的负对数概率
  • global score - 在所有链的所有残基上取平均值,即采样/固定氨基酸的负对数概率
  • fixed_chains - 未被设计的链(固定链)
  • designed_chains - 被重新设计的链
  • model_name/CA_model_name - 用于生成结果的模型名称,例如 v_48_020
  • git_hash - 用于生成输出的 github 版本
  • seed - 随机种子
  • T=0.1 - 用于采样序列的温度设为 0.1
  • sample - 序列采样编号 1、2、3……等

@article{dauparas2022robust,
  title={Robust deep learning--based protein sequence design using ProteinMPNN},
  author={Dauparas, Justas and Anishchenko, Ivan and Bennett, Nathaniel and Bai, Hua and Ragotte, Robert J and Milles, Lukas F and Wicky, Basile IM and Courbet, Alexis and de Haas, Rob J and Bethel, Neville and others},
  journal={Science},
  volume={378},
  number={6615},  
  pages={49--56},
  year={2022},
  publisher={American Association for the Advancement of Science}
}

项目介绍

用户可利用该项目根据蛋白质骨架结构生成或设计氨基酸序列,支持单链/多链设计、固定特定位置、添加氨基酸偏好等功能,提供多种模型权重及示例脚本,适用于蛋白质工程研究。【此简介由AI生成】

定制我的领域