ó
{™xTc           @   s¡   d  d l  m Z d  d l m Z d  d l Z d e j f d „  ƒ  YZ e j ƒ  j e ƒ Z	 e j
 e	 g ƒ Z d „  Z e d k r� e j d d	 ƒ j e ƒ n  d S(
   iÿÿÿÿ(   t   division(   t   ebi_wu_blast_xmlNt	   TestParsec           B   s2   e  Z d Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s…   |  j  j d  k r� d d  l } | j j d d ƒ } d d  l } d d  l } t j	 d | j
 | j j | d d ƒ ƒ ƒ |  j  _ n  d  S(   Niÿÿÿÿt   iotbxt   bioinformaticst   sourcet   tests   ebi_blast.xml.gz(   t	   __class__t   HSEARCHt   Nonet   libtbx.load_envt   envt
   under_distt   os.patht   gzipR   t   parset   opent   patht   join(   t   selft   libtbxt   roott   osR   (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/bioinformatics/test/tst_ebi_wu_blast_xml.pyt   setUp   s    	c         C   s[  |  j  j j d j d } |  j | j d ƒ |  j | j d ƒ |  j | j d d ƒ |  j | j	 d d ƒ |  j | j
 d d ƒ |  j | j d ƒ |  j | j d	 ƒ |  j | j j d
 ƒ |  j | j j d ƒ |  j | j j d d d ƒ |  j | j j d ƒ |  j | j j d ƒ |  j | j j d d d ƒ |  j | j d d d ƒ d  S(   Ni   i    i   i]  g     @k@gØç«êÂÀ3i
   i:   iO   i   iÂ   tB   EKLKKSKIIFVVGGPGSGKGTQCEKIVQKYGYTHLSTGDLLRAEVSSGSARGKMLSEIMEKGQLVPt@   LETVLDMLRDAMVAKVDTSKGFLIDGYPREVKQGEEFERKIGQPTLLLYVDAGPETMTKRLLKRt=   GETSGRVDDNEETIKKRLETYYKATEPVIAFYEKRGIVRKVNAEGSVDDVFSQVCTHLDTLi   iÅ   tB   EDLRKCKIIFIIGGPGSGKGTQCEKLVEKYGFTHLSTGELLREELASESERSKLIRDIMERGDLVPt@   SGIVLELLKEAMVASLGDTRGFLIDGYPREVKQGEEFGRRIGDPQLVICMDCSADTMTNRLLQMt=   SRSSLPVDDTTKTIAKRLEAYYRASIPVIAYYETKTQLHKINAEGTPEDVFLQLCTAIDSIsB   E L+K KIIF++GGPGSGKGTQCEK+V+KYG+THLSTG+LLR E++S S R K++ +IME+G LVPs@      VL++L++AMVA +  ++GFLIDGYPREVKQGEEF R+IG P L++ +D   +TMT RLL+ s=     +S  VDD  +TI KRLE YY+A+ PVIA+YE +  + K+NAEG+ +DVF Q+CT +D++(   R   R   t   hitst
   alignmentst   assertEqualt   numbert   scoret   assertAlmostEqualt   bitst   expectationt   probabilityt   identityt	   positivest   queryt   startt   endt   seqt   matcht   pattern(   R   t   ali(    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/bioinformatics/test/tst_ebi_wu_blast_xml.pyt   testAlignment   s*    		c         C   s�   |  j  j j d } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j t	 | j
 ƒ d ƒ d  S(   Ni    i   t   pdbt   3ADK_AiÃ   s(   mol:protein length:195  ADENYLATE KINASE(   R   R   R   R    R!   t   databaset
   identifiert   lengtht   descriptiont   lenR   (   R   t   hit(    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/bioinformatics/test/tst_ebi_wu_blast_xml.pyt   testHit<   s    c         C   sO  |  j  j j } |  j | j j d ƒ |  j | j j d ƒ |  j | j j d ƒ |  j | j d d d d ƒ |  j | j	 j
 d ƒ |  j | j	 j d	 ƒ |  j | j	 j d
 ƒ |  j t | j j ƒ d ƒ | j j d } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j t | j j ƒ d ƒ | j j d } |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j d ƒ |  j | j j d ƒ |  j | j j d ƒ |  j | j j d ƒ |  j | j j d ƒ |  j | j j d ƒ |  j | j j d ƒ |  j  j j } |  j t | ƒ d ƒ d  S(   Ns	   WU-blastps   2.0MP-WashU [04-May-2006]s   PMID:12824421s_   /ebi/extserv/bin/wu-blast/blastp "pdb" /ebi/extserv/blast-work/interactive/blast-20090331-16013sl   83158.input E=10 B=50 V=100 -mformat=1 -matrix BLOSUM62 -sump  -filter seg -cpus 8 -sort_by_pvalue -putenv='s`   WUBLASTMAT=/ebi/extserv/bin/wu-blast/matrix' -putenv="WUBLASTDB=$IDATA_CURRENT/blastdb" -putenv=s1   'WUBLASTFILTER=/ebi/extserv/bin/wu-blast/filter' s   2009-03-31T16:01:44+01:00s   2009-03-31T16:01:45+01:00t   PT01Si   i    t   Sequencet   piÃ   R1   s   2009-03-27T00:00:07+01:00g      Y@i2   t   BLOSUM62g      $@t   sumpt   seg(   R   R   t   headerR    t   programt   namet   versiont   citationt   commandt   timeR*   R+   t   searchR7   t
   parameterst	   sequencesR!   t   typeR5   t	   databasest   createdt   scoresR   t   matrixt   expectation_uppert
   statisticst   filterR   (   R   R@   R,   t   dbR   (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/bioinformatics/test/tst_ebi_wu_blast_xml.pyt   testRootH   s<    N(   t   __name__t
   __module__R	   R   R   R0   R9   RS   (    (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/bioinformatics/test/tst_ebi_wu_blast_xml.pyR      s
   		#	c         C   s   t  S(   N(   t   alltests(   t   loadert   testsR.   (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/bioinformatics/test/tst_ebi_wu_blast_xml.pyt
   load_tests|   s    t   __main__t	   verbosityi   (   t
   __future__R    t   iotbx.bioinformaticsR   t   unittestt   TestCaseR   t
   TestLoadert   loadTestsFromTestCaset   suite_parset	   TestSuiteRV   RY   RT   t   TextTestRunnert   run(    (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/bioinformatics/test/tst_ebi_wu_blast_xml.pyt   <module>   s   k	