*
D;c       s:     d  d g Z   d k Z  d k Z  d k Z  d k Z  d k Z  d k Z  d k l Z  d k	 Z	  d k	 l
 Z
  d k l Z  d k l Z  d k l Z  d k l Z  d k Z  d k Z   d	 f  d
     YZ ? d f  d     YZ m d f  d     YZ  d f  d     YZ d S(   s   Records   kabat_formatN(   s   handler(   s   RecordReader(   s   EventGenerator(   s   AbstractConsumer(   s	   Reference(   s   Files   Iteratorc      s)     d  Z  " # e d  Z / d   Z RS(   sK   Iterator interface to move over a file of Kabat entries one at a time.
    c    s.   # * + t  i | d  |  _ - | |  _ d S(   s  Initialize the iterator.

        Arguments:
        o handle - A handle with Kabat entries to iterate through.
        o parser - An optional parser to pass the entries through before
        returning them. If None, then the raw entry will be returned.
        s   KADBIDN(   s   RecordReaders
   StartsWiths   handles   selfs   _readers   parsers   _parser(   s   selfs   handles   parser(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   __init__# s   c    s   / 3 4 |  i i   } 6 |  i t j	 o] 7 | oO 8 t d d  } 9 | i |  : | i	   ; |  i i
 t i |   Sn n = | Sd S(   sj   Return the next Kabat record from the handle.

        Will return None if we ran out of records.
        s   dumps   wN(   s   selfs   _readers   nexts   datas   _parsers   Nones   opens   dumpfiles   writes   closes   parses   Files   StringHandle(   s   selfs   dumpfiles   data(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   next/ s   
$(   s   __doc__s   Nones   __init__s   next(    (    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   Iterator  s   	s   _Scannerc      s)   ? d  Z  D E d d  Z ` d   Z RS(   s   Start up Martel to do the scanning of the file.

    This initialzes the Martel based parser and connects it to a handler
    that will generate events for a Feature Consumer.
    i    c    s|   E P S d d d d d d d d d	 d
 d d d d d d d g |  _ ] t i t i |  i  } ^ | i d |  |  _	 d S(   s  Initialize the scanner by setting up our caches.

        Creating the parser takes a long time, so we want to cache it
        to reduce parsing time.

        Arguments:
        o debug - The level of debugging that the parser should
        display. Level 0 is no debugging, Level 2 displays the most
        debugging info (but is much slower). See Martel documentation
        for more info on this.
        s   kabatids   creation_dates   last_mod_dates
   definitions   speciess   nucleotide_sequence_names   amino_acid_sequence_names   nucleotide_ref_authors   nucleotide_ref_pubmeds   nucleotide_ref_journals   amino_acid_ref_authors   amino_acid_ref_pubmeds   amino_acid_ref_journals   annotation_keys   annotation_vals   codons   amino_1_letter_codes   debug_levelN(
   s   selfs   interest_tagss   Martels   select_namess   kabat_formats   kabat_records
   expressions   make_parsers   debugs   _parser(   s   selfs   debugs
   expression(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   __init__E s   ?
c    s?   ` f g |  i i t | h |  i   k |  i i |  d S(   s   Feeed a set of data into the scanner.

        Arguments:
        o handle - A handle with the information to parse.
        o consumer - The consumer that should be informed of events.
        N(   s   selfs   _parsers   setContentHandlers   EventGenerators   consumers   interest_tagss	   parseFiles   handle(   s   selfs   handles   consumer(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   feed` s   (   s   __doc__s   __init__s   feed(    (    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   _Scanner? s   	s   _RecordConsumerc      s   m d  Z  o p d   Z v d   Z z d   Z ~ d   Z  d   Z  d   Z  d   Z  d   Z  d	   Z	  d
   Z
  d   Z  d   Z  d   Z  d   Z  d   Z  d   Z  d   Z  d   Z RS(   sE   Create a Kabat Record object from scanner generated information.
    c    s1   p q t  i    |  _ s t |  _ t t |  _ d  S(   N(   s   Records   selfs   datas   Nones   _cur_nucleotide_refs   _cur_amino_acid_ref(   s   self(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   __init__p s   c    s#   v w | d } x | |  i _ d  S(   Ni    (   s   contents	   next_lines   selfs   datas   kabatid(   s   selfs   contents	   next_line(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   kabatidv s   c    s#   z { | d } | | |  i _ d  S(   Ni    (   s   contents	   next_lines   selfs   datas   creation_date(   s   selfs   contents	   next_line(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   creation_datez s   c    s#   ~  | d }  | |  i _ d  S(   Ni    (   s   contents	   next_lines   selfs   datas   date_last_mod(   s   selfs   contents	   next_line(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   last_mod_date~ s   c    s#     | d }  | |  i _ d  S(   Ni    (   s   contents	   next_lines   selfs   datas
   definition(   s   selfs   contents	   next_line(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys
   definition s   c    s#     | d }  | |  i _ d  S(   Ni    (   s   contents	   next_lines   selfs   datas   species(   s   selfs   contents	   next_line(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   species s   c    s     | d |  i _ d  S(   Ni    (   s   contents   selfs   datas   nucleotide_sequence_name(   s   selfs   content(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   nucleotide_sequence_name s   c    s     | d |  i _ d  S(   Ni    (   s   contents   selfs   datas   nucleotide_sequence_name(   s   selfs   content(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   amino_acid_sequence_name s   c    s     | d }  | d }  t i   |  _  | |  i _  | d  }  | i	   }  | d j o)  |  i
 i i |  i   t |  _ n d  S(   Ni    i   s   1(   s   contents	   next_lines   author_infos   Records   KabatReferences   selfs   _cur_nucleotide_refs   authorss   continuations   strips   datas   nucleotide_refss   appends   None(   s   selfs   contents   continuations	   next_lines   author_info(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   nucleotide_ref_author s   c    s     | d }  | d }  | |  i _  | d  }  | i   }  | d j o)  |  i i	 i
 |  i   t |  _ n d  S(   Ni    i   s   1(   s   contents	   next_lines   journal_infos   selfs   _cur_nucleotide_refs   journals   continuations   strips   datas   nucleotide_refss   appends   None(   s   selfs   contents   continuations	   next_lines   journal_info(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   nucleotide_ref_journal s   c    s     | d }  | d }  | i   |  i _  | d  }  | i   }  | d j o)  |  i i	 i
 |  i   t |  _ n d  S(   Ni    i   s   1(   s   contents	   next_lines   pubmed_infos   strips   selfs   _cur_nucleotide_refs	   pubmed_ids   continuations   datas   nucleotide_refss   appends   None(   s   selfs   contents   pubmed_infos   continuations	   next_line(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   nucleotide_ref_pubmed s   c    s     | d }  | d }  t i   |  _  | |  i _  | d  }  y  | i	   } Wn   d | GHn X | d j o)  |  i
 i i |  i   t |  _ n d  S(   Ni    i   s   continuation is %ss   1(   s   contents	   next_lines   author_infos   Records   KabatReferences   selfs   _cur_amino_acid_refs   authorss   continuations   strips   datas   amino_acid_refss   appends   None(   s   selfs   contents   continuations	   next_lines   author_info(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   amino_acid_ref_author s   c    s     | d }  | d }  | |  i _  | d  }  | i   }  | d j o)  |  i i	 i
 |  i   t |  _ n d  S(   Ni    i   s   1(   s   contents	   next_lines   journal_infos   selfs   _cur_amino_acid_refs   journals   continuations   strips   datas   amino_acid_refss   appends   None(   s   selfs   contents   continuations	   next_lines   journal_info(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   amino_acid_ref_journal s   c    s     | d }  | d }  | i   |  i _  | d  }  | i   }  | d j o)  |  i i	 i
 |  i   t |  _ n d  S(   Ni    i   s   1(   s   contents	   next_lines   pubmed_infos   strips   selfs   _cur_amino_acid_refs	   pubmed_ids   continuations   datas   amino_acid_refss   appends   None(   s   selfs   contents   pubmed_infos   continuations	   next_line(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   amino_acid_ref_pubmed s   c    sF     x9 t  i  d | d  d  r }  |  i i i |  q Wd  S(   Ns   ci    (   s   arrays   contents   items   selfs   datas   nucleotide_sequences   append(   s   selfs   contents   item(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   codon s    	c    sF     x9 t  i  d | d  d  r }  |  i i i |  q Wd  S(   Ns   ci    (   s   arrays   contents   items   selfs   datas   amino_acid_sequences   append(   s   selfs   contents   item(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   amino_1_letter_code s    	c    s      | d }  | |  _ d  S(   Ni    (   s   contents   texts   selfs   pending_key(   s   selfs   contents   text(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   annotation_key s   c    s     | d }  | i   }  |  i t j oc  |  i }  |  i i i	 |  o  |  i i | | } n  | |  i i | < t |  _ n d  S(   Ni    (
   s   contents   vals   strips   selfs   pending_keys   Nones   keys   datas
   annotations   has_key(   s   selfs   contents   vals   key(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   annotation_val s   (   s   __doc__s   __init__s   kabatids   creation_dates   last_mod_dates
   definitions   speciess   nucleotide_sequence_names   amino_acid_sequence_names   nucleotide_ref_authors   nucleotide_ref_journals   nucleotide_ref_pubmeds   amino_acid_ref_authors   amino_acid_ref_journals   amino_acid_ref_pubmeds   codons   amino_1_letter_codes   annotation_keys   annotation_val(    (    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   _RecordConsumerm s&   	

s   RecordParserc      s)    d  Z    d d  Z  d   Z RS(   s*   Parse Kabat files into Record objects
    i    c    s      t  |  |  _ d S(   s[  Initialize the parser.

        Arguments:
        o debug_level - An optional argument that species the amount of
        debugging information Martel should spit out. By default we have
        no debugging info (the fastest way to do things), but if you want
        you can set this as high as two and see exactly where a parse fails.
        N(   s   _Scanners   debug_levels   selfs   _scanner(   s   selfs   debug_level(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   __init__ s   c    s?      t    |  _  |  i i | |  i   |  i i Sd S(   s:   Parse the specified handle into a GenBank record.
        N(   s   _RecordConsumers   selfs	   _consumers   _scanners   feeds   handles   data(   s   selfs   handle(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   parse s   (   s   __doc__s   __init__s   parse(    (    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   RecordParser s   	(   s   __all__s   strings   arrays   oss   res   sgmllibs   urlparses   xml.saxs   handlers   Martels   RecordReaders   Bio.ParserSupports   EventGenerators   AbstractConsumers   Bio.SeqFeatures	   References   Bios   Files   kabat_formats   Records   Iterators   _Scanners   _RecordConsumers   RecordParser(   s   RecordParsers   oss   Records   arrays   EventGenerators   kabat_formats   _Scanners   Files   Iterators   handlers	   References   res   urlparses   _RecordConsumers   RecordReaders   Martels   __all__s   strings   AbstractConsumers   sgmllib(    (    s+   /mit/seven/lib/python/Bio/Kabat/__init__.pys   ? s&   .