ó

xTc           @   s&   d  d l  m Z d   Z d   Z d S(   i˙˙˙˙(   t   dequec         c   s   d | k s t   | g | } | |  | } t d | d |  d d | d  } x( | d | D] } | j |  | Vqa Wd S(   s3   
  Groups values and pads them to a fixed length
  i    t   iterablei   t   maxleni   N(   t   AssertionErrorR    t   append(   t   sequencet   widtht   paddingt   paddedt   dt   v(    (    s<   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/sequtil.pyt   localize   s    %c         c   s   |  r t  |   } | j   \ } } xM | D]E \ } } | d | d |  rX | } q+ n  |  | | !V| } | } q+ W|  | Vn  d S(   sV   
  Breaks up sequences where elements are not consecutive according to a
  property
  t   leftt   rightN(   t	   enumeratet   next(   R   t   consecutivityt   itR   t   prevt   indext   elem(    (    s<   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/sequtil.pyt   split   s    
N(   t   collectionsR    R   R   (    (    (    s<   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/sequtil.pyt   <module>   s   	