ó
ďIc           @   s<   d  d l  Z  d  d l m Z d Z d e f d     YZ d S(   i˙˙˙˙N(   t   Entitys'   Model class, used in Structure objects.t   Modelc           B   s;   e  Z d  Z 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 |  _  t j |  |  d S(   s/   
        Arguments:
        o id - int
        t   MN(   t   levelR    t   __init__(   t   selft   id(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/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   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Model.pyt   _sort    s    
c         C   s   d |  j    S(   Ns   <Model id=%s>(   R   (   R   (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Model.pyt   __repr__5   s    c         c   s+   x$ |  D] } x | D] } | Vq Wq Wd  S(   N(    (   R   t   ct   r(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/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   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Model.pyt	   get_atoms?   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   R   (    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Model.pyR      s   	
			(   t   osR    R   R   (    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Model.pyt   <module>   s   