Back to index

python-biopython  1.60
IsoelectricPoint.py
Go to the documentation of this file.
00001 # Copyright Yair Benita Y.Benita@pharm.uu.nl
00002 # Biopython (http://biopython.org) license applies
00003 
00004 """Calculate isoelectric points of polypeptides using methods of Bjellqvist.
00005 
00006 pK values and the methos are taken from:
00007 
00008 * Bjellqvist, B.,Hughes, G.J., Pasquali, Ch., Paquet, N., Ravier, F., Sanchez,
00009 J.-Ch., Frutiger, S. & Hochstrasser, D.F.
00010 The focusing positions of polypeptides in immobilized pH gradients can be predicted
00011 from their amino acid sequences. Electrophoresis 1993, 14, 1023-1031. 
00012 
00013 * Bjellqvist, B., Basse, B., Olsen, E. and Celis, J.E.
00014 Reference points for comparisons of two-dimensional maps of proteins from
00015 different human cell types defined in a pH scale where isoelectric points correlate
00016 with polypeptide compositions. Electrophoresis 1994, 15, 529-539.
00017 
00018 I designed the algorithm according to a note by David L. Tabb, available at:
00019 http://fields.scripps.edu/DTASelect/20010710-pI-Algorithm.pdf
00020 
00021 """
00022 
00023 positive_pKs = { 'Nterm': 7.5, 'K': 10.0, 'R': 12.0, 'H':5.98 }
00024 negative_pKs = { 'Cterm': 3.55, 'D': 4.05, 'E': 4.45, 'C':9.0, 'Y':10.0 }
00025 pKcterminal= {'D':4.55, 'E':4.75}
00026 pKnterminal = {'A':7.59, 'M':7.0, 'S':6.93, 'P':8.36, 'T':6.82, 'V':7.44, 'E':7.7}
00027 charged_aas = ('K', 'R', 'H', 'D', 'E', 'C', 'Y')
00028 
00029 # access this module through ProtParam.ProteinAnalysis class.
00030 # first make a ProteinAnalysis object and then call its isoelectric_point method.
00031 class IsoelectricPoint(object):
00032     def __init__(self, ProteinSequence, AminoAcidsContent):
00033         self.sequence = ProteinSequence        
00034         self.charged_aas_content = self._select_charged(AminoAcidsContent)
00035 
00036     # This function creates a dictionary with the contents of each charged aa, 
00037     # plus Cterm and Nterm.
00038     def _select_charged(self, AminoAcidsContent):
00039         charged = {}    
00040         for aa in charged_aas:
00041             charged[aa] = float(AminoAcidsContent[aa])
00042         charged['Nterm'] = 1.0
00043         charged['Cterm'] = 1.0
00044         return charged
00045 
00046     #This function calculates the total charge of the protein at a given pH.
00047     def _chargeR(self, pH, pos_pKs, neg_pKs):
00048         PositiveCharge = 0.0
00049         for aa, pK in pos_pKs.iteritems():         
00050              CR = 10**(pK-pH)
00051              partial_charge = CR/(CR+1.0)
00052              PositiveCharge += self.charged_aas_content[aa] * partial_charge 
00053 
00054         NegativeCharge = 0.0
00055         for aa, pK in neg_pKs.iteritems():         
00056              CR = 10**(pH-pK)
00057              partial_charge = CR/(CR+1.0)
00058              NegativeCharge += self.charged_aas_content[aa] * partial_charge 
00059 
00060         return PositiveCharge - NegativeCharge       
00061 
00062     # This is the action function, it tries different pH until the charge of the protein is 0 (or close).
00063     def pi(self):        
00064         pos_pKs = dict(positive_pKs)
00065         neg_pKs = dict(negative_pKs)
00066         nterm = self.sequence[0]
00067         cterm = self.sequence[-1]    
00068         if nterm in pKnterminal.keys():
00069             pos_pKs['Nterm'] = pKnterminal[nterm]
00070         if cterm in pKcterminal.keys():
00071             neg_pKs['Cterm'] = pKcterminal[cterm]
00072 
00073         # Bracket between pH1 and pH2
00074         pH = 7.0
00075         Charge = self._chargeR(pH, pos_pKs, neg_pKs)
00076         if Charge > 0.0:
00077             pH1 = pH
00078             Charge1 = Charge
00079             while Charge1 > 0.0:
00080                 pH = pH1 + 1.0
00081                 Charge = self._chargeR(pH, pos_pKs, neg_pKs)
00082                 if Charge > 0.0:
00083                     pH1 = pH
00084                     Charge1 = Charge
00085                 else:
00086                     pH2 = pH
00087                     Charge2 = Charge
00088                     break
00089         else:
00090             pH2 = pH
00091             Charge2 = Charge
00092             while Charge2 < 0.0:
00093                 pH = pH2 - 1.0
00094                 Charge = self._chargeR(pH, pos_pKs, neg_pKs)
00095                 if Charge < 0.0:
00096                     pH2 = pH
00097                     Charge2 = Charge
00098                 else:
00099                     pH1 = pH
00100                     Charge1 = Charge
00101                     break
00102 
00103         # Bisection
00104         while pH2 - pH1 > 0.0001 and Charge!=0.0:
00105             pH = (pH1 + pH2) / 2.0
00106             Charge = self._chargeR(pH, pos_pKs, neg_pKs)
00107             if Charge > 0.0:
00108                 pH1 = pH
00109                 Charge1 = Charge
00110             else:
00111                 pH2 = pH
00112                 Charge2 = Charge
00113 
00114         return pH