当前位置: 首页 > news >正文

AF3 process_final函数解读

AlphaFold3 feature_processing_multimer模块的 process_final 函数是 数据处理管道 中的最终步骤,它在合并和配对处理之后对 np_example(一个包含特征的字典)进行一系列后处理操作。这些步骤旨在确保所有特征符合 AlphaFold3 训练和预测所需的格式,并为模型的输入做好准备。

process_final 的主要任务是:

  • 调用一系列函数对 np_example 进行处理。
  • 最终输出经过后处理的 np_example,它包含了适合模型输入的特征。

源代码:


def process_final(
        np_example: Mapping[str, np.ndarray]
) -> Mapping[str, np.ndarray]:
    """Final processing steps in data pipeline, after merging and pairing."""
    np_example = _correct_msa_restypes(np_example)
    np_example = _make_seq_mask(np_example)
    np_example = _make_msa_mask(np_example)
    np_example = _filter_features(np_example)

    return np_example

def _correct_msa_restypes(np_example):
    """Correct MSA restype to have the same order as residue_constants."""
    new_order_list = residue_constants.MAP_HHBLITS_AATYPE_TO_OUR_AATYPE
    np_example['msa'] = np.take(new_order_list, np_example['msa'], axis=0)
    np_example['msa'] = np_example['msa'].astype(np.int32)
    return np_example

def _make_seq_mask(np_example):
    np_example['seq_mask'] = (np_example['entity_id'] > 0).astype(np.float32)
    return np_example

def _make_msa_mask(np_example):
    """Mask features are all ones, but will later be zero-padded."""

    np_example['msa_mask'] = np.ones_like(np_example['msa'], dtype=np.float32)

    seq_mask = (np_example['entity_id'] > 0).astype(np.float32)
    np_example['msa_mask'] *= seq_mask[None]

    return np_example



REQUIRED_FEATURES = frozenset({
    'aatype', 'all_atom_mask', 'all_atom_positions', 'all_chains_entity_ids',
    'all_crops_all_chains_mask', 'all_crops_all_chains_positions',
    'all_crops_all_chains_residue_ids', 'assembly_num_chains', 'asym_id',
    'bert_mask', 'cluster_bias_mask', 'deletion_matrix', 'deletion_mean',
    'entity_id', 'entity_mask', 'mem_peak', 'msa', 'msa_mask', 'num_alignments',
    'num_templates', 'queue_size', 'residue_index', 'resolution',
    'seq_length', 'seq_mask', 'sym_id', 'template_aatype',
    'template_all_atom_mask', 'template_all_atom_positions'
})

def _filter_features(
        np_examp

相关文章:

  • htmlplay网站推广seo招聘
  • 网站开发市场调查抄一则新闻四年级
  • 网站建设哪里培训推广软文案例
  • 广东专业的网站制作百度联盟一天多少收入
  • wordpress管理面板忘记密码sem和seo是什么职业
  • wordpress外观自定义嘉兴seo报价
  • 大数据测试总结
  • 鸿蒙开发新视角:用ArkTS解锁责任链模式
  • Linux系统管理(十八)——Ubuntu Server环境下载安装图形化界面、英伟达显卡驱动、Cuda、cudnn、conda的深度学习环境
  • mysql表分区
  • EP 架构:未来主流方向还是特定场景最优解?
  • 为什么用源码搭建体育比分网直播更加高效
  • 网络编程 day02
  • 【人造稀缺性的资本围猎场】
  • 汽车智能钥匙中PKE低频天线的作用
  • Centos7服务器防火墙设置教程
  • 【AI Guide】AI面试攻略只用看这一篇就够了!力争做全网最全的AI面试攻略——大模型(三十二)Zero-shot
  • DeepSeek 智慧城市应用:交通流量预测(918)
  • 《Canvas修仙传·第四重天元婴境(上集)》 ——WebGL虚空造物与Three.js破碎虚空之法
  • PH热榜 | 2025-03-04
  • 第40天:安全开发-JavaEE应用SpringBoot框架JWT身份鉴权打包部署JARWAR
  • 神码AC-AP无线部署
  • k8s面试题总结(八)
  • 大模型在高血压预测及围手术期管理中的应用研究报告
  • yum源选要配置华为云的源,阿里云用不了的情况
  • 恒流驱动革新:ZCC6303凭实力替代SY7301