
Dc           @   s   d  Z  i d d 6d d 6d d 6d d 6Z i d	 d
 6d d 6d d 6d d 6d d 6Z i d d 6d d 6Z i d d 6d d 6d d 6d d 6d d 6d d 6d  d 6Z d$ Z d! d% d"     YZ d# S(&   s.  Calculate isoelectric points of polypeptides using methods of Bjellqvist.

pK values and the methos are taken from:

* Bjellqvist, B.,Hughes, G.J., Pasquali, Ch., Paquet, N., Ravier, F., Sanchez,
J.-Ch., Frutiger, S. & Hochstrasser, D.F.
The focusing positions of polypeptides in immobilized pH gradients can be predicted
from their amino acid sequences. Electrophoresis 1993, 14, 1023-1031. 

* Bjellqvist, B., Basse, B., Olsen, E. and Celis, J.E.
Reference points for comparisons of two-dimensional maps of proteins from
different human cell types defined in a pH scale where isoelectric points correlate
with polypeptide compositions. Electrophoresis 1994, 15, 529-539.

I designed the algorithm according to a note by David L. Tabb, available at:
http://fields.scripps.edu/DTASelect/20010710-pI-Algorithm.pdf

g      @t   Ntermg      $@t   Kg      (@t   RgQ@t   Hgffffff@t   Ctermg333333@t   Dg@t   Eg      "@t   Ct   Yg333333@g      @g\(\@t   Ag      @t   MgQ@t   SgQ @t   PgHzG@t   Tg(\@t   Vg@t   IsoelectricPointc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   s   | |  _  |  j |  |  _ d  S(   N(   t   sequencet   _select_chargedt   charged_aas_content(   t   selft   ProteinSequencet   AminoAcidsContent(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqUtils/IsoelectricPoint.pyt   __init__    s    	c         C   sC   i  } x" t  D] } t | |  | | <q Wd | d <d | d <| S(   Ng      ?R    R   (   t   charged_aast   float(   R   R   t   chargedt   aa(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqUtils/IsoelectricPoint.pyR   &   s    

c   
      C   s   d } xK | j    D]= \ } } d | | } | | d } | |  j | | 7} q Wd }	 xK | j    D]= \ } } d | | } | | d } |	 |  j | | 7}	 qg W| |	 S(   Ng        i
   g      ?(   t	   iteritemsR   (
   R   t   pHt   pos_pKst   neg_pKst   PositiveChargeR   t   pKt   CRt   partial_charget   NegativeCharge(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqUtils/IsoelectricPoint.pyt   _chargeR/   s    c         C   s  t  t  } t  t  } |  j d } |  j d } | t j   k rU t | | d <n  | t j   k rx t | | d <n  d } |  j | | |  } | d k r| } | } x | d k r| d } |  j | | |  } | d k r | } | } q | }	 | }
 Pq Wnf | }	 | }
 xW |
 d k  rm|	 d } |  j | | |  } | d k  r]| }	 | }
 q| } | } PqWxj |	 | d k r| d k r| |	 d	 } |  j | | |  } | d k r| } | } qq| }	 | }
 qqW| S(
   Ni    iR    R   g      @g        g      ?g-C6?g       @(   t   dictt   positive_pKst   negative_pKsR   t   pKnterminalt   keyst   pKcterminalR$   (   R   R   R   t   ntermt   ctermR   t   Charget   pH1t   Charge1t   pH2t   Charge2(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqUtils/IsoelectricPoint.pyt   pi?   sT    
	
		
(   t   __name__t
   __module__R   R   R$   R2   (    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqUtils/IsoelectricPoint.pyR      s   				N(   R   R   R   R   R   R   R   (    (   t   __doc__R&   R'   R*   R(   R   R   (    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqUtils/IsoelectricPoint.pyt   <module>   s   ")7