o
    Rŀg	                     @   s*   d Z ddlmZ G dd dZdd ZdS )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                   @   s*   e Zd ZdZd	ddZdd Zdd ZdS )
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                 C   s(   d| _ g | _d| _|r| | dS dS )zInitialize the class. N)sidresidues	hierarchy_process)selfline r   @/var/www/html/myenv/lib/python3.10/site-packages/Bio/SCOP/Dom.py__init__   s   zRecord.__init__c                 C   sR   |  }|d}t|dkrtd| |\| _}}| _t|| _|| j_dS )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   resr   r   r   r   $   s   

zRecord._processc                 C   sB   g }| | j | t| jdd | | j d|d S )z;Represent the SCOP domain record as a tab-separated string. r   
)appendr   strr   replacer   join)r	   sr   r   r   __str__9   s
   zRecord.__str__)N)__name__
__module____qualname____doc__r   r   r   r   r   r   r   r      s
    
	r   c                 c   s&    | D ]}| drqt|V  qdS )zoIterate over a DOM file as a Dom record for each line.

    Arguments:
     - handle -- file-like object.

    #N)
startswithr   )handler
   r   r   r   parseB   s   
r&   N)r"   r   r   r&   r   r   r   r   <module>   s   0