ó
7xTc           @   so   d  Z  d d l m Z d d l m Z d d l m Z d d l Z d   Z e	 d k rk e e j
 d  n  d S(	   s[   
Construct all subgroup graphs and their relations between them from a single space group.
i˙˙˙˙(   t   division(   t   sgtbx(   t   pointgroup_toolsNc         C   sü   t  j |   j   } t  j d  j   } t j | | t t  } | j j   d } | d 7} | d 7} xm | j j	 D]_ } xV | j j
 | D]D } | j d d  } | j d d  } | d | d | d 7} q Wqv W| d	 7} d
 | } Hd GH| GHd  S(   Nt   p1t    s   digraph f { s
   rankdir=LRs   "s   ''s   " -> "s   " ;t   }s)   dot -Tpng > sg_graph.png << EOF
%s
EOF
  sE   Command for dot (graphviz package) to show relations between groups: (   R   t   space_group_infot   groupR   t   point_group_grapht   Falset   Truet   grapht   showt   node_objectst   edge_objectst   replace(   t   sg1t   sg_hight   sg_lowt   graph_objectt   outt   pgt   next_pgt   cmnd(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/sub_group_graph.pyt   run   s"    

"

t   __main__i   (   t   __doc__t
   __future__R    t   cctbxR   t   cctbx.sgtbxR   t   sysR   t   __name__t   argv(    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/examples/sub_group_graph.pyt   <module>   s   	