ó
ĘďLc           @   s0   d  Z  d d l m Z d e f d     YZ d S(   s'   Model class, used in Structure objects.i˙˙˙˙(   t   Entityt   Modelc           B   s>   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z RS(   sü   
    The 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. 
    c         C   s>   d |  _  | d k r! | |  _ n	 | |  _ t j |  |  d S(   sJ   
        Arguments:
        o id - int
        o serial_num - int
        t   MN(   t   levelt   Nonet
   serial_numR    t   __init__(   t   selft   idR   (    (    s.   C:\Python27\Lib\site-packages\Bio\PDB\Model.pyR      s
    		c         C   s_   | j    } | j    } | d k r5 | d k r5 d S| d k rR | d k rR d St | |  S(   s  Sort the Chains instances in the Model instance.

        Chain instances are sorted alphabetically according to
        their chain id. Blank chains come last, as they often consist
        of waters.

        Arguments:
        o c1, c2 - Chain objects
        t    i   i˙˙˙˙(   t   get_idt   cmp(   R   t   c1t   c2t   id1t   id2(    (    s.   C:\Python27\Lib\site-packages\Bio\PDB\Model.pyt   _sort#   s    
c         C   s   d |  j    S(   Ns   <Model id=%s>(   R
   (   R   (    (    s.   C:\Python27\Lib\site-packages\Bio\PDB\Model.pyt   __repr__8   s    c         c   s+   x$ |  D] } x | D] } | Vq Wq Wd  S(   N(    (   R   t   ct   r(    (    s.   C:\Python27\Lib\site-packages\Bio\PDB\Model.pyt   get_residues=   s    c         c   s1   x* |  j    D] } x | D] } | Vq Wq Wd  S(   N(   R   (   R   R   t   a(    (    s.   C:\Python27\Lib\site-packages\Bio\PDB\Model.pyt	   get_atomsB   s    N(	   t   __name__t
   __module__t   __doc__R   R   R   R   R   R   (    (    (    s.   C:\Python27\Lib\site-packages\Bio\PDB\Model.pyR      s   			N(   R   t   Bio.PDB.EntityR    R   (    (    (    s.   C:\Python27\Lib\site-packages\Bio\PDB\Model.pyt   <module>   s   