ó
öHc           @   s5  d  Z  d d l Z 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 d l
 m Z d d	 l m Z d d
 l m Z d d l m Z e e j ƒ Z e j ƒ  d k sÉ t ‚ e j ƒ  g  k sá t ‚ [ e e j ƒ Z d Z e j d e ƒ e j d e j ƒ  ƒ e j d e j ƒ  ƒ e j ƒ  d k sMt ‚ e e j ƒ  ƒ d k skt ‚ e j d ƒ j ƒ  e k sŒt ‚ e j d ƒ j ƒ  e j ƒ  k s³t ‚ e j d ƒ j ƒ  e j ƒ  k sÚt ‚ e j ƒ  d j d k sùt ‚ e j ƒ  d j d k st ‚ e j ƒ  d j d k s7t ‚ xI e e ƒ D]; \ Z  Z! e j" e  ƒ e! e! j ƒ  e! j ƒ  k sDt ‚ qDWe d j# d k sœt ‚ e d j# d k sµt ‚ e$ e d d d … e ƒ s×t ‚ e d d d … d j# d k sýt ‚ e d d d … d j# d k s#t ‚ [ [ d GHe j% j& e j' ƒ  d ƒ Z( d d g Z) g  Z* x* e) D]" Z+ e* j, e j% j& e( e+ ƒ ƒ qbWx" e* D] Z- e j. e- ƒ Z e GHqWe j. e j% j& e( e) d ƒ ƒ Z d GHe j ƒ  Z/ x, e/ D]$ Z0 d Ge0 j GHd Ge1 e0 j2 ƒ GHqçWd Ge j ƒ  GHd GHe j3 e ƒ Z4 e4 j5 ƒ  Z6 e$ e6 e j ƒ sVt ‚ d Ge1 e6 ƒ GHd GHe4 j7 d  g ƒ j8 ƒ  Z9 e9 j: ƒ  x- e9 D]% Z; d! e; e4 j7 d  g ƒ e; f GHq“Wd" GHd# GHe4 j< e6 d  g ƒ GHd$ GHe4 j< d% d  g ƒ GHd& GHe j d ƒ Z= e4 j< e= d  g ƒ GHd' GHd( Ge4 j> d) d* d% d  g ƒGHd+ Ge4 j> d% d  g ƒ GHd, GHi d- d. 6d- d/ 6d- d0 6d- d1 6Z? e j e? e j@ e jA ƒ ZB d2 Ge4 j> d3 eB d% d  g ƒ GHd4 Ge4 j" d ƒ GHd5 Ge4 jC d GHd6 Ge4 j" d7 ƒ GHd8 Ge4 jC d7 GHd9 GHe jD e4 ƒ d: GHe j% j& e jE d; d< ƒ ZF e j. eF d= ƒ Z d GHe j ƒ  Z/ x, e/ D]$ Z0 d Ge0 j GHd Ge1 e0 j2 ƒ GHqVWd Ge j ƒ  GHe j3 e ƒ Z4 e4 j5 d> d? ƒ Z6 e$ e6 e j ƒ sÆt ‚ d Ge1 e6 ƒ GHe GHd@ GHe j. e j% j& e jE d d ƒ ƒ Z e	 e ƒ ZG eG jH ƒ  ZI eG jJ ƒ  ZK eI GHeK GHd S(A   sµ   test_align.py

A script to test alignment stuff.

Right now we've got tests for:
o Reading and Writing clustal format
o Reading and Writing fasta format
o Converting between formatsiÿÿÿÿN(   t   Alphabet(   t   Seq(   t   IUPAC(   t   Clustalw(   t   FormatConverter(   t	   AlignInfo(   t
   FastaAlign(   t	   FreqTable(   t	   Alignmenti    t   AbcDefGhiJklMnoPqrStuVwxYzt   mixedt   lowert   upperi   i   i   i   s-   testing reading and writing clustal format...R   s   opuntia.alns   cw02.alns   all_seqs...s   description:s   seq:s   length:s"   Calculating summary information...s
   consensus:s   Replacement dictionaryt   Ns   %s : %ss   position specific score matrix.s%   with a supplied consensus sequence...s%   defaulting to a consensus sequence...t   chars_to_ignores   with a selected sequence...s   information contents   part of alignment:i   i2   s   entire alignment:s   relative information contentg      Ð?t   Gt   Ct   At   Ts   relative information:t   e_freq_tables	   Column 1:s   IC for column 1:s	   Column 7:i   s   IC for column 7:s   test print_info_contents+   testing reading and writing fasta format...t   Fastat   fa01t   PROTEINt	   ambiguoust   Xs   Test format conversion...(L   t   __doc__t   ost   BioR    R   t   Bio.AlphabetR   R   t   Bio.Align.FormatConvertR   t	   Bio.AlignR   t	   Bio.FastaR   t   Bio.SubsMatR   t   Bio.Align.GenericR   t   generic_alphabett	   alignmentt   get_alignment_lengtht   AssertionErrort   get_all_seqst   letterst   add_sequenceR   R   t   lent   get_seq_by_numt   tostringt   descriptiont	   enumeratet   colt   lettert
   get_columnt   idt
   isinstancet   patht   joint   getcwdt   test_dirt
   test_namest
   test_filest   namet   appendt	   test_filet
   parse_filet   all_seqst
   seq_recordt   reprt   seqt   SummaryInfot
   align_infot   dumb_consensust	   consensust   replacement_dictionaryt   keyst   kst   sortt   keyt   pos_specific_score_matrixt
   second_seqt   information_contentt   e_freqt   FREQt   unambiguous_dnaR   t	   ic_vectort   print_info_contentt   curdirt   to_parset	   convertert   to_fastat   fasta_alignt
   to_clustalt   clustal_align(    (    (    s   test_align.pyt   <module>	   sæ   !'''"&& 	"
#

