
X_S                 @   s   d  d l  m Z d  d l Z d  d l Td  d l Td  d l Td  d l Td  d l TGd d   d e j  Z	 e
 d k r e d  y7 e   Z e d  Z e j e  Z e j e  Z Wn/ e k
 r Z z e e  WYd d Z [ Xn Xe j   n  d S)	    )print_functionN)*c               @   s4   e  Z d  Z d d   Z d d   Z d d   Z d S)test_stride_ioc             C   sg  t  d  } t |  } |  j | j d  |  j | j d j d  |  j | j d j d  |  j | j d j t d   |  j | j d j	 t d   |  j | j d j
 t d   |  j | j d j d	  |  j | j   t d
 t   |  j | j   t d t   |  j | j   t d   |  j | j d d	  | j d k  | j   d  S)Nzstride/stride_test_1.txtZ1A65r   ACgW@g     v@g\(c@1Z
QIVNSVDTMTZ
CEETTEEEEEg9~@)testdata_streamStrideRecordassertEqualpdbidresidueschainidsecstrucsolvent_acc_areafloatphipsiresidprimarySeqprotein_alphabet	secondarystride_alphabet
total_area
assertTrueget_residueclose)selffg r    L/Users/gec/Work/Projects/corebioproj/weblogo-3.4/test_corebio/test_stride.pytest_12   s       &ztest_stride_io.test_1c             C   sg  t  d  } t |  } |  j | j d  |  j | j d j d  |  j | j d j d  |  j | j d j t d   |  j | j d j	 t d   |  j | j d j
 t d   |  j | j d j d	  |  j | j   t d
 t   |  j | j   t d t   |  j | j   t d   |  j | j d d	  | j d k  | j   d  S)Nzstride/stride_test_2.txt1A59    r   g33333SU@ǧS@gRd@3ZEPTIHZCCCCCg33333@ǧS)r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r    r    r!   test_2B   s       &ztest_stride_io.test_2c             C   sg  t  d  } t |  } |  j | j d  |  j | j d j d  |  j | j d j d  |  j | j d j t d   |  j | j d j	 t d   |  j | j d
 j
 t d   |  j | j d j d  |  j | j   t d t   |  j | j   t d t   |  j | j   t d   |  j | j d d  | j d k  | j   d  S)Nzstride/stride_test_3.txtr#   r   r%   T   g333333N@   g(\Y@   g33333s;@12ZVTADVZTCCCCi  g(\Yg33333s;)r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   r   r    r    r!   test_3R   s       &ztest_stride_io.test_3N)__name__
__module____qualname__r"   r'   r-   r    r    r    r!   r   0   s   r   __main__zaRunning additional tests of RunStride. These require that the STRIDE program is installed locallyz1CGP.pdb)
__future__r   unittestcorebiocorebio.seqZcorebio.seq_ioZcorebio.secstruc.strideZtest_corebioTestCaser   r.   print	RunStridestridetestdata_filenamefnprocess_pdbdatarecord	Exceptionexcmainr    r    r    r!   <module>%   s"   




3
	