
gbc           @   s0   d  Z  d d l m Z d e f d     YZ d S(   s*   
Created on 14 mai 2009

@author: coissac
i(   t   WrappedBioSequencet   HomoNucBioSeqc           B   sJ   e  Z d  Z d d d  Z d   Z d   Z d   Z d   Z d   Z	 RS(   s   
    classdocs
    c         K   sE   | j    s t d   t j |  | d d d d | |  j   d S(   s   
        Constructor
        s$   reference must be a nucleic sequencet   idt
   definitionN(   t   isNucleotidet   AssertionErrorR    t   __init__t   Nonet    _HomoNucBioSeq__cleanHomopolymer(   t   selft	   referenceR   R   t   info(    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyR      s    c         C   s   g  } g  } d  } d } x\ |  j D]Q } | d  k	 ri | | k ri | j |  | j |  d } | } n  | d 7} q" Wd j |  |  _ | |  d <g  |  _ d } x+ |  j D]  } | | 7} |  j j |  q Wd  S(   Ni    i   t    t   homopolymer(   R   t   _wrappedt   appendt   joint   _cachedt   _cumulativet   _count(   R	   t   st   ct   oldt   nct   nt   sum(    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyt   __cleanHomopolymer   s$    	
	
c         C   s   t  |  j  S(   N(   t   lenR   (   R	   (    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyt   __len__+   s    c         C   s   |  j  S(   N(   R   (   R	   (    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyt   getStr.   s    c         C   s   t  |  j  S(   N(   t   iterR   (   R	   (    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyt   __iter__1   s    c         C   s   |  j  | S(   N(   R   (   R	   t   position(    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyt   _posInWrapped4   s    N(
   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   R!   (    (    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyR   	   s   				N(   R$   t   obitoolsR    R   (    (    (    s:   lib/python2.7/site-packages/obitools/align/homopolymere.pyt   <module>   s   