ó
‚™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 Z d  d l	 Z	 d d „ Z
 e d k r‡ e
 d	 e j d
 ƒ n  d S(   iÿÿÿÿ(   t   division(   t   pdb(   t   Sorry(   t   multimerNs   phenix.pdb.biomt_reconstructionc         C   sE  t  |  ƒ d k r% t d d ƒ ‚ nd |  k s= d |  k rK t t ƒ GHnö t  |  ƒ d k rl t d ƒ ‚ nÕ t j j |  d ƒ s¬ d j |  d t j ƒ  ƒ GHt d	 ƒ ‚ n• t	 d
 |  d d d ƒ } | j
 d k r/t  |  ƒ d k r| j |  d ƒ d |  d GHqA| j ƒ  d GHt j ƒ  d | j GHn d j |  d ƒ GHd S(   s`   (string) -> file

  Reconstruction of the biological assembly multimer by applying
  BIOMT transformation, from the REMARK 350 in the pdb file, to all chains in file.

  Produce a new pdb file containg the biological assembly multimer information

  Arguments:
  args: a string containing the pdb file name, 'file_name.pdb' and an optional output file name
        if no file name is given, the output file will have the name 'biological_assembly_file_name.pdb'

  >>> phenix.pdb.biomt_reconstruction input_file_name.pdb
  bio-assembly reconstructed pdb file was added to your current directory
  /path/biological_assembly_input_file_name.pdb

   >>> phenix.pdb.biomt_reconstruction input_file_name.pdb output_file_name.pdb
  bio-assembly reconstructed pdb file was added to your current directory
  /path/output_file_name.pdb

  @author: Youval Dar (LBL 2013)
  i    s=   No input filename is given. Please provide a pdb file name. 
s7   >>> phenix.pdb.biomt_reconstruction input_file_name.pdbs   --helps   -hi   s"   To many input parameters are givens1   There is no file {} in the current directory 
 {}s   File name errort	   file_namet   reconstruction_typet   bai   s+   $s file was added to your current directorysG   bio-assembly reconstructed pdb file was added to your current directoryt   /s   No BIOMT information in {}N(   t   lenR   t   helpt   biomt_reconstructiont   ost   patht   isfilet   formatt   getcwdR   t   number_of_transformst   writet   pdb_output_file_name(   t   argst   command_namet   m(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/biomt_reconstruction.pyR
   	   s&    
t   __main__R   i   (   t
   __future__R    t   iotbxR   t   libtbx.utilsR   t!   iotbx.pdb.multimer_reconstructionR   t   sysR   R
   t   __name__t   argv(    (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/biomt_reconstruction.pyt   <module>   s   0