pKarun/pKa_general.py
def analyse_stability(self,folded,unfolded=0,absolute=False,write_file=True):
        """
        # folded is a dictionary containing the titration
        # curves for all residues in the protein. (Normally
        # the self.titdata produced by pKaIO.readtitcurv).
        # unfolded is a similar dictionary, containing the
        # titration curves for the unfolded form. If no unfolded
        # dictionary is given, then titration curves
        # are calculated based on the model pKa values for
        # the amino acid types.
         """
        import string, math
        residues=folded.keys()
        checkedres=[]
        for res in residues:
            if string.strip(string.lower(res))!='pka':
                checkedres.append(res)
        residues=checkedres
        if unfolded==0 or not unfolded:
            unfolded={}
            X=pKatools()
            for residue in residues:
                type=self.get_residue_type(residue)
                
                phstart,phend,phstep,pka,curve=self.get_residue_curve(folded[residue])
                unfolded[residue]=X.make_titration_curve_2(self.modelpk[string.upper(type)],self.acidbase[string.upper(type)],residue,folded[residue].keys())[residue]
        new_phvalues=folded[residues[0]].keys()
        phvalues=[]
        for ph in new_phvalues:
            if string.lower(str(ph))!='pka' and ph>=2.0 and ph<=10.0:
                phvalues.append(ph)
        phvalues.sort()
        stab={}
        RK=8.31451
        TEMP=298.15
        #
        # Get the stability "titration" curve for each residue
        #
        sums={}
        for residue in residues:
            sumc=0.0
            lastph=phvalues[0]
            contribution={}
            for ph in phvalues[1:]:
                print ph,folded[residue][ph],unfolded[residue][ph],residue
                diff=math.log(10)*RK*TEMP*(folded[residue][ph]-unfolded[residue][ph])/1000.0 #Result in kJ/mol?
                if absolute:
                    diff=abs(diff)
                if self.is_base(residue):
                    diff=-diff
                sumc=sumc+diff*(ph-lastph)
                contribution[ph]=sumc
                lastph=ph
            sums[residue]=sumc
            stab[residue]=contribution
        # Done
        return stab,sums

        # folded is a dictionary containing the titration
        # curves for all residues in the protein. (Normally
        # the self.titdata produced by pKaIO.readtitcurv).
        # unfolded is a similar dictionary, containing the
        # titration curves for the unfolded form. If no unfolded
        # dictionary is given, then titration curves
        # are calculated based on the model pKa values for
        # the amino acid types.
         
folded is a dictionary containing the titration
curves for all residues in the protein.
folded is a dictionary containing the titration curves for all residues in the protein .
def analyse_stability(self,folded,unfolded=0,absolute=False,write_file=True):
        import string, math
        residues=folded.keys()
        checkedres=[]
        for res in residues:
            if string.strip(string.lower(res))!='pka':
                checkedres.append(res)
        residues=checkedres
        if unfolded==0 or not unfolded:
            unfolded={}
            X=pKatools()
            for residue in residues:
                type=self.get_residue_type(residue)
                phstart,phend,phstep,pka,curve=self.get_residue_curve(folded[residue])
                unfolded[residue]=X.make_titration_curve_2(self.modelpk[string.upper(type)],self.acidbase[string.upper(type)],residue,folded[residue].keys())[residue]
        new_phvalues=folded[residues[0]].keys()
        phvalues=[]
        for ph in new_phvalues:
            if string.lower(str(ph))!='pka' and ph>=2.0 and ph<=10.0:
                phvalues.append(ph)
        phvalues.sort()
        stab={}
        RK=8.31451
        TEMP=298.15
         Get the stability "titration" curve for each residue
        sums={}
        for residue in residues:
            sumc=0.0
            lastph=phvalues[0]
            contribution={}
            for ph in phvalues[1:]:
                print ph,folded[residue][ph],unfolded[residue][ph],residue
                diff=math.log(10)*RK*TEMP*(folded[residue][ph]-unfolded[residue][ph])/1000.0 Result in kJ/mol?
                if absolute:
                    diff=abs(diff)
                if self.is_base(residue):
                    diff=-diff
                sumc=sumc+diff*(ph-lastph)
                contribution[ph]=sumc
                lastph=ph
            sums[residue]=sumc
            stab[residue]=contribution
         Done
        return stab,sums
def analyse_stability ( self , folded , unfolded = 0 , absolute = False , write_file = True ) : import string , math residues = folded . keys ( ) checkedres = [ ] for res in residues : if string . strip ( string . lower ( res ) ) != 'pka' : checkedres . append ( res ) residues = checkedres if unfolded == 0 or not unfolded : unfolded = { } X = pKatools ( ) for residue in residues : type = self . get_residue_type ( residue ) phstart , phend , phstep , pka , curve = self . get_residue_curve ( folded [ residue ] ) unfolded [ residue ] = X . make_titration_curve_2 ( self . modelpk [ string . upper ( type ) ] , self . acidbase [ string . upper ( type ) ] , residue , folded [ residue ] . keys ( ) ) [ residue ] new_phvalues = folded [ residues [ 0 ] ] . keys ( ) phvalues = [ ] for ph in new_phvalues : if string . lower ( str ( ph ) ) != 'pka' and ph >= 2.0 and ph <= 10.0 : phvalues . append ( ph ) phvalues . sort ( ) stab = { } RK = 8.31451 TEMP = 298.15 sums = { } for residue in residues : sumc = 0.0 lastph = phvalues [ 0 ] contribution = { } for ph in phvalues [ 1 : ] : print ph , folded [ residue ] [ ph ] , unfolded [ residue ] [ ph ] , residue diff = math . log ( 10 ) * RK * TEMP * ( folded [ residue ] [ ph ] - unfolded [ residue ] [ ph ] ) / 1000.0 if absolute : diff = abs ( diff ) if self . is_base ( residue ) : diff = - diff sumc = sumc + diff * ( ph - lastph ) contribution [ ph ] = sumc lastph = ph sums [ residue ] = sumc stab [ residue ] = contribution return stab , sums
folded is a dictionary containing the titration
 curves for all residues in the protein.
folded is a dictionary containing the titration curves for all residues in the protein .
"""
        # folded is a dictionary containing the titration
        # curves for all residues in the protein. (Normally
        # the self.titdata produced by pKaIO.readtitcurv).
        # unfolded is a similar dictionary, containing the
        # titration curves for the unfolded form. If no unfolded
        # dictionary is given, then titration curves
        # are calculated based on the model pKa values for
        # the amino acid types.
         """ # # Get the stability "titration" curve for each residue # #Result in kJ/mol? # Done
self
folded
unfolded
absolute
write_file