B
    ‰°b  ã               @   s0   d Z ddlmZ ddlmZ G dd„ deƒZdS )z=The structure class, representing a macromolecular structure.é    )ÚEntity)ÚIC_Chainc               @   sd   e Zd ZdZdd„ Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Z	de
ddœdd„Zde
ddœdd„ZdS )Ú	Structurez=The Structure class contains a collection of Model instances.c             C   s   d| _ t | |¡ dS )zInitialize the class.ÚSN)Úlevelr   Ú__init__)ÚselfÚid© r
   ú0lib/python3.7/site-packages/Bio/PDB/Structure.pyr      s    zStructure.__init__c             C   s   d|   ¡  S )z Return the structure identifier.z<Structure id=%s>)Zget_id)r   r
   r
   r   Ú__repr__   s    zStructure.__repr__c             c   s   | E dH  dS )zReturn models.Nr
   )r   r
   r
   r   Ú
get_models   s    zStructure.get_modelsc             c   s    x|   ¡ D ]}|E dH  q
W dS )zReturn chains from models.N)r   )r   Úmr
   r
   r   Ú
get_chains   s    zStructure.get_chainsc             c   s    x|   ¡ D ]}|E dH  q
W dS )zReturn residues from chains.N)r   )r   Úcr
   r
   r   Úget_residues#   s    zStructure.get_residuesc             c   s    x|   ¡ D ]}|E dH  q
W dS )zReturn atoms from residue.N)r   )r   Úrr
   r
   r   Ú	get_atoms(   s    zStructure.get_atomsFN)ÚverboseÚreturnc             C   s    x|   ¡ D ]}| |¡ q
W dS )zåCreate/update internal coordinates from Atom X,Y,Z coordinates.

        Internal coordinates are bond length, angle and dihedral angles.

        :param verbose bool: default False
            describe runtime problems

        N)r   Úatom_to_internal_coordinates)r   r   Úchnr
   r
   r   r   -   s    	z&Structure.atom_to_internal_coordinatesc             C   s    x|   ¡ D ]}| |¡ q
W dS )zÚCreate/update atom coordinates from internal coordinates.

        :param verbose bool: default False
            describe runtime problems

        :raises Exception: if any chain does not have .pic attribute
        N)r   Úinternal_to_atom_coordinates)r   r   r   r
   r
   r   r   9   s    z&Structure.internal_to_atom_coordinates)F)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   Úboolr   r   r
   r
   r
   r   r      s   r   N)r   ZBio.PDB.Entityr   ZBio.PDB.internal_coordsr   r   r
   r
   r
   r   Ú<module>   s   