
    {Ti	                     .    d Z ddlmZ  G d d      Zd Zy)a  Handle the SCOP DOMain file.

The DOM file has been officially deprecated. For more information see
the SCOP"release notes.":http://scop.berkeley.edu/release-notes-1.55.html
The DOM files for older releases can be found
"elsewhere at SCOP.":http://scop.mrc-lmb.cam.ac.uk/scop/parse/
   )Residuesc                   $    e Zd ZdZddZd Zd Zy)RecordzHolds information for one SCOP domain.

    Attributes:
     - sid - The SCOP ID of the entry, e.g. d1anu1
     - residues - The domain definition as a Residues object
     - hierarchy - A string specifying where this domain is in the hierarchy.

    Nc                 V    d| _         g | _        d| _        |r| j                  |       yy)zInitialize the class. N)sidresidues	hierarchy_process)selflines     ?/home/agent/.local/lib/python3.12/site-packages/Bio/SCOP/Dom.py__init__zRecord.__init__   s+    MM$     c                     |j                         }|j                  d      }t        |      dk7  rt        d|       |\  | _        }}| _        t        |      | _        || j                  _        y)zParse DOM records (PRIVATE).

        Records consist of 4 tab deliminated fields;
        sid, pdbid, residues, hierarchy
        	   z!I don't understand the format of N)	rstripsplitlen
ValueErrorr   r
   r   r	   pdbid)r   r   columnsr   ress        r   r   zRecord._process$   se     {{}**T"w<1@GHH/6,%dn #r   c                    g }|j                  | j                         |j                  t        | j                        j	                  dd             |j                  | j
                         dj                  |      dz   S )z;Represent the SCOP domain record as a tab-separated string. r   
)appendr   strr	   replacer
   join)r   ss     r   __str__zRecord.__str__9   s\    		T]]#++C67	 yy|d""r   )N)__name__
__module____qualname____doc__r   r   r#    r   r   r   r      s     $*#r   r   c              #   X   K   | D ]!  }|j                  d      rt        |       # yw)zoIterate over a DOM file as a Dom record for each line.

    Arguments:
     - handle -- file-like object.

    #N)
startswithr   )handler   s     r   parser-   B   s0       ??3Tls   (*N)r'   r   r   r-   r(   r   r   <module>r.      s    -# -#`
r   