B
    b                 @   s0   d Z ddlmZ ddlmZ G dd deZdS )z'Model class, used in Structure objects.    )Entity)IC_Chainc               @   s^   e Zd ZdZd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 )ModelzThe object representing a model in a structure.

    In a structure derived from an X-ray crystallography experiment,
    only a single model will be present (with some exceptions). NMR
    structures normally contain many different models.
    Nc             C   s,   d| _ |dkr|| _n|| _t| | dS )zYInitialize.

        Arguments:
         - id - int
         - serial_num - int

        MN)level
serial_numr   __init__)selfidr    r   ,lib/python3.7/site-packages/Bio/PDB/Model.pyr      s
    zModel.__init__c             C   s   d|    S )zReturn model identifier.z<Model id=%s>)Zget_id)r	   r   r   r   __repr__$   s    zModel.__repr__c             c   s   | E dH  dS )zReturn chains.Nr   )r	   r   r   r   
get_chains(   s    zModel.get_chainsc             c   s    x|   D ]}|E dH  q
W dS )zReturn residues.N)r   )r	   cr   r   r   get_residues,   s    zModel.get_residuesc             c   s    x|   D ]}|E dH  q
W dS )zReturn atoms.N)r   )r	   rr   r   r   	get_atoms1   s    zModel.get_atomsF)verbosereturnc             C   s    x|   D ]}|| q
W dS )zCreate/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   6   s    z"Model.atom_to_internal_coordinatesc             C   s    x|   D ]}|| q
W dS )zCreate/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   A   s    z"Model.internal_to_atom_coordinates)N)F)F)__name__
__module____qualname____doc__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   