def gen_fp_str(self, use_tri = True, atg_as_receptor = True, use_cache = True): #antigen side if use_tri: if use_cache: C.set_signature("atg_tri_%s_plane" %self.plane_type) fps1 = C.load(self.c_id, self, complex_fp_cls = PaddedComplexFingerPrint) else: fps1 = self.gen_fp_by_splitting_cylinder(bases=self.atg.residues, targets=[(0,self.get_triangles())], fps = PaddedComplexFingerPrint()) else: if use_cache: C.set_signature("atg_res_%s_plane" %self.plane_type) fps1 = C.load(self.c_id, self, complex_fp_cls = PaddedComplexFingerPrint) else: fps1 = self.gen_fp_by_splitting_cylinder(bases=self.atg.residues, targets=[(0,self.atg.residues)], fps = PaddedComplexFingerPrint()) #padded fp str _, atg_res_dist = self.get_atg_res_spat_dist() str1 = fps1.fp_str(overall_atg_dist, atg_res_dist, number_type=int) #antibody side if use_cache: C.set_signature("atb_res_%s_plane" %self.plane_type) fps2 = C.load(self.c_id, self, complex_fp_cls = PaddedComplexFingerPrint) else: fps2 = self.gen_fp_by_splitting_cylinder(bases=self.atb.residues, targets=[(0,self.atb.residues)], fps = PaddedComplexFingerPrint()) #padded fp str _, atb_res_dist = self.get_atb_res_spat_dist() str2 = fps2.fp_str(overall_atb_dist, atb_res_dist, number_type=int) #interactive force if atg_as_receptor: #atg as receptor if use_cache: C.set_signature("interactive_force_atG_as_rec") fps3 = C.load(self.c_id, self, complex_fp_cls = PaddedComplexFingerPrint) else: fps3 = get_15bits(receptor = self.atg, binder = self.atb, fp = PaddedComplexFingerPrint()) str3 = fps3.fp_str(overall_atg_dist, atg_res_dist, number_type = int) else: #atb as receptor if use_cache: C.set_signature("interactive_force_atB_as_rec") fps3 = C.load(self.c_id, self, complex_fp_cls = PaddedComplexFingerPrint) else: fps3 = get_15bits(binder = self.atg, receptor = self.atb, fp = PaddedComplexFingerPrint()) str3 = fps3.fp_str(overall_atb_dist, atb_res_dist, number_type = int) return ",".join([str1, str2, str3])
def gen_if_residue_fp_atb(self, fp = None): """ interactive force finger print, antibody as the receptor for each residue """ logger.info("interactive force finger print, antibody as the receptor") return get_15bits(receptor= self.atb, binder= self.atg, fp = fp)