pKaTool/pKaIO.py
def write_pdb2pka_matrix(self,filename,matrix):
        """Write an interaction energy matrix in pdb2pka format"""
        """At the moment, we just reformat and write a WHAT IF file"""
        self.matrix={}
        for group1 in matrix.keys():
            self.matrix[group1.uniqueid]={}
            for tit1 in matrix[group1].keys():
                for state1 in matrix[group1][tit1].keys():
                    sub_m=matrix[group1][tit1][state1]
                    for group2 in sub_m.keys():
                        if not self.matrix[group1.uniqueid].has_key(group2.uniqueid):
                            self.matrix[group1.uniqueid][group2.uniqueid]=[]
                        for tit2 in sub_m[group2].keys():
                            for state2 in sub_m[group2][tit2].keys():
                                self.matrix[group1.uniqueid][group2.uniqueid].append(sub_m[group2][tit2][state2])
        for group1 in self.matrix.keys():
            for group2 in self.matrix[group1].keys():
                sum=0.0
                for val in self.matrix[group1][group2]:
                    sum=sum+val
                self.matrix[group1][group2]=[sum,0.0,0.0,0.0]
        self.write_matrix(filename,format='pdb2pka')
        return
Write an interaction energy matrix in pdb2pka format
Write an interaction energy matrix in pdb2pka format
Write an interaction energy matrix in pdb2pka format
def write_pdb2pka_matrix(self,filename,matrix):
        self.matrix={}
        for group1 in matrix.keys():
            self.matrix[group1.uniqueid]={}
            for tit1 in matrix[group1].keys():
                for state1 in matrix[group1][tit1].keys():
                    sub_m=matrix[group1][tit1][state1]
                    for group2 in sub_m.keys():
                        if not self.matrix[group1.uniqueid].has_key(group2.uniqueid):
                            self.matrix[group1.uniqueid][group2.uniqueid]=[]
                        for tit2 in sub_m[group2].keys():
                            for state2 in sub_m[group2][tit2].keys():
                                self.matrix[group1.uniqueid][group2.uniqueid].append(sub_m[group2][tit2][state2])
        for group1 in self.matrix.keys():
            for group2 in self.matrix[group1].keys():
                sum=0.0
                for val in self.matrix[group1][group2]:
                    sum=sum+val
                self.matrix[group1][group2]=[sum,0.0,0.0,0.0]
        self.write_matrix(filename,format='pdb2pka')
        return
def write_pdb2pka_matrix ( self , filename , matrix ) : """At the moment, we just reformat and write a WHAT IF file""" self . matrix = { } for group1 in matrix . keys ( ) : self . matrix [ group1 . uniqueid ] = { } for tit1 in matrix [ group1 ] . keys ( ) : for state1 in matrix [ group1 ] [ tit1 ] . keys ( ) : sub_m = matrix [ group1 ] [ tit1 ] [ state1 ] for group2 in sub_m . keys ( ) : if not self . matrix [ group1 . uniqueid ] . has_key ( group2 . uniqueid ) : self . matrix [ group1 . uniqueid ] [ group2 . uniqueid ] = [ ] for tit2 in sub_m [ group2 ] . keys ( ) : for state2 in sub_m [ group2 ] [ tit2 ] . keys ( ) : self . matrix [ group1 . uniqueid ] [ group2 . uniqueid ] . append ( sub_m [ group2 ] [ tit2 ] [ state2 ] ) for group1 in self . matrix . keys ( ) : for group2 in self . matrix [ group1 ] . keys ( ) : sum = 0.0 for val in self . matrix [ group1 ] [ group2 ] : sum = sum + val self . matrix [ group1 ] [ group2 ] = [ sum , 0.0 , 0.0 , 0.0 ] self . write_matrix ( filename , format = 'pdb2pka' ) return
Write an interaction energy matrix in pdb2pka format
Write an interaction energy matrix in pdb2pka format
"""Write an interaction energy matrix in pdb2pka format""" """At the moment, we just reformat and write a WHAT IF file"""
self
filename
matrix