主页 > 游戏开发  > 

AF3DataPipeline类process_core方法解读

AF3DataPipeline类process_core方法解读

DataPipeline类中的process_core方法用于解析ProteinNet.core文件,并为其中的蛋白序列生成特征,以便后续输入到 AlphaFold3 进行结构预测。

主要功能

解析.core文件,提取蛋白序列及相关信息(protein.from_proteinnet_string)。 转换氨基酸类型,获取蛋白序列 (_aatype_to_str_sequence)。 生成基础蛋白特征(make_protein_features)。 解析比对模板(MSA 和模板库): 解析模板比对 (_parse_template_hit_files),获取比对模板特征 (make_template_features)。 处理 MSA 特征: 普通模式:调用_process_msa_feats处理 MSA。 序列嵌入模式 (seqemb_mode=True):仅使用输入序列构造dummy MSA(make_dummy_msa_feats),并进一步生成序列嵌入特征(_process_seqemb_features)。 返回特征字典:整合蛋白特征、模板特征、MSA 特征、(可选)序列嵌入特征。 源代码: def process_core( self, core_path: str, alignment_dir: str, alignment_index: Optional[Any] = None, seqemb_mode: bool = False, ) -> FeatureDict: """ Assembles features for a protein in a ProteinNet .core file. """ with open(core_path, 'r') as f: core_str = f.read() protein_object = protein.from_proteinnet_string(core_str) input_sequence = _aatype_to_str_sequence(protein_object.aatype) description = os.path.splitext(os.path.basename(core_path))[0].upper() core_feats = make_protein_features(protein_object, description) hits = self._parse_template_hit_files( alignment_dir=alignment_dir, input_sequence=input_sequence, alignment_index=alig
标签:

AF3DataPipeline类process_core方法解读由讯客互联游戏开发栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“AF3DataPipeline类process_core方法解读