ó
lsßIc           @   s'  d  Z  d d l m Z d d l m Z d d l m Z e d „ Z e d k r#d GHd d l	 Z	 d	 Z
 e	 j
 j e
 ƒ rx™ e	 j e
 ƒ D]ˆ Z e	 j
 j e ƒ d d
 k r‡ He GHd e e ƒ GHe e	 j
 j e
 e ƒ ƒ Z x& e e ƒ D] Z e j Ge e ƒ GHqæ We j ƒ  q‡ q‡ Wd GHq#d GHn  d S(   s‡   Bio.SeqIO support for the "ig" (IntelliGenetics or MASE) file format.

You are expected to use this module via the Bio.SeqIO functions.iÿÿÿÿ(   t   single_letter_alphabet(   t   Seq(   t	   SeqRecordc         c   s¦  x3 t  r5 |  j ƒ  } | s Pn  | j d ƒ s Pq q Wx\| r”| d d k rh t d t | ƒ ƒ ‚ n  g  } x6 | j d ƒ r¦ | j | d j ƒ  ƒ |  j ƒ  } qq W| j ƒ  } g  } xS t  r|  j ƒ  } | sØ Pn  | d d k rì Pn  | j | j ƒ  j d d ƒ ƒ q¼ Wd j	 | ƒ } | j
 d ƒ r:| d	  } n  d | k rUt d
 ƒ ‚ n  t t | | ƒ d | d | ƒ} d j	 | ƒ | j d <| Vq9 W| s¢t ‚ d S(   sÒ  Iterate over IntelliGenetics records (as SeqRecord objects).

    handle - input file
    alphabet - optional alphabet

    The optional free format file header lines (which start with two
    semi-colons) are ignored.

    The free format commentary lines at the start of each record (which
    start with a semi-colon) are recorded as a single string with embedded
    new line characters in the SeqRecord's annotations dictionary under the
    key 'comment'.
    s   ;;i    t   ;s)   Records should start with ';' and not:
%si   t    t    t   1iÿÿÿÿs5   Potential terminator digit one found within sequence.t   idt   names   
t   commentN(   t   Truet   readlinet
   startswitht
   ValueErrort   reprt   appendt   stript   rstript   replacet   joint   endswithR   R   t   annotationst   AssertionError(   t   handlet   alphabett   linet   comment_linest   titlet	   seq_linest   seq_strt   record(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqIO/IgIO.pyt
   IgIterator   sB    	  		  #	t   __main__s   Running quick self testNs   ../../Tests/IntelliGenetics/s   .txtt   -t   Dones   Could not find input files(   t   __doc__t   Bio.AlphabetR    t   Bio.SeqR   t   Bio.SeqRecordR   R   t   __name__t   ost   patht   isdirt   listdirt   filenamet   splitextt   lent   openR   R   R   R   t   close(    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/SeqIO/IgIO.pyt   <module>   s(   =