ó
‚™xTc           @   s¨   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d  d l m	 Z	 d  d l
 m Z d  d l Z d  d l Z d d	 „ Z e d
 k r¤ e e j d ƒ n  d S(   iÿÿÿÿ(   t   division(   t   pdb(   t   option_parser(   t   flex(   t   show_string(   t   easy_pickleNs   iotbx.pdb.as_xray_structurec         C   s   t  d | d d d | ƒ j ƒ  j d  d d d d t d	 d
 ƒj d  d d d d t d	 d ƒj d d d d d t d	 d ƒj d  d d d d d d	 d d d ƒj d  d d d d d d	 d d d ƒj d |  ƒ } t | j ƒ d k rö | j j	 ƒ  n  | j
 } | j } g  } x9| j D].} d G| GHt j j ƒ  t j d | ƒ } | j d | j d  | j d! | j ƒ } | j ƒ  | j ƒ  j ƒ  d k r¯| j d" | j ƒ  j ƒ  ƒ n  | j ƒ  j d# t ƒ | j rÛ| j ƒ  n  | d  k	 r8| d k r8t | j  d$ | d% t ƒ j! ƒ  ƒ }	 |	 j" d& t# j$ |	 j% ƒ  ƒ ƒ }	 |	 j& d' d( d) d  ƒ }
 |	 j' d* d+ ƒ } | j( d, |
 d* d- ƒ | j) ƒ  } d. | t* | ƒ f } t# j+ d/ g ƒ } x1 t | ƒ d k rß| j, | d0  ƒ | d0 } q¯W| j- d1 | ƒ | j ƒ  t. j/ j0 | ƒ j1 d2 d3 ƒ d4 } d5 G| GH| j2 d | ƒ n  | j, | ƒ HqW| j3 } | d  k	 rt | ƒ d k r| d2 k r½t | j ƒ d6 k r¡t4 d7 ƒ ‚ n  t. j/ j0 | j d ƒ } n  | j5 ƒ  j6 d8 ƒ sß| d8 7} n  t | ƒ d6 k rþ| d } n Hd9 G| GHt7 j8 | | ƒ Hn  d  S(:   Nt   usages    [options] pdb_file ...t   descriptions   Example: %s pdb1ab1.ents   --weak_symmetryt   actiont
   store_truet   defaultt   helps?   symmetry on command line is weaker than symmetry found in filess   --ignore_occ_for_site_symmetrys?   disables non_unit_occupancy_implies_min_distance_sym_equiv_zeros   -vs	   --verboses   show scattererss   --picklet   storet   typet   strings?   write all data to FILE ('--pickle .' copies name of input file)t   metavart   FILEs#   --fake_f_obs_and_r_free_flags_d_mint   floats;   write F-calc as F-obs, add random R-free flags (MTZ format)t   FLOATt   argsi    s
   file_name:t	   file_namet   crystal_symmetryt   weak_symmetryt6   non_unit_occupancy_implies_min_distance_sym_equiv_zerot   sites_cart_originalt   show_gaussianst   d_mint   anomalous_flagt   sigmast   fractiongš™™™™™©?t   max_freet   column_root_labels   F-obst   miller_arrays   R-free-flagss   %s %ss   Fake F-obs, R-free-flagsiM   t   linest   .t   _s	   _fake.mtzs   Writing file:i   s:   Ambiguous name for pickle file (more than one input file).s   .pickles$   Writing all xray structures to file:(9   R   t   enable_symmetry_comprehensivet   optiont   Nonet   Falset   processt   lenR   t   parsert	   show_helpt   optionst!   fake_f_obs_and_r_free_flags_d_mint   syst   stdoutt   flushR   t   inputt   xray_structure_simplet   symmetryR   t   ignore_occ_for_site_symmetryt   show_summaryt   special_position_indicest   sizet   show_special_position_shiftst   atomst   extract_xyzt   scattering_type_registryt   showt   verboset   show_scattererst   abst   structure_factorst   f_calct   customized_copyR   t   sqrtt   datat   generate_r_free_flagst   as_mtz_datasett   add_miller_arrayt
   mtz_objectR   t
   std_stringt   appendt   add_historyt   ost   patht   basenamet   replacet   writet   picklet   Sorryt   lowert   endswithR   t   dump(   R   t   command_namet   command_linet   coR   t   all_structuresR   t   pdb_inpt	   structuret   f_obst   r_free_flagst   mtz_datasetRH   t   historyR!   t   mtz_file_namet   pickle_file_name(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/pdb.as_xray_structure.pyt   run	   s¨    
																
		!	
			t   __main__i   (   t
   __future__R    t   iotbxR   t   iotbx.option_parserR   t   cctbx.array_familyR   t   libtbx.str_utilsR   t   libtbxR   R.   RL   Rb   t   __name__t   argv(    (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/pdb.as_xray_structure.pyt   <module>   s   Y