
:>"^§  ã               @   s2   d  Z  d d l m Z d d d d d d „ Z d	 S)
z’Generic functions which are useful for working with HMMs.

This just collects general functions which you might like to use in
dealing with HMMs.
é    )Úprint_functionZ	Emissionsz
Real StatezPredicted StateéK   c             C   s&  t  t | ƒ t | ƒ t | ƒ ƒ d } | | } | j | ƒ } | j | ƒ } | j | ƒ } d }	 xº |	 | t |  ƒ k  r‡ | }
 n t |  ƒ |	 }
 t d | |  |	 |	 | … f ƒ t d | | |	 |	 | … f ƒ t d | | |	 |	 | … f ƒ t |  ƒ |	 | k  rP|	 | 7}	 qh Wd S)a=  Print out a state sequence prediction in a nice manner.

    Arguments:
     - emissions -- The sequence of emissions of the sequence you are
       dealing with.
     - real_state -- The actual state path that generated the emissions.
     - predicted_state -- A state path predicted by some kind of HMM model.

    é   r   z%s%sz%s%s
N)ÚmaxÚlenÚljustÚprint)Z	emissionsZ
real_stateZpredicted_stateZemission_titleZ
real_titleZpredicted_titleÚ
line_widthZtitle_lengthZ
seq_lengthZcur_positionÚ	extension© r   ú6/tmp/pip-build-ww9dw3qa/biopython/Bio/HMM/Utilities.pyÚpretty_print_prediction   s,    (
	r   N)Ú__doc__Ú
__future__r   r   r   r   r   r   Ú<module>   s
   