示例#1
0
    def add_sift_chunk_ordinary(self, rec_atom, lig_name, strength):
        if self.sifts.has_key(lig_name):
            if rec_atom.resnum in self.sifts[lig_name].sift.keys():
                cur_sift = self.sifts[lig_name]
            else:
                self.sifts[lig_name].add_sift_chunk(rec_atom.resnum)
                cur_sift = self.sifts[lig_name]
        else:
            new_sift = sift(lig_name)
            new_sift.add_sift_chunk(rec_atom.resnum)

            self.sifts[lig_name] = new_sift
            cur_sift = new_sift

        if "CONTACT" in self.active_bits:
            cur_sift.turn_sift_bit_on(self.bit_pos["CONTACT"], rec_atom.resnum, "exists")
        if int(rec_atom) in self.backbone_set:
            if "BACKBONE" in self.active_bits:
                cur_sift.turn_sift_bit_on(self.bit_pos["BACKBONE"], rec_atom.resnum, strength)
        else:
            if "SIDECHAIN" in self.active_bits:
                cur_sift.turn_sift_bit_on(self.bit_pos["SIDECHAIN"], rec_atom.resnum, strength)

            if int(rec_atom) in self.polar_set:
                if "POLAR" in self.active_bits:
                    cur_sift.turn_sift_bit_on(self.bit_pos["POLAR"], rec_atom.resnum, strength)
            if int(rec_atom) in self.hydrophobic_set:
                if "HYDROPHOBIC" in self.active_bits:
                    cur_sift.turn_sift_bit_on(self.bit_pos["HYDROPHOBIC"], rec_atom.resnum, strength)
            if int(rec_atom) in self.aromatic_set:
                if "AROMATIC" in self.active_bits:
                    cur_sift.turn_sift_bit_on(self.bit_pos["AROMATIC"], rec_atom.resnum, strength)
            if int(rec_atom) in self.charged_set:
                if "CHARGED" in self.active_bits:
                    cur_sift.turn_sift_bit_on(self.bit_pos["CHARGED"], rec_atom.resnum, strength)
示例#2
0
    def fill_missing_zeros(self, start_res, end_res, lig_name):
        if lig_name not in self.sifts.keys():
            new_sift = sift(lig_name)

        for res in range(start_res, end_res):
            if res not in self.sifts[lig_name].sift.keys():
                self.sifts[lig_name].add_sift_chunk(res)
示例#3
0
    def add_sift_chunk_env(self, rec_atom, lig_name, i_type, strength):
        if self.sifts.has_key(lig_name):
            if rec_atom.resnum in self.sifts[lig_name].sift.keys():
                cur_sift = self.sifts[lig_name]
            else:
                self.sifts[lig_name].add_sift_chunk(rec_atom.resnum)
                cur_sift = self.sifts[lig_name]
        else:
            new_sift = sift(lig_name)
            new_sift.add_sift_chunk(rec_atom.resnum)

            self.sifts[lig_name] = new_sift
            cur_sift = new_sift

        cur_sift.turn_sift_bit_on(self.bit_pos[i_type], rec_atom.resnum, strength)
示例#4
0
    def add_sift_chunk_special_case(self, rec_atom, lig_atom, lig_name, dist):
        """
        the case without strength difference
        """
        if self.sifts.has_key(lig_name):
            if rec_atom.resnum in self.sifts[lig_name].sift.keys():
                cur_sift = self.sifts[lig_name]
            else:
                self.sifts[lig_name].add_sift_chunk(rec_atom.resnum)
                cur_sift = self.sifts[lig_name]
        else:
            new_sift = sift(lig_name)
            new_sift.add_sift_chunk(rec_atom.resnum)

            self.sifts[lig_name] = new_sift
            cur_sift = new_sift

        if structureutil.match_hbond(lig_atom, rec_atom, distance=dist):
            if rec_atom.atomic_number == 1:
                if "H_DONOR" in self.active_bits:
                    cur_sift.turn_sift_bit_on(self.bit_pos["H_DONOR"], rec_atom.resnum, "exists")
            else:
                if "H_ACCEPTOR" in self.active_bits:
                    cur_sift.turn_sift_bit_on(self.bit_pos["H_ACCEPTOR"], rec_atom.resnum, "exists")