ó
ÄčIc           @   s,  d  Z  d d l Z d d l Z e j   d d l m Z d d l m Z d d l m Z d d l m Z d d l	 m
 Z
 d e _ d	   Z d
 GHd g Z x e D]| Z d e GHe j e  Z e e j e d   Z e e  d k sí t  e d Z d e e  GHe j e k s t  q W[ [ [ [ [ d GHxă d  d! d" d# d$ d% g D]É \ Z Z Z d e e e f GHe j d e d e d e  Z e j e e  Z e j   d e e  GHe e j k sLe e j k sLd e j k röe j d e k sLt d e e j e j f   qLW[ [ [ [ [ d S(&   s  Testing online code for fetching sequences, and parsing them

Uses Bio.SeqIO to parse files downloaded with Bio.GenBank, Bio.WWW.NCBI, 
Bio.ExPASy etc.

Goals:
    Make sure that all retrieval is working as expected.
    May catch some format changes early too.
i˙˙˙˙N(   t   Entrez(   t   ExPASy(   t   SeqIO(   t   StringIO(   t   seguids   biopython-dev@biopython.orgc         C   sr   t  |  j  d k  r' |  j j   } n( |  j j   d  d |  j j   d } d | t |  j  t  |  j  f S(   Ni   i   s   ...iý˙˙˙s   %s [%s] len %i(   t   lent   seqt   tostringR   (   t   recordt   short(    (    s   test_SeqIO_online.pyt   checksum_summary   s
    (s#   Checking Bio.ExPASy.get_sprot_raw()t   O23729s   - Fetching %st   swissi   i    s     Got s   Checking Bio.Entrez.efetch()t   genomet   fastat   X52960t   gbt
   nucleotidet   6273291t   proteint   16130152s   - Fetching %s from %s as %st   dbt   idt   rettypet   gis   %s got %s, %s(   R   R   R   (   R   R   R   (   R   R   R   (   R   R   R   (   R   R   R   (   R   R   R   (    t   __doc__t   syst   requires_internett   checkt   BioR    R   R   R   t   Bio.SeqUtils.CheckSumR   t   emailR
   t   id_listt
   identifiert   get_sprot_rawt   handlet   listt   parset   recordsR   t   AssertionErrorR   R   t   databaset   formatt   entryt   efetcht   readt   closet   namet   annotations(    (    (    s   test_SeqIO_online.pyt   <module>	   sN   
				
	
% 