ó
ä¸WHc           @   sê   d  Z  d d l m Z d d l Z d „  Z e d k ræ d GHd Z d d l Z e j j	 e ƒ sl d e GHqæ e
 e ƒ Z e e ƒ Z xR e D]J Z e j GHe j GHe j d	 GHe e j d
 ƒ GHe j j ƒ  d  d GHq‹ We j ƒ  n  d S(   sô   Bio.SeqIO support for the "swiss" (aka SwissProt/UniProt) file format.

You are expected to use this module via the Bio.SeqIO functions.
See also the Bio.SwissProt module which offers more than just accessing
the sequences as SeqRecord objects.iÿÿÿÿ(   t   SProtNc         c   sy   t  j ƒ  } g  } x` |  D]X } | j | ƒ | d  d k r t j d j | ƒ ƒ }  | j |  ƒ } g  } | Vq q Wd S(   s   Breaks up a Swiss-Prot/UniProt file into SeqRecord objects.

    Every section from the ID line to the terminating // becomes
    a single SeqRecord with associated annotation and features.

    This parser is for the flat file "swiss" format as used by:
     * Swiss-Prot aka SwissProt
     * TrEMBL
     * UniProtKB aka UniProt Knowledgebase

    It does NOT read their new XML file format.
    http://www.expasy.org/sprot/

    For consistency with BioPerl and EMBOSS we call this the "swiss"
    format.
    i   s   //t    N(   R    t   SequenceParsert   appendt	   cStringIOt   StringIOt   joint   parse(   t   handlet   parsert   linest   linet   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/SwissIO.pyt   SwissIterator   s    t   __main__s   Quick self test...s   ../../Tests/SwissProt/sp008s   Missing test file %st   keywordst   organismi   s   ...(   t   __doc__t   Bio.SwissProtR    R   R   t   __name__t   example_filenamet   ost   patht   isfilet   openR   t   recordsR   t   namet   idt   annotationst   reprt   seqt   tostringt   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/SwissIO.pyt   <module>   s$   	