def fp_to_cache(self): """(Complex) -> NoneType""" fp1 = self.gen_if_residue_fp_atg() fp2 = self.gen_if_residue_fp_atb() C.set_signature("interactive_force_atG_as_rec") C.dump(self.c_id, fp1) C.set_signature("interactive_force_atB_as_rec") C.dump(self.c_id, fp2)
def gen_fp_str(self, tri_or_res, atg_as_receptor = True, use_cache = True): _, atg_res_dist = self.get_atg_res_spat_dist() if tri_or_res is "res": fps1 = self.get_atg_aaindex_fp(fps = PaddedComplexFingerPrint()) str1 = fps1.fp_str(overall_atg_dist, atg_res_dist, number_type=float) else:#tri fps1 = self.get_tri_aaindex_fp(fps = PaddedComplexFingerPrint()) #padded fp str _, tri_dist = self.get_tri_spat_dist() str1 = fps1.fp_str(overall_tri_dist, tri_dist, number_type=float) #antibody side fps2 = self.get_atb_aaindex_fp(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=float) #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 fp_to_cache(self): """(Complex) -> NoneType""" fp1, fp2, fp3 = self.gen_atg_tri_fp(), self.gen_atg_res_fp(), self.gen_atb_res_fp() C.set_signature("atg_tri_residue_plane") C.dump(self.c_id, fp1) C.set_signature("atg_res_residue_plane") C.dump(self.c_id, fp2) C.set_signature("atb_res_residue_plane") C.dump(self.c_id, fp3)
def fp_to_cache(self): """(Complex) -> NoneType""" fp1, fp2, fp3 = self.gen_atg_tri_fp(), self.gen_atg_res_fp(), self.gen_atb_res_fp() print fp1.get_bitlength() print fp2.get_bitlength() print fp3.get_bitlength() C.set_signature("atg_tri_complex_plane") C.dump(self.c_id, fp1) C.set_signature("atg_res_complex_plane") C.dump(self.c_id, fp2) C.set_signature("atb_res_complex_plane") C.dump(self.c_id, fp3)
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])