RFdiffusion get_mappings函数解读
get_mappings为ContigMap类的方法(contigs.py), 该方法的主要作用是构建并返回一个包含各种映射信息的字典,用于在不同编号系统之间转换,同时关联残基设计区域、掩码以及参考编号等数据。
源代码:
def get_mappings(self):
mappings = {}
mappings["con_ref_pdb_idx"] = [i for i in self.inpaint if i != ("_", "_")]
mappings["con_hal_pdb_idx"] = [
self.inpaint_hal[i]
for i in range(len(self.inpaint_hal))
if self.inpaint[i] != ("_", "_")
]
mappings["con_ref_idx0"] = np.array(self.ref_idx0_inpaint)
mappings["con_hal_idx0"] = np.array(self.hal_idx0_inpaint)
if self.inpaint != self.ref:
mappings["complex_con_ref_pdb_idx"] = [
i for i in self.ref if i != ("_", "_")
]
mappings["complex_con_hal_pdb_idx"] = [
self.hal[i] for i in range(len(self.hal)) if self.ref[i] != ("_", "_")
]
mappings["receptor_con_ref_pdb_idx"] = [
i for i in self.receptor if i != ("_", "_")
]
mappings["receptor_con_hal_pdb_idx"] = [
self.receptor_hal[i]
for i in range(len(self.receptor_hal))
if self.receptor[i] != ("_", "_")
]
mappings["complex_con_ref_idx0"] = np.array(self.ref_idx0)
mappings["complex_con_hal_idx0"] = np.array(self.hal_idx0)
mappings["receptor_con_ref_idx0"] = np.array(self.ref_idx0_receptor)
mappings["receptor_con_hal_idx0"] = np.array(self.hal_idx0_receptor)
mappings["inpaint_str"] = self.inpaint_str
mappings["inpaint_seq"] = self.inpaint_seq
mappings["sampled_mask"] = self.sampled_mask
mappings["mask_1d"] = self.mask_1d
return mappings
代码解读:
1. 映射:con_ref_pdb_idx
mappings["con_ref_pdb_idx"] = [i for i in self.inpaint if i != ("_", "_")]
-
con_ref_pdb_idx
: 一个列表,表示
原文地址:https://blog.csdn.net/qq_27390023/article/details/144352438
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!