
    {Ti                     "    d Z  G d d      Zd Zy)a  Handle the SCOP HIErarchy files.

The SCOP Hierarchy files describe the SCOP hierarchy in terms of SCOP
unique identifiers (sunid).

The file format is described in the SCOP `release notes
<http://scop.berkeley.edu/release-notes-1.55.html>`_.

The latest HIE file can be found `elsewhere at SCOP
<http://scop.mrc-lmb.cam.ac.uk/scop/parse/>`_.

`Release 1.55 <http://scop.berkeley.edu/parse/dir.hie.scop.txt_1.55>`_
(July 2001).
c                   $    e Zd ZdZddZd Zd Zy)RecordzHolds information for one node in the SCOP hierarchy.

    Attributes:
     - sunid - SCOP unique identifiers of this node
     - parent - Parents sunid
     - children - Sequence of children sunids

    Nc                 V    d| _         d| _        g | _        |r| j                  |       yy)zInitialize the class. N)sunidparentchildren_process)selflines     ?/home/agent/.local/lib/python3.12/site-packages/Bio/SCOP/Hie.py__init__zRecord.__init__!   s+    
MM$     c                    |j                         }|j                  d      }t        |      dk7  rt        d|       |\  }}}|dk(  rd| _        nt        |      | _        |dk(  rd| _        nt        |      | _        |dk(  rd| _        y|j                  d      }|D cg c]  }t        |       c}| _        yc c}w )	zParse HIE records (PRIVATE).

        Records consist of 3 tab deliminated fields; node's sunid,
        parent's sunid, and a list of children's sunids.
        	   z!I don't understand the format of -r    ,N)rstripsplitlen
ValueErrorr   intr   r   )r
   r   columnsr   r   r   xs          r   r	   zRecord._process)   s     {{}**T"w<1@GHH")vxC<DJUDJS=DKf+DKs?DM~~c*H-56SV6DM6s    B;c                    g }|j                  t        | j                               | j                  r%|j                  t        | j                               n2| j                  dk7  r|j                  d       n|j                  d       | j                  r2|j                  dj                  d | j                  D                     n|j                  d       dj                  |      dz   S )z0Represent the SCOP hierarchy record as a string.    0r   r   c              3   2   K   | ]  }t        |        y wN)str).0r   s     r   	<genexpr>z!Record.__str__.<locals>.<genexpr>Y   s     <c!f<s   r   
)appendr!   r   r   r   join)r
   ss     r   __str__zRecord.__str__K   s    	TZZ!;;HHS%&zzQ==HHSXX<dmm<<=HHSMyy|d""r   r    )__name__
__module____qualname____doc__r   r	   r(   r   r   r   r   r      s      7D#r   r   c              #   X   K   | D ]!  }|j                  d      rt        |       # yw)zmIterate over a HIE file as Hie records for each line.

    Arguments:
     - handle - file-like object.

    #N)
startswithr   )handler   s     r   parser1   `   s0       ??3Tls   (*N)r,   r   r1   r   r   r   <module>r2      s   "F# F#R
r   