当前位置: 首页 > 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
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.dtcms.com/a/49622.html

相关文章:

  • 大数据测试总结
  • 鸿蒙开发新视角:用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
  • MyBatis - 单元测试 参数传递 注解 CRUD
  • 大牛证券|光伏回收产业站上风口 千亿元市场空间待释放
  • GBT32960 协议编解码器的设计与实现
  • Rust WebAssembly 入门教程
  • 迷你世界脚本对象库接口:ObjectLib
  • 一阶逻辑篇--一门数学编程语言
  • 【练习】【链表】力扣热题100 21. 合并两个有序链表
  • 【Flink银行反欺诈系统设计方案】1.短时间内多次大额交易场景的flink与cep的实现
  • FineReport 操作注意
  • 【AI Guide】AI面试攻略只用看这一篇就够了!力争做全网最全的AI面试攻略——大模型(三十一)BASE与CHAT模型