3
:>"^5                 @   s  d Z ddlZddlmZ ddlmZ ddlmZ y@dDejdd   koNdEkn  rbdd	l	m
Z
 ndd
l	mZ
 W n  ek
r   dd	l	m
Z
 Y nX ddiZy
e
jZW n: ek
r   ee
dsdd	l	m
Z eje
_dd ZY nX xej D ]\ZZeee qW ejd dkrdndZG dd deZdd Zdd ZedfddZdd Zdd Zed fdd Zd!d" Zefd#d$Z d%d& Z!efd'd(Z"dFd)d*Z#d+d, Z$d-d. Z%d/d0 Z&d1d2 Z'd3d4 Z(d5d6 Z)G d7d8 d8e*Z+d9d: Z,d;d< Z-dGd>d?Z.d@dA Z/G dBdC dCe*Z0dS )Ha  PhyloXML reader/parser, writer, and associated functions.

Instantiates tree elements from a parsed PhyloXML file, and constructs an XML
file from a ``Bio.Phylo.PhyloXML`` object.

About capitalization:
 - phyloXML means the file format specification
 - PhyloXML means the Biopython module ``Bio.Phylo.PhyloXML`` and its classes
 - Phyloxml means the top-level class used by ``PhyloXMLIO.read`` (but not
   ``Bio.Phylo.read``!), containing a list of Phylogenies (objects derived from
   ``BaseTree.Tree``)

    N)
basestring)unicode)PhyloXML         )ElementTree)cElementTreephyzhttp://www.phyloxml.org_namespace_mapc             C   s   | t j|< dS )z"Set the namespace for ElementTree.N)r   r   )prefixuri r   d/home/psgendb/BIRCHDEV/lib-linux-x86_64/python/lib64/python3.5/site-packages/Bio/Phylo/PhyloXMLIO.pyregister_namespace4   s    r   r   zutf-8c               @   s   e Zd ZdZdS )PhyloXMLErrorzException raised when PhyloXML object construction cannot continue.

    XML syntax errors will be found and raised by the underlying ElementTree
    module; this exception is for valid XML that breaks the phyloXML
    specification.
    N)__name__
__module____qualname____doc__r   r   r   r   r   @   s   r   c             C   s   t | j S )zParse a phyloXML file or stream and build a tree of Biopython objects.

    The children of the root node are phylogenies and possibly other arbitrary
    (non-phyloXML) objects.

    :returns: a single ``Bio.Phylo.PhyloXML.Phyloxml`` object.

    )Parserread)filer   r   r   r   O   s    	r   c             C   s   t | j S )a  Iterate over the phylogenetic trees in a phyloXML file.

    This ignores any additional data stored at the top level, but may be more
    memory-efficient than the ``read`` function.

    :returns: a generator of ``Bio.Phylo.PhyloXML.Phylogeny`` objects.

    )r   parse)r   r   r   r   r   [   s    	r   Tc                s~   dd  t | tjrnTt | tjjtjjfr: | j } n0t| drbtji  fdd| D d} ntdt	| j
|||dS )	aR  Write a phyloXML file.

    :Parameters:
        obj
            an instance of ``Phyloxml``, ``Phylogeny`` or ``BaseTree.Tree``,
            or an iterable of either of the latter two. The object will be
            converted to a Phyloxml object before serialization.
        file
            either an open handle or a file name.

    c             S   sn   t | tjr| S t | tjr$| j S t | tjjr>tjj| S t | tjjrbtjjtjj| dS tdd S )N)rootz)iterable must contain Tree or Clade types)	
isinstancePX	PhylogenyCladeZto_phylogenyBaseTreeTree	from_tree
ValueError)treer   r   r   
fix_singlet   s    zwrite.<locals>.fix_single__iter__c             3   s   | ]} |V  qd S )Nr   ).0t)r$   r   r   	<genexpr>   s    zwrite.<locals>.<genexpr>)phylogenieszXFirst argument must be a Phyloxml, Phylogeny, Tree, or iterable of Trees or Phylogenies.)encodingindent)r   r   Phyloxmlr   r    r   Zto_phyloxmlhasattrr"   Writerwrite)objr   r*   r+   r   )r$   r   r/   g   s    
r/   c             C   s&   | d dkr"| | j dd d S | S )z;Extract the local tag from a namespaced tag name (PRIVATE).r   {}r   N)index)tagr   r   r   _local   s    r5   c             C   s2   y| dd j ddS  tk
r,   d| fS X dS )z;Split a tag into namespace and local tag strings (PRIVATE).r   Nr2    )splitr"   )r4   r   r   r   _split_namespace   s    r8   c             C   s   d|| f S )z5Format an XML tag with the given namespace (PRIVATE).z{%s}%sr   )r4   	namespacer   r   r   _ns   s    r:   c             C   s"   | j t|}|dk	r||S dS )z|Find a child node by tag, and pass it through a constructor (PRIVATE).

    Returns None if no matching child is found.
    N)findr:   )parentr4   	constructchildr   r   r   _get_child_as   s    r?   c             C   s*   | j t|}|dk	r&|jr&||jS dS )z~Find a child node by tag; pass its text through a constructor (PRIVATE).

    Returns None if no matching child is found.
    N)r;   r:   text)r<   r4   r=   r>   r   r   r   _get_child_text   s    rA   c                s    fdd| j t|D S )zFind child nodes by tag; pass each through a constructor (PRIVATE).

    Returns an empty list if no matching child is found.
    c                s   g | ]} |qS r   r   )r&   r>   )r=   r   r   
<listcomp>   s    z$_get_children_as.<locals>.<listcomp>)findallr:   )r<   r4   r=   r   )r=   r   _get_children_as   s    rD   c                s    fdd| j t|D S )zFind child nodes by tag; pass each node's text through a constructor (PRIVATE).

    Returns an empty list if no matching child is found.
    c                s   g | ]}|j r |j qS r   )r@   )r&   r>   )r=   r   r   rB      s    z&_get_children_text.<locals>.<listcomp>)rC   r:   )r<   r4   r=   r   )r=   r   _get_children_text   s    rE   c             C   s   d|d  }t | r| j s(| jj  r2|d | _x8| D ]0}t||d  |j s^|jj  r8|d |_q8W |j s|jj  r||_n|r| j s| jj  r|| _dS )zAdd line breaks and indentation to ElementTree in-place (PRIVATE).

    Sources:
     - http://effbot.org/zone/element-lib.htm#prettyprint
     - http://infix.se/2007/02/06/gentlemen-indent-your-xml

    
z  r   N)lenr@   strip_indenttail)elemlevelier   r   r   rI      s    

rI   c             C   s8   | dks| dkrdS | dks$| dkr(dS t d|  dS )	z$Convert string to boolean (PRIVATE).true1TZfalse0Fz*String could not be converted to boolean: N)r"   )r@   r   r   r   	_str2bool   s
    rR   c             C   s2   | j  }x$|D ]}||krt|| ||< qW |S )zQReturn a new dictionary where string values are replaced with booleans (PRIVATE).)copyrR   )dctkeysoutkeyr   r   r   _dict_str2bool   s
    
rX   c             C   s*   | dk	r&yt | S  tk
r$   dS X dS )z$Return text as an integer (PRIVATE).N)int	Exception)r@   r   r   r   _int   s
    r[   c             C   s*   | dk	r&yt | S  tk
r$   dS X dS )z!Return text as a float (PRIVATE).N)floatrZ   )r@   r   r   r   _float  s
    r]   c             C   s   | dk	rdj | j S dS )a  Replace all spans of whitespace with a single space character (PRIVATE).

    Also remove leading and trailing whitespace. See "Collapse Whitespace
    Policy" in the phyloXML spec glossary:
    http://phyloxml.org/documentation/version_100/phyloxml.xsd.html#Glossary
    N )joinr7   )r@   r   r   r   _collapse_wspace
  s    r`   c             C   s&   x dD ]}|| kr| j |d} qW | S )zReplace tab, LF and CR characters with spaces, but don't collapse (PRIVATE).

    See "Replace Whitespace Policy" in the phyloXML spec glossary:
    http://phyloxml.org/documentation/version_100/phyloxml.xsd.html#Glossary
    	rF   r^   )ra   rF   rb   )replace)r@   charr   r   r   _replace_wspace  s    
re   c               @   s"  e Zd ZdZdd Zdd Zdd Zdd	 Zd
dddgZdddddZ	e
eje	j jddddgZdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Zd9d: Zd;d< Z d=d> Z!d?d@ Z"dAdB Z#dCdD Z$dES )Fr   a  Methods for parsing all phyloXML nodes from an XML stream.

    To minimize memory use, the tree of ElementTree parsing events is cleared
    after completing each phylogeny, clade, and top-level 'other' element.
    Elements below the clade level are kept in memory until parsing of the
    current clade is finished -- this shouldn't be a problem because clade is
    the only recursive element, and non-clade nodes below this level are of
    bounded size.
    c             C   s.   t tj|dd}t|\}}|| _|| _dS )zInitialize the class.startend)eventsN)rf   rg   )iterr   Z	iterparsenextr   context)selfr   rk   eventr   r   r   r   __init__-  s    zParser.__init__c       	      C   s   t jdd | jj D }d}x| jD ]\}}t|j\}}|dkrx|td krZ|d7 }q&|dkrx| j|}|j	j
| |dkr&|td kr&|d8 }|dkr&| j|||}|jj
| | jj  q&W |S )	z<Parse the phyloXML file and create a single Phyloxml object.c             S   s   i | ]\}}|t |qS r   )r5   )r&   rW   valr   r   r   
<dictcomp>7  s    zParser.read.<locals>.<dictcomp>r   rf   r
   r   	phylogenyrg   )r   r,   r   itemsrk   r8   r4   
NAMESPACES_parse_phylogenyr)   appendotherclear)	rl   phyloxmlZother_depthrm   rK   r9   localtagrq   otrr   r   r   r   5  s$    
zParser.readc             c   s>   t d}x0| jD ]&\}}|dkr|j|kr| j|V  qW dS )z@Parse the phyloXML file incrementally and return each phylogeny.rq   rf   N)r:   rk   r4   rt   )rl   Zphytagrm   rK   r   r   r   r   L  s    zParser.parsec             C   s:  t jf t|jddg}ddddd}x| jD ] \}}t|j\}}|dkrx|d	krx|jd
k	rjtd| j	||_q0|dkr0|dkr|j
  P ||krt||| jt| || q0|dkrt||t| || q0|dk rt||t|j q0|td kr&|jj| j||| |j
  q0td| q0W |S )a  Parse a single phylogeny within the phyloXML tree (PRIVATE).

        Recursively builds a phylogenetic tree with help from parse_clade, then
        clears the XML event history for the phylogeny element and returns
        control to the top-level parsing function.
        rooted
rerootableconfidences
propertiesclade_relationssequence_relations)
confidencepropertyclade_relationsequence_relationrf   cladeNz)Phylogeny object should only have 1 claderg   rq   dateidnamedescriptionr
   zMisidentified tag: )r   r   )r   r   )r   r   rX   attribrk   r8   r4   r   r"   _parse_claderw   getattrru   setattrr`   r@   rs   rv   r   )rl   r<   rq   Z
list_typesrm   rK   r9   r4   r   r   r   rt   U  s8    
 

zParser._parse_phylogenycolorrh   binary_charactersr   r}   distributions
referencesr~   )r   distribution	referencer   branch_lengthr   node_idwidthc             C   s  t jf |j}|jdk	r$t|j|_g }x| jD ]\}}t|j\}}|dkr|dkrn|jj	| j
| q2|dkr|jj	| j| q2|dkr|jj	| j| q2|| jkr|j	| |dkr2|dkr|j  P ||d krq2|j  || jkrt|| j| j	t| || q2|| jkr<t||t| || q2|dkrh|jdk	rZtd	t|j|_q2|d
krt|j|_q2|dkrt|j|_q2|dkrt j|jj |jjd|_q2|t d kr|j!j	| j!||| |j  q2td| q2W |S )z;Parse a Clade node and its children, recursively (PRIVATE).Nrf   r   taxonomysequencerg   r   r   z7Attribute branch_length was already set for this Clade.r   r   r   providerr
   zMisidentified tag: )"r   r   r   r   r\   rk   r8   r4   cladesru   r   
taxonomies_parse_taxonomy	sequences_parse_sequence_clade_tracked_tagsrw   pop_clade_list_typesr   _clade_complex_typesr   r   r]   r@   r   r`   r   IdrH   getr   rs   rv   )rl   r<   r   Z	tag_stackrm   rK   r9   r4   r   r   r   r     s^    







zParser._parse_cladec             C   s   t jf |j}x| jD ]\}}t|j\}}|dkr|dkrF|j  P |dkrft||t| || q|dkr|j	j
| j| q|dkrt|j|_q|dkrt|||j q|td kr|jj
| j||| |j  qW |S )z%Parse a molecular sequence (PRIVATE).rg   r   	accessionmol_seqr   domain_architecture
annotationr   symbollocationr
   )r   r   r   r   )r   r   )r   Sequencer   rk   r8   r4   rw   r   r   annotationsru   r   r`   r@   r   rs   rv   )rl   r<   r   rm   rK   r9   r4   r   r   r   r     s&    zParser._parse_sequencec             C   s   t jf |j}x| jD ]\}}t|j\}}|dkr|dkrF|j  P |dkrft||t| || q|dkr|j	j
t|j q|dkr|jj
|j q|dkrt|||j q|td kr|jj
| j||| |j  qW |S )z2Parse taxonomic information for a clade (PRIVATE).rg   r   r   r   common_namesynonymcodescientific_name	authorityrankr
   )r   r   )r   r   r   r   )r   ZTaxonomyr   rk   r8   r4   rw   r   r   common_namesru   r`   r@   synonymsrs   rv   )rl   r<   r   rm   rK   r9   r4   r   r   r   r     s&    zParser._parse_taxonomyc                s4   t j|||j|jr|jj pd fdd|D dS )z/Create an Other object, a non-phyloXML element.Nc                s"   g | ]} j |ft|j qS r   )rv   r8   r4   )r&   r>   )rl   r   r   rB     s    z Parser.other.<locals>.<listcomp>)valuechildren)r   ZOtherr   r@   rH   )rl   rK   r9   ry   r   )rl   r   rv     s    zParser.otherc             C   s   t j|jj |jdS )zCreate accession object.source)r   Z	Accessionr@   rH   r   )rl   rK   r   r   r   r     s    zParser.accessionc          	   C   sD   t jf tt|dt|d| jt|d| jt|d| jd|j	S )zCreate annotation object.descr   r   r   )r   r   r~   r   )
r   Z
Annotationr`   rA   r?   r   rD   r   r   r   )rl   rK   r   r   r   r     s    zParser.annotationc             C   sr   dd }t j|jdt|jdt|jdt|jdt|jdt|d|t|d	|t|d
|t|d|d	S )z Create binary characters object.c             S   s
   t | dS )z$Get binary characters from subnodes.bc)rE   )rK   r   r   r   	bc_getter  s    z+Parser.binary_characters.<locals>.bc_gettertypegained_count
lost_countpresent_countabsent_countgainedlostpresentabsent)	r   r   r   r   r   r   r   r   r   )r   ZBinaryCharactersr   r[   r?   )rl   rK   r   r   r   r   r     s    


zParser.binary_charactersc          	   C   s6   t j|jd|jd|jd|jdt|d| jdS )z!Create clade relationship object.r   id_ref_0id_ref_1distancer   )r   r   )r   ZCladeRelationr   r?   r   )rl   rK   r   r   r   r   &  s    zParser.clade_relationc                s&    fdddD \}}}t j|||S )zCreate branch color object.c             3   s   | ]}t  |tV  qd S )N)rA   rY   )r&   r   )rK   r   r   r(   3  s    zParser.color.<locals>.<genexpr>redgreenblue)r   r   r   )r   BranchColor)rl   rK   r   r   r   r   )rK   r   r   0  s    zParser.colorc             C   s   t jt|j|jdS )zCreate confidence object.r   )r   Z
Confidencer]   r@   r   )rl   rK   r   r   r   r   7  s    zParser.confidencec          	   C   s<   t j|jdtt|dt|dtt|dtt|dtdS )zCreate date object.unitr   r   minimummaximum)r   r   r   r   r   )r   Dater   r`   rA   r\   )rl   rK   r   r   r   r   ;  s    

zParser.datec             C   s.   t jtt|dt|d| jt|d| jdS )z&Create geographic distribution object.r   pointpolygon)r   pointspolygons)r   ZDistributionr`   rA   rD   r   r   )rl   rK   r   r   r   r   E  s    zParser.distributionc             C   sB   t j|jj t|jdd t|jdt|jd|jddS )zCreate protein domain object.fromr   tor   r   )r   r   )r   ZProteinDomainr@   rH   rY   r   r]   )rl   rK   r   r   r   domainM  s    zParser.domainc             C   s"   t jt|jdt|d| jdS )z"Create domain architecture object.lengthr   )r   domains)r   ZDomainArchitecturerY   r   rD   r   )rl   rK   r   r   r   r   W  s    zParser.domain_architecturec          	   C   s<   t jt|dt|dtt|dtt|dtt|d| jdS )zCreate events object.r   duplicationsspeciationslossesr   )r   r   r   r   r   )r   ZEventsrA   rY   r?   r   )rl   rK   r   r   r   rh   ^  s    


zParser.eventsc             C   s&   |j dp|j d}tj|jj |S )zCreate identifier object.r   r   )r   r   r   r@   rH   )rl   rK   r   r   r   r   r   h  s    z	Parser.idc             C   s.   |j d}|dk	rt|}tj|jj |dS )z!Create molecular sequence object.
is_alignedN)r   )r   rR   r   ZMolSeqr@   rH   )rl   rK   r   r   r   r   r   m  s    
zParser.mol_seqc             C   s8   t j|jdt|dtt|dtt|dt|jddS )z,Create point object, coordinates of a point.geodetic_datumlatlongaltalt_unit)r   r   )r   ZPointr   rA   r\   )rl   rK   r   r   r   r   t  s    


zParser.pointc             C   s   t jt|d| jdS )z&Create polygon object, list of points.r   )r   )r   ZPolygonrD   r   )rl   rK   r   r   r   r   ~  s    zParser.polygonc             C   s:   t j|jj |jd|jd|jd|jd|jddS )z*Create properties from external resources.ref
applies_todatatyper   id_ref)r   r   )r   ZPropertyr@   rH   r   )rl   rK   r   r   r   r     s    zParser.propertyc             C   s   t j|jdt|ddS )z#Create literature reference object.doir   )r   r   )r   Z	Referencer   rA   )rl   rK   r   r   r   r     s    zParser.referencec          	   C   s:   t j|jd|jd|jdt|jdt|d| jdS )zHCreate sequence relationship object, relationship between two sequences.r   r   r   r   r   )r   r   )r   ZSequenceRelationr   r]   r?   r   )rl   rK   r   r   r   r     s    zParser.sequence_relationc             C   s&   t j|jj t|jd|jddS )z(Create uri object, expected to be a url.r   r   )r   r   )r   ZUrir@   rH   r`   r   )rl   rK   r   r   r   r     s    z
Parser.uriN)%r   r   r   r   rn   r   r   rt   r   r   setunionrU   r   r   r   r   rv   r   r   r   r   r   r   r   r   r   r   rh   r   r   r   r   r   r   r   r   r   r   r   r   r   "  sH   		.
9






r   c             C   s4   t | trt| j S t | tr,t| j S t| S )zMConvert a Python primitive to a phyloXML-compatible Unicode string (PRIVATE).)r   r\   r   upperboollower)r   r   r   r   
_serialize  s
    

r   c             C   s4   i }x*|D ]"}t | |}|dk	r
t|||< q
W |S )zNCreate a dictionary from an object's specified, non-None attributes (PRIVATE).N)r   r   )r0   attrsrV   rW   ro   r   r   r   _clean_attrib  s    

r   Fc                s     fdd}d |_ |S )z2Handle to serialize nodes with subnodes (PRIVATE).c                s   t jt| }xpD ]h}t|trPt||dk	r|jt| |t|| q|\}}x&t||D ]}|jt| || qdW qW rt|j|_	|S )z$Wrap nodes and subnodes as elements.N)
r   Elementr   r   r   r   ru   r   r   r@   )rl   r0   rK   subnmethodZpluralitem)attribshas_textsubnodesr4   r   r   wrapped  s    

z _handle_complex.<locals>.wrappedz*Serialize a %s and its subnodes, in order.)r   )r4   r   r   r   r   r   )r   r   r   r4   r   _handle_complex  s    
r   c                s    fdd}d  |_ |S )z+Handle to serialize simple nodes (PRIVATE).c                s   t j }t||_|S )zWrap node as element.)r   r   r   r@   )rl   r0   rK   )r4   r   r   r     s    

z_handle_simple.<locals>.wrappedzSerialize a simple %s node.)r   )r4   r   r   )r4   r   _handle_simple  s    
r   c               @   s:  e Zd ZdZdd ZedfddZdd Zd	d
 Ze	ddhdnZ
e	ddodxZe	d.dyf dd0Ze	d1dzd|Zd6d7 Ze	dd}d~Ze	d!f dZe	ddf dd0Ze	dddZe	d)f dZdFdG Ze	dHddZe	d'f dZe	ddf dd0Ze	dPdf dd0Ze	d"df dd0Ze	dBddZe	dDf dZe	ddf dd0Ze	d+ddZe	d%ddZe	dddZe	d#ddZ e	d5df dd0Z!e"dVZ#e"dZ$e"dTZ%e"dUZ&e"dAZ'e"d@Z(e"d?Z)e"d Z*e"d=Z+e"dLZ,e"d<Z-e"dNZ.e"d;Z/e"dMZ0e"dfZ1e"d^Z2e"daZ3e"d4Z4e"dZ5e"d\Z6e"dZ7e"deZ8e"d_Z9e"d[Z:e"dcZ;e"dZ<dgS )r.   z1Methods for serializing a PhyloXML object to XML.c             C   s*   t |tjstdtj| j|| _dS )z,Build an ElementTree from a PhyloXML object.zNot a Phyloxml objectN)r   r   r,   AssertionErrorr   rx   _tree)rl   rx   r   r   r   rn     s    zWriter.__init__Tc             C   s.   |rt | jj  | jj|| t| jj S )zWrite PhyloXML to a file.)rI   r   Zgetrootr/   rG   )rl   r   r*   r+   r   r   r   r/     s    zWriter.writec             C   sR   t jd|j}x|jD ]}|j| j| qW x|jD ]}|j| j| q6W |S )z"Convert phyloxml to Etree element.rx   )r   r   
attributesr)   ru   rq   rv   )rl   r0   rK   r#   rz   r   r   r   rx     s    zWriter.phyloxmlc             C   sD   t jt|j|j|j}|j|_x|jD ]}|j	| j
| q(W |S )zConvert other to Etree element.)r   r   r:   r4   r9   r   r   r@   r   ru   rv   )rl   r0   rK   r>   r   r   r   rv     s
    zWriter.otherrq   r{   r|   branch_length_unitr   r   r   r   r   r   r}   r   r   r   r   r   r   r~   rv   	id_sourcer   r   r   r   r   r   r   r   rh   r   r   r   r   r   r   r   r   )r   r   r   evidencer   r   c          	   C   s\   t jdt|d}xDdD ]<}t j|}x"t||D ]}|j| j| q2W |j| qW |S )z4Serialize a binary_characters node and its subnodes.r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   )r   r   r   r   )r   r   r   r   ru   r   )rl   r0   rK   r   Zsubelemtokenr   r   r   r   3  s    

zWriter.binary_charactersr   r   r   r   r   r   r   r   r   r   r   r   r   r   c             C   sf   t jdt|jd t|jd}|jdk	r>|jdt|j |jdk	rV|jd|j t|j	|_
|S )zSerialize a domain node.r   r   )r   r   Nr   r   )r   r   strrf   rg   r   r   r   r   r   r@   )rl   r0   rK   r   r   r   r   Q  s    

zWriter.domainr   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   r   r   r   N)r{   r|   r   r   r   r}   r   r   r   r   r   r~   rv   rv   )
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   rv   rv   )r   r   r  r   r   r   r  r  rh   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   )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   r   r   r   r   )r  )r   r   r   r   r   )r   )r   )r   r   r   r   r   rv   rv   )	r   r   r   r   r   r   r  r   r  )r   r   r   r   )r   )r   r   r   r   r   rv   rv   )	r   r   r   r   r  r  r   r   r  )r   r   )=r   r   r   r   rn   DEFAULT_ENCODINGr/   rx   rv   r   rq   r   r   r   r   r   r   r   r   r   r   r   rh   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   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r.     s   		                        




                r.   )r   r   )r   r   )r   )F)1r   sys	Bio._py3kr   r   	Bio.Phylor   r   version_infoZ	xml.etreer   r	   ImportErrorrs   r   AttributeErrorr-   ZET_pyr   rr   r   r   r  rZ   r   r   r   r/   r5   r8   r:   r?   rA   rD   rE   rI   rR   rX   r[   r]   r`   re   objectr   r   r   r   r   r.   r   r   r   r   <module>   s`   "

+


				   
	

