ó
ö6Ec           @   sŪ   d  d l  Z  d  d l m Z e  j d  Z d d d     YZ d   Z e d k rŠ d  d l m	 Z	 d  d l
 Z
 e	   Z e j d	 e
 j d
  Z e e d d
 d d  n  d S(   iĸĸĸĸN(   t   PDBIOs
   [123 ]*H.*t   ChainSelectorc           B   s>   e  Z d  Z d d  Z d   Z d   Z d   Z d   Z RS(   s   
    Only accepts residues with right chainid
    and between start and end. Remove hydrogens, waters and ligands.
    Only use model 0 by default.
    i    c         C   s(   | |  _  | |  _ | |  _ d |  _ d  S(   Ni    (   t   chain_idt   startt   endt   model_id(   t   selfR   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/Dice.pyt   __init__   s    			c         C   s   | j    |  j k r d Sd S(   Ni   i    (   t   get_idR   (   R   t   model(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Dice.pyt   accept_model   s    c         C   s   | j    |  j k r d Sd S(   Ni   i    (   R   R   (   R   t   chain(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Dice.pyt   accept_chain    s    c         C   sm   | j    \ } } } | d k r% d S| d k rC d G| j    GHn  |  j | k o` |  j k n ri d Sd S(   Nt    i    s   WARNING: Icode at i   (   R   R   R   (   R   t   residuet   hetatm_flagt   resseqt   icode(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Dice.pyt   accept_residue%   s    "c         C   s'   | j    } t j |  r d Sd Sd  S(   Ni    i   (   R   t	   _hydrogent   match(   R   t   atomt   name(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Dice.pyt   accept_atom1   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/Dice.pyR      s   			c         C   s<   t  | | |  } t   } | j |   | j | |  d S(   s1   
    Write out selected portion to filename.
    N(   R   R    t   set_structuret   save(   t	   structureR   R   R   t   filenamet   selt   io(    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Dice.pyt   extract:   s    	t   __main__(   t	   PDBParsert   scri   R   id   s   out.pdb(    (   t   ret   Bio.PDB.PDBIOR    t   compileR   R   R!   R   t   Bio.PDB.PDBParserR#   t   syst   pt   get_structuret   argvt   s(    (    (    s   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/PDB/Dice.pyt   <module>   s   ,		