ó
Ñ%�Tc           @   sø  d  Z  d d l m Z m Z m Z m Z m Z m Z m Z m	 Z	 m
 Z
 m Z m Z m Z m Z e Z d „  Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z m Z m Z m Z d d l m Z m Z d d	 l m Z m  Z  m! Z! d d
 l" m# Z# d d l$ m% Z% m& Z& m' Z' m( Z( m) Z) d d l* m+ Z+ d d l, m, Z, d d l- m. Z. d d l* m/ Z/ d d l0 m1 Z1 e j2 j3 e j2 j4 e5 ƒ ƒ Z6 d Z7 d Z8 d Z9 d Z: d Z; d Z< d Z= d Z> d Z? d Z@ d ZA d d d „  ƒ  YZB d S(   sC   A class for the graphical interface used to trace the RNA backbone.iÿÿÿÿ(   t   imol_refinement_mapt   new_generic_object_numbert   set_display_generic_objectt   close_generic_objectt   graphics_drawt   set_rotation_centret   to_generic_object_add_linet   rotation_centre_positiont   is_closed_generic_object_pt   show_select_map_dialogt   zoom_factort   screen_vectors_pyt   add_status_bar_textc           C   s   t  d ƒ t  d ƒ t  d ƒ g S(   Ni    i   i   (   R   (    (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   rotation_centre   s    N(   t   deepcopy(   t   NextPhos(   t   plust   minust   rotateAtomst   dist(   t   determineRotamerSeqt   determinePucker(   t
   calcCoordst   recalcCoordst   buildOnlyPhosOxy(   t   ReviewSuitesGui(   t   buttonWithIcont   HBOX_SPACINGt   VBOX_SPACINGt   BUTTON_SPACINGt   createRCraneWindowObject(   t   PseudoMolecule(   t   selectMapDialog(   t   createCitationPopup(   t   CONNECTED_DISTANCE_CUTOFF(   t   STANDARD_BASESg333333Ó?t   greengš™™™™™É?t   cyans   Candidate phosphate positionss   Candidate C1' positionst   oranges   Currently Selected Peaks$   Manually adjusted phosphate positiong      ø?t   TraceGuic           B   s   e  Z d  Z d e e e d „ Z d „  Z e e e e d „ Z d „  Z e d „ Z e e e e d „ Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! d  „  Z" d! „  Z# d" „  Z$ d# „  Z% d$ „  Z& d% „  Z' d& „  Z( d' „  Z) d( „  Z* d) „  Z+ d* „  Z, d+ „  Z- d, „  Z. d- „  Z/ d. „  Z0 d/ „  Z1 d0 „  Z2 d1 „  Z3 d2 „  Z4 d3 „  Z5 d4 „  Z6 RS(5   sC   A class for the graphical interface used to trace the RNA backbone.i   c         C   sù  | d k	 r t ƒ  n  | d k r. t ƒ  } n  | rI | |  _ | |  _ n t ƒ  |  _ d |  _ | |  _ t d t j	 j
 t d ƒ d t j	 j
 t d ƒ d t j	 j
 t d ƒ d t j	 j
 t d ƒ d	 t j	 j
 t d
 ƒ ƒ |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d d d g |  _ d d d g |  _  d d d g |  _! d |  _" d |  _# t$ |  _% | d k rë|  j& | ƒ n
 |  j' ƒ  d S(   s‡  Initialize a TraceGui object and create a GUI for tracing a molecule        
        
        OPTIONAL ARGUMENTS:
            direction      - which direction to trace the chain: 3 implies 5'->3'
                                                                 5 implies 3'->5'
                             defaults to 3 (5'->3')
            curCoords      - the current (x,y,z) coordinates for where to start building
                             if not given, the screen center is used
            existingMolecule - an existing molecule to extend
                               if given, must also give resToExtend
            resIndexToExtend - the residue of existingMolecule to extend from
                               if given, must also give existingMolecule
        RETURNS:
            an initialized gui object
        EFFECTS:
            Creates and displays an RCrane dialog box
        t   phosDistFilenames   data/phosDistSmoothed.csvt   phosAngleFilenames   data/phosAngleSmoothed.csvt   sugarPhosSugarAngleFilenames$   data/sugarPhosSugarAngleSmoothed.csvt   basesFilenames   data/bases.pdbt   pseudoChiFilenames   data/pseudoChiSmoothed.csvi    t   CN((   t   NoneR!   R   t   _TraceGui__pseudoMoleculet   _TraceGui__resIndexToExtendR   t   _TraceGui__directionR   t   ost   patht   joint   srcPatht   _TraceGui__nextPhost   _TraceGui__candidatePhosphatest    _TraceGui__currentPhosphateIndext   _TraceGui__candidateC1st   _TraceGui__currentC1Indext   _TraceGui__candidateBasest   _TraceGui__baseTypet   _TraceGui__candidatePhosObjectt   _TraceGui__candidateC1Objectt   _TraceGui__batonObjectt   _TraceGui__customPhosphatet   _TraceGui__customBaset   _TraceGui__customPhosObjectt   _TraceGui__adjustPhosOrigt   _TraceGui__adjustPhosWindowt   _TraceGui__adjustBaseOrigt   _TraceGui__adjustBaseWindowt   _TraceGui__translatedPhosCoordst   _TraceGui__adjustedBaseCoordst%   _TraceGui__previousPhosTranslateValuet%   _TraceGui__previousBaseTranslateValuet"   _TraceGui__previousBaseRotateValuet%   _TraceGui__previousBaseRotateValueChit   _TraceGui__deleteHandlerIDt   Falset   _TraceGui__tracedInitialPhost   selectInitialPhost   _TraceGui__extendChainSetup(   t   selft	   directiont	   curCoordst   existingMoleculet   resIndexToExtend(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __init__=   sT    
																								c            sJ  t  ƒ  } | d k r1 d GHt ‡  f d †  ƒ d St ƒ  } | j d |  j ƒ |  _ t j d ƒ } | j t j	 ƒ | j
 | ƒ | j ƒ  x t j ƒ  r§ t j t ƒ q‹ W|  j j | ˆ  ƒ |  _ |  j ƒ  |  j |  j d ƒ t j d ƒ } t d	 d
 ƒ } t d d ƒ } t j d ƒ } t d d ƒ }	 t d d ƒ }
 | j d |  j ƒ | j d |  j ƒ | j d |  j | ƒ |	 j d |  j | ƒ |
 j d |  j | ƒ t j t d ƒ } | j | ƒ | j
 | ƒ | j d d ƒ t j ƒ  } | j | t t d ƒ t j t d ƒ } | j
 | ƒ | j | t t t  ƒ t j! t" t  ƒ } | j | t" t" t# ƒ | j | t" t" t# ƒ | j | t t t# ƒ t j! t d ƒ } | j | t" t t# ƒ | j | t t t# ƒ t j$ ƒ  } | j | ƒ t j! t t  ƒ } | j |	 t" t t# ƒ | j |
 t" t t# ƒ | j | t t t# ƒ |	 j% ƒ  | j ƒ  d S(   sû  Create a GUI for building the initial phosphate
        
        ARGUMENTS:
           curCoords - the current (x,y,z) coordinates for where to start building
        RETURNS:
           none
        EFFECTS:
           creates a GUI for building the initial phosphate for a chain trace
        REQUIREMENTS:
           a refinement map must be selected (i.e. imol_refinement_map must return a valid map ID)
               otherwise this function will display a map selection dialog and then return
        iÿÿÿÿs)   No refinement map set for RCrane buildingc              s
   t  ˆ  ƒ S(   N(   R'   (    (   RT   (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   <lambda>±   s    Nt   delete_eventsH   
  Calculating potential phosphate coordinates...  

  Please wait...  
i    s&     Select starting phophate location:  s     Next  s   gtk-media-nexts     Previous  s   gtk-media-previouss     Manually Adjust  s
     Accept  s   gtk-oks
     Cancel  s
   gtk-cancelt   clickedi   i   i   (&   R    R    R   t   connectt   _TraceGui__initialPhosCloseWinRM   t   gtkt   Labelt   set_justifyt   JUSTIFY_CENTERt   addt   show_allt   events_pendingt   main_iterationRN   R6   t	   firstPhosR7   t   _TraceGui__drawPhosPeakst   _TraceGui__drawBoxR   t   Buttont   _TraceGui__initialPhosNextt   _TraceGui__initialPhosPrevioust(   _TraceGui__createAdjustInitialPhosDialogt   _TraceGui__initialPhosAcceptt   _TraceGui__initialPhosCancelt   VBoxt   removet   resizet   Framet
   pack_startR   t   HBoxt   TrueR   t
   HSeparatort
   grab_focus(   RR   RT   t   mapNumt   windowt	   waitLabelt   topLabelt
   nextButtont   previousButtont   adjustButtont   acceptButtont   cancelButtont	   windowBoxt   framet   frameBoxt   nextPrevBoxt	   adjustBoxt	   separatort   acceptCancelBox(    (   RT   sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyRP   ›   sf    		


c   ;      C   sÇ  t  ƒ  } | d3 k r! t ƒ  } n) | j ƒ  } | j | ƒ | j |  j ƒ | j d |  j ƒ |  _ t	 j
 d ƒ } | j t	 j ƒ | j | ƒ | j ƒ  x t	 j ƒ  r· t	 j t ƒ q› W|  j d3 k rõ |  j d k rì |  j j ƒ  d } qd } n |  j j } d3 }	 d3 }
 d3 } |  j d k rŠ|  j j | ƒ }	 |  j j | ƒ sX|  j ƒ  d k rë|  j j | d ƒ }
 |  j j | d ƒ } qëna |  j j | ƒ }	 |  j j | ƒ sÀ|  j ƒ  d k rë|  j j | ƒ }
 |  j j | d ƒ } n  | d3 k r!|  j j | |	 |  j ƒ \ |  _ |  _ n- |  j j  | |	 | |
 |  j ƒ \ |  _ |  _ d g t! |  j ƒ |  _" g  |  _# x. |  j D]# } |  j# j$ d3 g t! | ƒ ƒ qzW|  j% ƒ  d3 |  _& d3 |  _' | d3 k	 rÕ| |  _( n  d |  _) | d3 k	 sö| d3 k	 r| d3 k	 r| } n
 | d } x• t* |  j ƒ D]U \ } } | d | d k r%| d | d k r%| d | d k r%| |  _) Pq%q%W| |  _& |  j( t+ | ƒ g |  _' |  j' d d =| d3 k r‰|  j& d3 k r‰| d } xš t* |  j |  j) ƒ D]\ \ } } | d | d k ré| d | d k ré| d | d k ré| |  j" |  j) <PqéqéW|  j( t+ | ƒ g |  _' |  j' d d =|  j, ƒ  q‰n
 |  j, ƒ  |  j) } |  j" |  j) } |  j j- | |  j | | |	 |  j | |  j( |  j ƒ |  j# | | <| d3 k	 r¢|  j' d3 k r¢xž |  j# | | d j. ƒ  D]~ \ } } | | d | d k sq| | d | d k sq| | d | d k r|  j( t+ | ƒ g |  _' |  j' d d =PqqWn  d3 } d3 } d3 } |  j& d3 k rÓ|  j | } n |  j& } |  j/ | ƒ |  j' d3 k r|  j | | } |  j# | | } n |  j' d d } |  j' } |  j0 |	 | | | ƒ t	 j
 d	 ƒ } t1 d
 d ƒ } t1 d d ƒ } t	 j2 d ƒ } t1 d d ƒ } t1 d d ƒ } t	 j2 d ƒ } t	 j3 ƒ  } | j4 d ƒ | j4 d ƒ | j4 d ƒ | j4 d ƒ i d d 6d d 6d d 6d d 6|  j( } | j5 | ƒ t	 j2 d ƒ }  t1 d d ƒ }! t1 d d ƒ }" t1 d d ƒ }# t1 d  d! ƒ }$ | j d" |  j6 ƒ | j d" |  j7 ƒ | j d" |  j8 | ƒ | j d" |  j9 ƒ | j d" |  j: ƒ | j d" |  j; | ƒ |! j d" |  j< | ƒ |" j d" |  j= | ƒ |# j d" |  j> | ƒ |$ j d" |  j? | ƒ | j d# |  j@ ƒ |  j d" |  jA ƒ |  j d k r…d$ }% n d% }% |  j ƒ  }& |& d k rð|  j d3 k rðt	 j
 d& |% ƒ }' t1 d' d( ƒ }( |( j d" |  jB |	 | ƒ n2 t	 j
 d) |& d |& d k r	d* n d+ |% f ƒ }' t	 jC t tD ƒ }) | j | ƒ | j |) ƒ | jE d d ƒ t	 jC t d ƒ }* |) jF |* t t d, ƒ |* jF | t t d ƒ t	 jG t tH ƒ }+ |* jF |+ t t tD ƒ |  j j ƒ  d k rR
t	 jI d- d d. d/ ƒ }, |, j |' ƒ t	 jI d- d d. d/ ƒ }- |- j |( ƒ |+ jF |, tJ tJ tK ƒ |+ jF |- tJ tJ tK ƒ nA |+ jF |' tJ t d ƒ y |+ jL d0 |  jM ƒ Wn tN k
 r’
n Xt	 jO d1 ƒ }. |. jP d/ d/ ƒ |) jF |. t t d ƒ t	 jC t tD ƒ }/ |. j |/ ƒ t	 jG tJ tH ƒ }0 |0 jF | tJ tJ tK ƒ |0 jF | tJ tJ tK ƒ |/ jF |0 t t tK ƒ t	 jG t d ƒ }1 |1 jF | tJ t tK ƒ |/ jF |1 t t tK ƒ t	 jO d2 ƒ }2 |2 jP d/ d/ ƒ |) jF |2 t t d ƒ t	 jC t tD ƒ }3 |2 j |3 ƒ t	 jG tJ tH ƒ }4 |4 jF | tJ tJ tK ƒ |4 jF | tJ tJ tK ƒ |3 jF |4 t t tK ƒ t	 jG t d ƒ }5 |5 jF | tJ tJ tK ƒ |5 jF |  tJ tJ tK ƒ |3 jF |5 t t tK ƒ t	 jG t d ƒ }6 |6 jF | tJ t tK ƒ |3 jF |6 t t tK ƒ t	 jQ ƒ  }7 |) jF |7 ƒ t	 jG tJ tH ƒ }8 |8 jF |! tJ tJ tK ƒ |8 jF |" tJ tJ tK ƒ |) jF |8 t t tK ƒ t	 jG tJ tD ƒ }9 |) jF |9 t t tK ƒ t	 jC tJ tD ƒ }: |9 jF |: t t tK ƒ |: jF |# tJ t tK ƒ |: jF |$ tJ t tK ƒ |! jR ƒ  | j ƒ  |+ jS ƒ  d |  _M d3 S(4   sB  Create a GUI for building the next nucleotide
        
        OPTIONAL ARGUMENTS:
           window          - a pyGTK+ window object (from the previous iteration of selectNextNt, if there was one)
           initialNtCoords - a dictionary of atom coordinates indicating what the initially selected nucleotide should be
                             This is typically used if the user has just clicked "Previous Nt"
                             If not given, the the most likely predicted base location is used
           initialNtType   - what type of base (i.e. A, C, G, or T) should be initially selected
                             this is typically used if the user has just clicked "Previous Nt"
                             If not given, then self.__baseType is used.
                             If initialNtCoords is given, then this argument MUST match the base type described by initialNtCoords.
           initialPhos     - the coordinates for the initially selected phosphate should be
                             If this is given, then initialNtCoords and must *NOT* be given
        RETURNS:
           none
        EFFECTS:
           creates a GUI for building the next nucleotide of a chain trace
        REQUIREMENTS:
           a refinement map must be selected (i.e. imol_refinement_map must return a valid map ID)
        RY   sH   
  Calculating potential phosphate coordinates...  

  Please wait...  
i   i   i    t   Pi   s   C1's   Trace the next nucleotide:s     Next Phos  s   gtk-media-nexts     Previous Phos s   gtk-media-previouss     Manually Adjust  u     Next C1â€²  u     Previous C1â€²  s   Adenine (A)s   Cytosine (C)s   Guanine (G)s
   Uracil (U)t   AR-   t   Gt   Us     Anti/Syn Flip  s     Accept Nt  s   gtk-oks     Previous Nt  s
   gtk-cancels     Build Backbone  s	   gtk-applys     Delete Trace  s	   gtk-closeRZ   t   changeds   5' -> 3's   3' -> 5's   Tracing s
     Switch  s   gtk-refreshs   %i nucleotide%s traced (%s)t   st    i   t   xalignt   yaligng      à?iÿÿÿÿt	   Phosphatet   BaseN(T   R    R.   R   t	   get_childRo   t
   disconnectRM   R[   t   _TraceGui__nextNtCloseWinR]   R^   R_   R`   Ra   Rb   Rc   Rd   RN   R0   R1   R/   t	   getNumNtst   resInsertionPointt   getPhosCoordsFromIndext   connectedToPrevFromIndext   _TraceGui__numNtsTracedt   getSugarCoordsFromIndext   connectedToNextFromIndexR6   t
   secondPhosR7   R9   t   nextPhost   lenR:   R;   t   appendRf   R@   RA   R<   R8   t	   enumerateR   t   _TraceGui__drawC1Peakst   findBaset	   iteritemst   _TraceGui__drawAdjustPhosCrosst   _TraceGui__drawNtR   Rh   t   combo_box_new_textt   append_textt
   set_activet   _TraceGui__nextNtNextPhost   _TraceGui__nextNtPrevPhost!   _TraceGui__createAdjustPhosDialogt   _TraceGui__nextNtNextC1t   _TraceGui__nextNtPrevC1t!   _TraceGui__createAdjustBaseDialogt   _TraceGui__nextNtAcceptt   _TraceGui__nextNtPrevNtt   _TraceGui__nextNtBuildBackbonet   _TraceGui__nextNtCloset   _TraceGui__nextNtBaseSelectt   _TraceGui__flipBaset   _TraceGui__switchDirectionRn   R   Rp   Rr   Rs   R   t	   AlignmentRt   R   t   set_size_requestt   _TraceGui__directionBoxHeightt   AttributeErrorRq   t   set_label_alignRu   Rv   t   size_request(;   RR   Rx   t   initialNtCoordst   initialNtTypet   initialPhosRw   t   windowChildRy   RV   t   prevPhost	   prevSugart   prevPrevPhost   curC1st   initialPhosCoordst   indext   coordst   initialC1Coordst	   phosIndext   c1indext   atomNamet   curPhosCoordst   curC1Coordst   curBaseCoordsRz   t   nextPhosButtont   prevPhosButtont   adjustPhosButtont   nextC1Buttont   prevC1Buttont   adjustBaseButtont
   baseSelectt   baseTypeNumt   flipBaseButtonR~   t   prevNtButtont   buildBackboneButtont   closeButtont   directionStringt   numNtst   directionLabelt   switchDirectionButtonR€   t   topBoxt   directionBoxt   directionLabelAlignt   switchDirectionAlignt	   phosFramet   phosFrameBoxt   phosPrevNextBoxt   adjustPhosBoxt   C1Framet
   C1FrameBoxt   C1PrevNextBoxt   baseBoxt   adjustC1BoxR…   R†   t   buildCloseHboxt   buildCloseBox(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   selectNextNt  s|   	
	$$*-	!
				
<			
#<
	D(H		)	2

c         C   sc  |  j  d k	 r% |  j d |  j  ƒ n  |  j d k	 rJ |  j d |  j ƒ n  |  j } |  j | } d } d } |  j d k	 r˜ |  j } |  j d d } n" |  j | | } |  j	 | | } | d |  j
 k rÑ d S|  j j | |  j
 ƒ } |  j d k	 r| |  _ n | |  j | | <d } |  j d k r:|  j | } n	 |  j } |  j |  j ƒ  | | | ƒ d S(   så   Mutate the currently selected base to self.__baseType
        
        ARGUMENTS:
            None
        RETURNS:
            None
        EFFECTS:
            the current base is mutated to self.__baseType and redrawn
        i   s   C1'i    N(   RD   R.   t   _TraceGui__adjustPhosAcceptRF   t   _TraceGui__adjustBaseAcceptR8   R:   RA   R;   R9   R<   R6   t
   mutateBaseR@   R7   R¥   t   _TraceGui__getPrevPhosCoords(   RR   RÈ   t   c1Indext   curBaset   c1loct   newBaseRË   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __mutateBaseu  s0    			c         C   s  |  j  d k	 r% |  j d |  j  ƒ n  |  j d k	 rJ |  j d |  j ƒ n  |  j } |  j | } d } |  j d k	 r’ |  j } |  j d d } n" |  j | | } |  j	 | | } |  j
 j | ƒ } | |  _ d } |  j d k rô |  j | } n	 |  j } |  j |  j ƒ  | | | ƒ d S(   s:  Perform an anti/syn rotation of the base.
        
        OPTIONAL ARGUMENTS:
            widget - the widget that called this function.  This is passed by pyGTK, but is ignored.
        RETURNS:
            None
        EFFECTS:
            Rotates the current base and redraws it
        NOTE:
            With pyrimidines, this function simply rotates the base by 180 about chi
            However, for purines, the base is moved slightly within the plane so that it occupies roughly the same
                location in space as it did before the rotation.
        i   s   C1'N(   RD   R.   Rî   RF   Rï   R8   R:   RA   R;   R9   R6   t   flipBaseR@   R7   R¥   Rñ   (   RR   t   widgetRÈ   Rò   Rô   Ró   Rõ   RË   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt
   __flipBase©  s&    				c         C   sd  |  j  d k	 r% |  j d |  j  ƒ n  | d k r= |  j } n  | d k rU |  j } n  | d k rm |  j } n  | d k r… |  j } n  t d ƒ } | j | ƒ | j	 d | ƒ t
 j t t ƒ } | j | ƒ t
 j d ƒ }	 | j |	 t t d ƒ t
 j d d d d d	 ƒ }
 t
 j |
 ƒ } | j t ƒ |	 j | ƒ t
 j d
 ƒ } | j | t t d ƒ t
 j d d d d d	 ƒ } t
 j | ƒ } | j t ƒ | j | ƒ t
 j d ƒ } | j | t t d ƒ t
 j d d d d d	 ƒ } t
 j | ƒ } | j t ƒ | j | ƒ t
 j ƒ  } | j | ƒ t d d ƒ } t d d ƒ } t
 j t t ƒ } | j | t t t ƒ | j | t t t ƒ | j | t t t ƒ |
 j	 d | d ƒ | j	 d | d ƒ | j	 d | d ƒ | j	 d | | ƒ | j	 d | | ƒ |  j d k	 rt |  j ƒ |  _ n |  j |  j |  _ t |  j ƒ |  _ d d d g |  _  | |  _! | j" ƒ  d S(   sÞ  Create a dialog box that allows the user to manually change the phosphate position.
        ARGUMENTS:
            widget - the widget that called this function.  Ignored.
            parentWindow - the RCrane window.  The newly created dialog box is set as a transient for parentWindow
        OPTIONAL ARGUMENTS:
            By default, this function assumes that it is being used to move a next phosphate, not an initial phosphate
            By provided all these arguments, a dialog appropriate for moving the initial phosphate can be created
            sliderFunc   - the function to call when moving the sliders
            acceptFunc   - the function to call when the user clicks OK
            cancelFunc   - the function to call when the user clicks Cancel
            closeWinFunc - the function to call when the user closes the window
        RETURNS:
            None
        EFFECTS:
            Creates and displays a dialog box for adjusting the phosphate location
        s   Adjust PhosphateRY   s   X translationi   i    iLÿÿÿih  gš™™™™™¹?g      ð?s   Y translations   Z translations     OK  s   gtk-oks
     Cancel  s
   gtk-cancelt   value_changedi   RZ   N(#   RF   R.   Rï   t   _TraceGui__adjustPhosRî   t   _TraceGui__adjustPhosCancelt   _TraceGui__adjustPhosCloseWinR   t   set_transient_forR[   R]   Rn   RN   R   Ra   Rq   Rr   t
   Adjustmentt   HScalet   set_draw_valueRu   R   Rs   Rt   R   R   R@   R   RC   R7   R8   RG   RI   RD   Rb   (   RR   Rø   t   parentWindowt
   sliderFunct
   acceptFunct
   cancelFunct   closeWinFunct   dialogWindowR€   t   xFramet   xAdjustmentt   xScalet   yFramet   yAdjustmentt   yScalet   zFramet   zAdjustmentt   zScaleR…   t   okButtonR   t   okCancelBox(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __createAdjustPhosDialogÞ  sj    	c   
      C   s2  | j  |  j | } | j  |  j | <t ƒ  } t ƒ  } d d d g } d } | d k rd | d 9} n  | | d | | | | d <| | d | | | | d <| | d | | | | d <t |  j | ƒ |  _ |  j } |  j | }	 |  j	 |  j ƒ |  j
 |  j ƒ  |  j | |	 |  j |  j | |	 ƒ d S(   sÐ  Move a next (i.e. not initial) phosphate atom in response to the user moving a slider in the adjust phosphate dialog
        
        ARGUMENTS:
            adjustment - the adjustment object
            dim        - which dimension to move the phosphate in
                         0 for the screen x-axis, 1 for the screen y-axis, and 2 for the screen z-axis
        RETURNS:
            None
        EFFECTS:
            Moves and redraws the phosphate
        gü©ñÒMb`?i   iÿÿÿÿi    i   N(   t   valueRI   t   screen_vectorsR
   R.   R   RG   R8   R:   R¤   R¥   Rñ   R9   R;   (
   RR   t
   adjustmentt   dimt   adjDifft   screenVectorst   zoomt   movementt   scaleFactorRÈ   Rò   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustPhosG  s     			c         C   s   |  j  | | ƒ d S(   s)  Respond to the user closing the adjust phosphate dialog box
        
        ARUGMENTS:
            window - the window to close
            widget - the widget used to close the window
        NOTES:
            This function simply calls __adjustPhosCancel with a reversed argument list
        N(   Rü   (   RR   Rx   Rø   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustPhosCloseWins  s    	c         C   s¼   |  j  d k	 r t |  j  ƒ n  |  j } |  j | } d } |  j d k	 rf |  j } |  j |  j ƒ n |  j | } |  j |  j	 ƒ  |  j
 | | | |  j | | ƒ | j ƒ  d |  _ d S(   sY  Respond to the user clicking Cancel in the adjust phosphate dialog box
        
        ARUGMENTS:
            widget - the cancel button
            window - the dialog box window
        RETURNS:
            None
        EFFECTS:
            Closes the adjust phosphate dialog box and reverts the phosphate to its original coordinates
        N(   RB   R.   R   R8   R:   R@   R¤   R7   R¥   Rñ   R9   R;   t   destroyRD   (   RR   Rø   Rx   RÈ   Rò   t   origPhosCoords(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustPhosCancel  s    		2
c         C   s7   |  j  |  _ t |  j ƒ t ƒ  | j ƒ  d |  _ d S(   sQ  Respond to the user clicking OK in the adjust phosphate dialog box
        
        ARUGMENTS:
            widget - the OK button
            window - the dialog box window
        RETURNS:
            None
        EFFECTS:
            Closes the adjust phosphate dialog box and stores the coordinates that the user has selected
        N(   RG   R@   R   R>   R   R  R.   RD   (   RR   Rø   Rx   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustPhosAccept¤  s
    
c          C   sA  |  j  d k	 r% |  j d |  j  ƒ n  t d ƒ } | j | ƒ | j d |  j ƒ t j t	 t
 ƒ } | j | ƒ t j d ƒ } | j | t	 t	 d ƒ t j d d d d d	 ƒ } t j | ƒ } | j t	 ƒ | j | ƒ t j d
 ƒ } | j | t	 t	 d ƒ t j d d d d d	 ƒ }	 t j |	 ƒ }
 |
 j t	 ƒ | j |
 ƒ t j d ƒ } | j | t	 t	 d ƒ t j d d d d d	 ƒ } t j | ƒ } | j t	 ƒ | j | ƒ t j d ƒ } | j | t	 t	 d ƒ t j d d d d d	 ƒ } t j | ƒ } | j t	 ƒ | j | ƒ t j d ƒ } | j | t	 t	 d ƒ t j d d d d d	 ƒ } t j | ƒ } | j t	 ƒ | j | ƒ t j d ƒ } | j | t	 t	 d ƒ t j d d d d d	 ƒ } t j | ƒ } | j t	 ƒ | j | ƒ t j d ƒ } | j | t	 t	 d ƒ t j d d d d d	 ƒ } t j | ƒ } | j t	 ƒ | j | ƒ t j ƒ  } | j | ƒ t d d ƒ } t d d ƒ } t j t t ƒ } | j | t t t ƒ | j | t t t ƒ | j | t	 t	 t ƒ | j d |  j d ƒ |	 j d |  j d ƒ | j d |  j d ƒ | j d |  j d ƒ | j d |  j d ƒ | j d |  j d ƒ | j d |  j ƒ | j d |  j | ƒ | j d |  j | ƒ |  j d k	 rÁt |  j ƒ |  _ n* |  j } |  j | } |  j  | | |  _ t |  j ƒ |  _! d d d g |  _" d d d g |  _# d |  _$ | |  _% | j& ƒ  d S(   sÐ  Creates a dialog that allows the user to manually change the base position.
        
        ARGUMENTS:
            widget 
        ARGUMENTS:
            widget - the widget that called this function.  Ignored.
            parentWindow - the RCrane window.  The newly created dialog box is set as a transient for parentWindow
        RETURNS:
            None
        EFFECTS:
            Creates and displays a dialog box for adjusting the base location
        s   Adjust BaseRY   s   X translationi   i    iLÿÿÿih  gš™™™™™¹?g      ð?s   Y translations   Z translations
   X Rotations
   Y Rotations
   Z Rotations   Chi Rotations     OK  s   gtk-oks
     Cancel  s
   gtk-cancelRú   i   RZ   N('   RD   R.   Rî   R   Rþ   R[   t   _TraceGui__adjustBaseCancelR]   Rn   RN   R   Ra   Rq   Rr   Rÿ   R   R  Ru   R   Rs   Rt   R   R   t   _TraceGui__translateBaset   _TraceGui__rotateBaset   _TraceGui__rotateBaseChiRï   RA   R   RE   R8   R:   R;   RH   RJ   RK   RL   RF   Rb   (    RR   Rø   R  R  R€   R  R	  R
  R  R  R  R  R  R  t	   xRotFramet   xRotAdjustmentt	   xRotScalet	   yRotFramet   yRotAdjustmentt	   yRotScalet	   zRotFramet   zRotAdjustmentt	   zRotScalet   chiRotFramet   chiRotAdjustmentt   chiRotScaleR…   R  R   R  RÈ   Rò   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __createAdjustBaseDialogÁ  sš    			c         C   s[  | j  |  j | } | j  |  j | <t ƒ  } t ƒ  } d d d g } d } | d k rd | d 9} n  | | d | | | | d <| | d | | | | d <| | d | | | | d <x; |  j d j ƒ  D]& \ } }	 t |	 | ƒ |  j d | <qÒ Wd }
 |  j d k r$|  j	 |  j
 }
 n	 |  j }
 |  j |  j ƒ  |  j d d |
 |  j ƒ d S(   s   Move a base in response to the user moving a slider in the adjust base dialog.
        
        ARGUMENTS:
            adjustment - the adjustment object
            dim        - which dimension to move the base in
                         0 for the screen x-axis, 1 for the screen y-axis, and 2 for the screen z-axis
        RETURNS:
            None
        EFFECTS:
            Moves and redraws the base
        gü©ñÒMb`?i   iÿÿÿÿi    i   s   C1'N(   R  RJ   R  R
   R.   RH   R£   R   R@   R7   R8   R¥   Rñ   (   RR   R  R  R  R  R  R  R  t   curAtomt
   prevCoordst
   phosCoords(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __translateBase>  s$    		 	c         C   sø   | j  |  j | } | j  |  j | <t ƒ  } | | } |  j d d } t ƒ  } x4 |  j d j ƒ  D] \ } }	 t |	 | ƒ | | <qe Wt | | | | ƒ |  j d <d }
 |  j	 d k rÌ |  j
 |  j }
 n	 |  j	 }
 |  j |  j ƒ  | |
 |  j ƒ d S(   sª  Rotates a base in response to the user moving a slider in the adjust base dialog.
        
        ARGUMENTS:
            adjustment - the adjustment object
            dim        - which dimension to rotate the base about
                         0 for the screen x-axis, 1 for the screen y-axis, and 2 for the screen z-axis
        RETURNS:
            None
        EFFECTS:
            Rotates and redraws the base
        i   s   C1'N(   R  RK   R  RH   t   dictR£   R   R   R.   R@   R7   R8   R¥   Rñ   (   RR   R  R  R  R  t   axisRô   t   translatedCoordsR4  R5  R6  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __rotateBaseo  s    	
	 	c   	      C   s	  | j  |  j } | j  |  _ |  j d d } t ƒ  } x4 |  j d j ƒ  D] \ } } t | | ƒ | | <qJ Wd } | j d ƒ r� | d } n
 | d } t | | | | ƒ |  j d <d } |  j	 d k rÝ |  j
 |  j } n	 |  j	 } |  j |  j ƒ  | | |  j ƒ d S(   s  Rotates a base about chi in response to the user moving a slider in the adjust base dialog.
        
        ARGUMENTS:
            adjustment - the adjustment object
        RETURNS:
            None
        EFFECTS:
            Rotates and redraws the base
        i   s   C1't   N9t   N1N(   R  RL   RH   R8  R£   R   R.   t   has_keyR   R@   R7   R8   R¥   Rñ   (	   RR   R  R  Rô   R:  R4  R5  R9  R6  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __rotateBaseChi–  s     	 
	c         C   s   |  j  | | ƒ d S(   s$  Respond to the user closing the adjust base dialog box
        
        ARUGMENTS:
            window - the window to close
            widget - the widget used to close the window
        NOTES:
            This function simply calls __adjustBaseCancel with a reversed argument list
        N(   R#  (   RR   Rx   Rø   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustBaseCloseWin½  s    
c         C   sˆ   |  j  } |  j | } d } |  j d k r> |  j |  j  } n	 |  j } |  j |  j ƒ  |  j d d | |  j ƒ | j ƒ  d |  _	 d S(   sJ  Respond to the user clicking Cancel in the adjust base dialog box
        
        ARUGMENTS:
            widget - the cancel button
            window - the dialog box window
        RETURNS:
            None
        EFFECTS:
            Closes the adjust base dialog box and reverts the base to its original coordinates
        i   s   C1'N(
   R8   R:   R.   R@   R7   R¥   Rñ   RE   R  RF   (   RR   Rø   Rx   RÈ   Rò   R6  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustBaseCancelÉ  s    		*
c         C   s#   |  j  |  _ | j ƒ  d |  _ d S(   sG  Respond to the user clicking OK in the adjust base dialog box
        
        ARUGMENTS:
            widget - the OK button
            window - the dialog box window
        RETURNS:
            None
        EFFECTS:
            Closes the adjust base dialog box and stores the coordinates that the user has selected
        N(   RH   RA   R  R.   RF   (   RR   Rø   Rx   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustBaseAcceptè  s    
c         C   sž   |  j  d k rE |  j d 7_ |  j t |  j ƒ k r[ d |  _ q[ n d |  _  t |  j ƒ |  j d k	 rz |  j j ƒ  n  d |  _  |  j	 |  j |  j ƒ d S(   sÿ   Select the next phosphate in the initial phosphate GUI.
        
        ARGUMENTS:
            widget - the button used to call this function.  Ignored.
        RETURNS:
            None
        EFFECTS:
            Highlights the next phosphate
        i   i    N(
   R@   R.   R8   Rž   R7   R   RB   RD   R  Rg   (   RR   Rø   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __initialPhosNext  s    		c         C   s¢   |  j  d k rI |  j d 8_ |  j d k  r_ t |  j ƒ d |  _ q_ n d |  _  t |  j ƒ |  j d k	 r~ |  j j ƒ  n  d |  _  |  j	 |  j |  j ƒ d S(   s  Select the previous phosphate in the initial phosphate GUI.
        
        ARGUMENTS:
            widget - the button used to call this function.  Ignored.
        RETURNS:
            None
        EFFECTS:
            Highlights the previous phosphate
        i   i    N(
   R@   R.   R8   Rž   R7   R   RB   RD   R  Rg   (   RR   Rø   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __initialPhosPrevious  s    		c         C   s,   |  j  | | |  j |  j |  j |  j ƒ d S(   sB  Creates a dialog to adjusting the initial phosphate coordinates.
        
        ARGUMENTS:
            widget - the button used to call this function.  Ignored.
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Creates and displays the adjust phosphate dialog
        N(   R«   t   _TraceGui__adjustInitialPhost"   _TraceGui__adjustInitialPhosAcceptt"   _TraceGui__adjustInitialPhosCancelt$   _TraceGui__adjustInitialPhosCloseWin(   RR   Rø   Rx   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __createAdjustInitialPhosDialog<  s    c         C   s÷   | j  |  j | } | j  |  j | <t ƒ  } t ƒ  } d d d g } d } | d k rd | d 9} n  | | d | | | | d <| | d | | | | d <| | d | | | | d <t |  j | ƒ |  _ |  j |  j ƒ |  j |  j ƒ d S(   sÁ  Move an initial phosphate atom in response to the user moving a slider in the adjust phosphate dialog
        
        ARGUMENTS:
            adjustment - the adjustment object
            dim        - which dimension to move the phosphate in
                         0 for the screen x-axis, 1 for the screen y-axis, and 2 for the screen z-axis
        RETURNS:
            None
        EFFECTS:
            Moves and redraws the phosphate
        gü©ñÒMb`?i   iÿÿÿÿi    i   N(	   R  RI   R  R
   R.   R   RG   R¤   Rg   (   RR   R  R  R  R  R  R  R  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustInitialPhosJ  s    		c         C   s   |  j  | | ƒ d S(   s1  Respond to the user closing the adjust initial phosphate dialog box
        
        ARUGMENTS:
            window - the window to close
            widget - the widget used to close the window
        NOTES:
            This function simply calls __adjustPhosCancel with a reversed argument list
        N(   RG  (   RR   Rx   Rø   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustInitialPhosCloseWinr  s    
c         C   sŠ   |  j  d k	 r t |  j  ƒ n  |  j } d } |  j d k	 rY |  j } |  j |  j ƒ n |  j | } |  j | ƒ | j ƒ  d |  _	 d S(   sa  Respond to the user clicking Cancel in the adjust initial phosphate dialog box
        
        ARUGMENTS:
            widget - the cancel button
            window - the dialog box window
        RETURNS:
            None
        EFFECTS:
            Closes the adjust phosphate dialog box and reverts the phosphate to its original coordinates
        N(
   RB   R.   R   R8   R@   R¤   R7   Rg   R  RD   (   RR   Rø   Rx   RÈ   R   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustInitialPhosCancel~  s    		
c         C   s#   |  j  |  _ | j ƒ  d |  _ d S(   sY  Respond to the user clicking OK in the adjust initial phosphate dialog box
        
        ARUGMENTS:
            widget - the OK button
            window - the dialog box window
        RETURNS:
            None
        EFFECTS:
            Closes the adjust phosphate dialog box and stores the coordinates that the user has selected
        N(   RG   R@   R  R.   RD   (   RR   Rø   Rx   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __adjustInitialPhosAccept   s    
c         C   sz   t  |  j ƒ t  |  j ƒ |  j j ƒ  |  j d k	 rF t  |  j ƒ n  |  j d k	 re |  j j ƒ  n  t	 ƒ  | j ƒ  d S(   s  Cancel the build and erase all objects
        
        ARUGMENTS:
            widget - the cancel button
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Closes the RCrane dialog and destroys all RCrane objects
        N(
   R   R=   R?   R/   t   closeBatonObjectRB   R.   RD   R  R   (   RR   Rø   Rx   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __initialPhosCancel´  s    c         C   s   |  j  | | ƒ d S(   s   Cancel the build and erase all objects
        ARGUMENTS:
            window - the RCrane window
            widget - the cancel button
        RETURNS:
            None
        NOTE:
            This function simply calls __initialPhosCancel with a reversed argument list
            It is used when the window manager issues a close signal (rather than the user
            clicking on the cancel button).
        N(   Rm   (   RR   Rx   Rø   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __initialPhosCloseWinÏ  s    c         C   sV  |  j  d k	 r% |  j d |  j  ƒ n  t |  j ƒ t |  j ƒ |  j d k	 r^ t |  j ƒ n  t ƒ  d } |  j d k r” |  j	 |  j
 d d !} n	 |  j } |  j d k s» |  j d k rÎ |  j j | ƒ n |  j j | ƒ t | d | d | d ƒ t |  _ |  j d k rE|  j d k	 rE|  j d 7_ |  j j d 7_ n  |  j | ƒ d S(   sY  Accept the coordinates of the currently selected phosphate
        ARGUMENTS:
            widget - the button used to invoke this function
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Creates a new Coot molecule using the accepting phospahate and creates a next nucleotide dialog
        i    i   i   i   N(   RD   R.   RF  R   R=   R?   RB   R   R@   R7   R8   R0   R1   R/   t   addPhost	   addPhos5pR   Rt   RO   t   origResInsertionPointRí   (   RR   Rø   Rx   t   acceptedPoint(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __initialPhosAcceptÝ  s(    		c         C   sª  |  j  d k rE |  j d 7_ |  j t |  j ƒ k r[ d |  _ q[ n d |  _  t |  j ƒ |  j d k	 rz |  j j ƒ  n  d |  _  d |  _	 |  j } |  j
 ƒ  } |  j | d k rë d GHt ƒ  } |  j j | | |  j | ƒ |  j | <n  |  j | } |  j | | d k r_t ƒ  } |  j j | |  j | | | |  j | |  j |  j ƒ |  j | | <n
 |  j ƒ  |  j ƒ  |  j | |  j | | |  j | |  j | | ƒ d S(   sý   Select the next phosphate in the next nucleotide GUI.
        
        ARGUMENTS:
            widget - the button used to call this function.  Ignored.
        RETURNS:
            None
        EFFECTS:
            Highlights the next phosphate
        i   i    s4   WARNING: CANDIDATE C1'S HAVE NOT BEEN PRE-CALCULATEDN(   R@   R.   R8   Rž   R7   R   RB   RD   R  RA   Rñ   R9   R    R6   t	   findSugarR:   R;   R¢   R<   R1   t   _TraceGui__mutateBaseR¡   R¥   (   RR   Rø   RÈ   RÀ   Rw   Rò   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtNextPhos  s.    					)	G

c         C   s®  |  j  d k rI |  j d 8_ |  j d k  r_ t |  j ƒ d |  _ q_ n d |  _  t |  j ƒ |  j d k	 r~ |  j j ƒ  n  d |  _  d |  _	 |  j } |  j
 ƒ  } |  j | d k rï d GHt ƒ  } |  j j | | |  j | ƒ |  j | <n  |  j | } |  j | | d k rct ƒ  } |  j j | |  j | | | |  j | |  j |  j ƒ |  j | | <n
 |  j ƒ  |  j ƒ  |  j | |  j | | |  j | |  j | | ƒ d S(   s  Select the previous phosphate in the next nucleotide GUI.
        
        ARGUMENTS:
            widget - the button used to call this function.  Ignored.
        RETURNS:
            None
        EFFECTS:
            Highlights the previous phosphate
        i   i    s4   WARNING: CANDIDATE C1'S HAVE NOT BEEN PRE-CALCULATEDN(   R@   R.   R8   Rž   R7   R   RB   RD   R  RA   Rñ   R9   R    R6   RV  R:   R;   R¢   R<   R1   RW  R¡   R¥   (   RR   Rø   RÈ   RÀ   Rw   Rò   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtPrevPhosM  s.    					)	G

c         C   sy  |  j  d k	 r d S|  j d k	 r2 |  j j ƒ  n  |  j d k	 rQ |  j j ƒ  n  |  j } |  j d k r¯ |  j | c d 7<|  j | t |  j	 | ƒ k r¸ d |  j | <q¸ n	 d |  _ |  j
 ƒ  } |  j | } |  j | | d k r8t ƒ  } |  j j | |  j	 | | | |  j | |  j |  j ƒ |  j | | <n
 |  j ƒ  |  j | |  j	 | | |  j | |  j | | ƒ d S(   sñ   Select the next C1' in the next nucleotide GUI.
        
        ARGUMENTS:
            widget - the button used to call this function.  Ignored.
        RETURNS:
            None
        EFFECTS:
            Highlights the next C1'
        Ni   i    (   R@   R.   RD   R  RF   R8   RA   R:   Rž   R9   Rñ   R;   R    R6   R¢   R7   R<   R1   RW  R¥   (   RR   Rø   RÈ   RÀ   Rò   Rw   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtNextC1„  s&    	 		G
c         C   s}  |  j  d k	 r d S|  j d k	 r2 |  j j ƒ  n  |  j d k	 rQ |  j j ƒ  n  |  j } |  j d k r³ |  j | c d 8<|  j | d k  r¼ t |  j	 | ƒ d |  j | <q¼ n	 d |  _ |  j
 ƒ  } |  j | } |  j | | d k r<t ƒ  } |  j j | |  j	 | | | |  j | |  j |  j ƒ |  j | | <n
 |  j ƒ  |  j | |  j	 | | |  j | |  j | | ƒ d S(   sù   Select the previous C1' in the next nucleotide GUI.
        
        ARGUMENTS:
            widget - the button used to call this function.  Ignored.
        RETURNS:
            None
        EFFECTS:
            Highlights the previous C1'
        Ni   i    (   R@   R.   RD   R  RF   R8   RA   R:   Rž   R9   Rñ   R;   R    R6   R¢   R7   R<   R1   RW  R¥   (   RR   Rø   RÈ   RÀ   Rò   Rw   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtPrevC1²  s&    	$		G
c         C   s–  |  j  d k	 r% |  j d |  j  ƒ n  |  j d k	 rJ |  j d |  j ƒ n  t |  j ƒ t |  j ƒ t |  j ƒ |  j	 d k	 r� t |  j	 ƒ n  t
 ƒ  |  j } |  j | } d } |  j d k rÒ |  j | } n	 |  j } d \ } } |  j r|  j \ } } n |  j | | \ } } |  j d k rA|  j j | | | ƒ n |  j j | | | ƒ t | d | d | d ƒ d |  _ d |  _ |  j | ƒ d S(   sh  Accept the coordinates of the currently selected nucleotide
        
        ARGUMENTS:
            widget - the button used to invoke this function
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Adds the accepted nucleotide coordinates to the Coot molecule and begins tracing the next nucleotide
        i   i    i   i   N(   NN(   RD   R.   Rî   RF   Rï   R   R=   R>   R?   RB   R   R8   R:   R@   R7   RA   R;   R1   R/   t   addBaseAndPhost   addBaseAndPhos5pR   Rí   (   RR   Rø   Rx   RÈ   Rò   R6  t   baseTypet
   baseCoords(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtAcceptà  s6    					c         C   s=   |  j  j ƒ  r |  j  j ƒ  n |  j  j ƒ  |  j | ƒ d S(   s:  Close the next nucleotide dialog and delete the molecule
        
        ARGUMENTS:
            widget - the button used to invoke this function
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Destroys the next nucleotide dialog and the Coot molecule
        N(   R/   t   hasSavedMoleculeStatet   restoreMoleculeStatet   deleteMoleculet   _TraceGui__nextNtFinished(   RR   Rø   Rx   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtClose  s    c         C   s¦   t  |  j ƒ t  |  j ƒ t  |  j ƒ |  j d k	 rF t  |  j ƒ n  |  j j ƒ  t ƒ  |  j	 d k	 ry |  j	 j
 ƒ  n  |  j d k	 r˜ |  j j
 ƒ  n  | j
 ƒ  d S(   sK  Close the next nucleotide window without deleting the molecule
        
        ARGUMENTS:
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Destroys the next nucleotide dialog
        NOTE:
            This function is called by __nextNtClose and __nextNtBuildBackbone.
        N(   R   R=   R>   R?   RB   R.   R/   RN  R   RD   R  RF   (   RR   Rx   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtFinished-  s    c      
   C   sä  d
 } |  j d
 k	 r% |  j j ƒ  n  |  j d
 k	 rD |  j j ƒ  n  |  j ƒ  d k  r½ |  j d
 k ru |  j | ƒ qà|  j r§ t |  j	 |  j |  j
 ƒ |  j | ƒ qàd GHt d ƒ t Sn#|  j ƒ  d k rS|  j d
 k rSt |  j ƒ t |  j ƒ t |  j ƒ |  j	 j ƒ  } t | j d j ƒ  ƒ } t | | |  j	 | ƒ |  j | ƒ n�t |  j ƒ t |  j ƒ t |  j ƒ |  j d
 k r›|  j	 j ƒ  } nÚ |  j
 d k rî|  j d } |  j	 j } |  j | ƒ } | d k rQ| d 7} qQnc |  j	 j } |  j	 j } |  j | ƒ } | d k r8| d 8} | d 8} n | d k rQ| d 8} n  |  j	 j | | d t ƒ\ } }	 }
 t | ƒ } t | ƒ \ } } d d j | ƒ GH|  j d
 k rÕt | | |  j	 | ƒ \ } } nÉ|	 d
 k r÷d
 g | } d
 } n |  j	 j | ƒ } | g | } |
 d
 k r8| d
 g } d
 } n |  j	 j |
 ƒ } | | g } |  j	 j  | ƒ } |  j	 j! | ƒ r”|  j	 j  | d ƒ } n |  j	 j  | ƒ } |  j	 j" |	 p¸| |
 pÁ| ƒ |  j
 d k rù|  j	 j# | |  j	 j  |  j ƒ ƒ n" |  j	 j# |  j	 j  |  j ƒ | ƒ | rz|  j
 d k rU|  j	 j# |  j	 j  |  j ƒ | ƒ qz|  j	 j# | |  j	 j  |  j ƒ ƒ n  t$ | | | | |  j	 | ƒ \ } } |  j	 j% ƒ  | j& |  j' ƒ t( | | |  j	 | | | | d	 | ƒd
 S(   si  Finish tracing the backbone and calculate all-atom backbone coordinates.
        
        ARGUMENTS:
            widget - the button used to invoke this function
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Calculates an initial set of backbone coordinates and creates a review suites GUI dialog
        i   s4   No nucleotides traced, so there is nothing to build.i    i   i   t   addFlankingAtomss   Suite string: R�   t   prevTorsionsN()   R.   RD   R  RF   R™   R0   Rd  RO   R   R/   R1   R   RN   R   R=   R>   R?   t   createChainObjectR   t   nucleotidest   pperpR   R–   t   _TraceGui__extendChainJoinedRS  t!   createPartialChainObjectFromIndexRt   R   R   R4   t   calcSuiteTorsionsFromIndext   calcSuiteTorsionst
   resNumFullt   isOnlyPhosGroupFromIndext   setExtraBondRanget	   resetNucsR   RN  R“   RM   R   (   RR   Rø   Rx   Rh  t
   builtChaint   puckert   startingResIndext   endingResIndext   joinedt   resNum5pt   resNum3pt   builtChainOrigt   bestPatht   predictedProbst   intermediateAtomLocst   minimizationScorest   rebuildRotst   nextTorsionst   startResNumt	   endResNum(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtBuildBackboneM  s’    	
!
$
!		%"%%$c         C   s   |  j  | | ƒ d S(   s   Respond to the user closing the next nucleotide window 
        
        ARUGMENTS:
            window - the window to close
            widget - the widget used to close the window
        NOTES:
            This function simply calls __nextNtClose with a reversed argument list
        N(   R²   (   RR   Rx   Rø   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtCloseWinú  s    c         C   s9   | j  ƒ  } d d d d g | } | |  _ |  j ƒ  d S(   s<  Mutate the base in response to the user selecting a base type from the drop-down
        
        ARGUMENTS:
            combobox - the drop down object used to select the new base type
        RETURNS:
            None
        EFFECTS:
            the current base is mutated to self.__baseType and redrawn
        Rˆ   R-   R‰   RŠ   N(   t
   get_activeR<   RW  (   RR   t   comboboxt   selectionNumR^  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtBaseSelect  s    	c         C   s,  |  j  d k	 r: |  j j |  j j k r: d GHt d ƒ d S|  j d k ra |  j j ƒ  \ } } n |  j j ƒ  \ } } | d k r• d GHt d ƒ d St	 |  j
 ƒ t	 |  j ƒ t	 |  j ƒ |  j d k	 rÛ t	 |  j ƒ n  d |  _ d |  _ |  j ƒ  } t | d | d | d ƒ |  j | | | ƒ d S(   sd  Cancels building the current nucleotide and moves back one nucleotide
        
        ARGUMENTS:
            widget - the button used to invoke this function
            window - the RCrane window
        RETURNS:
            None
        EFFECTS:
            Undraws the current nucleotide and prompts the user to rebuild the previous nucleotide
        s   Can't go back any further.Ni   i    i   i   (   R0   R.   R/   RS  R–   R   R1   t   removeLastBaseAndPhost   removeFirstBaseAndPhosR   R=   R>   R?   RB   R@   RA   Rñ   R   Rí   (   RR   Rø   Rx   t
   prevNtTypet   prevNtCoordsRÀ   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __nextNtPrevNt  s*    '

		c         C   sÊ   t  | | d | d | | d | d | d | | d | d ƒ	 t  | | d | d | d | | d | d | d | | d ƒ	 t  | | d | d | d | d | | d | d | d | ƒ	 d S(   sí  Draw a cross of the specified size and color
        
        ARGUMENTS:
            coords      - the coordinates for the center of the cross
            crossLength - the size of one "arm" of the cross (i.e. the distance from the center to the end, not end-to-end)
            crossColor  - the color of the cross
            object      - the Coot drawing object to add this cross to
        RETURNS:
            None
        EFFECTS:
            Adds the specified cross to object
        i   i    i   i   N(   R   (   RR   RÆ   t   crossLengtht
   crossColort   object(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __drawCrossS  s    BBc         C   s   |  j  | t t |  j ƒ d S(   sE  Draw a cross for a phosphate candidate
        
        ARGUMENTS:
            coords - the coordinates for the center of the cross
        RETURNS:
            None
        EFFECTS:
            Adds the cross to self.__candidatePhosObject
            Note that this function does not issue a graphics_draw() command
        N(   t   _TraceGui__drawCrosst   CROSS_LENGTH_PHOSt   CROSS_COLOR_PHOSR=   (   RR   RÆ   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __drawPhosCrosse  s    c         C   s   |  j  | t t |  j ƒ d S(   s=  Draw a cross for a C1' candidate
        
        ARGUMENTS:
            coords - the coordinates for the center of the cross
        RETURNS:
            None
        EFFECTS:
            Adds the cross to self.__candidateC1Object
            Note that this function does not issue a graphics_draw() command
        N(   R“  t   CROSS_LENGTH_C1t   CROSS_COLOR_C1R>   (   RR   RÆ   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __drawC1Crossr  s    c         C   sU   |  j  r t |  j  ƒ n  t t ƒ |  _  t |  j  d ƒ |  j | t t |  j  ƒ d S(   s‚  Draw a cross for the manually adjusted phosphate
        
        ARGUMENTS:
            coords - the coordinates for the center of the cross
        RETURNS:
            None
        EFFECTS:
            Deletes the current manually adjusted phosphate cross if one is present and creates a new cross
            Note that this function does not issue a graphics_draw() command
        i   N(   RB   R   R   t   ADJUST_PHOS_TITLER   R“  R”  R•  (   RR   RÆ   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __drawAdjustPhosCross  s
    	c         C   s?  |  j  r t |  j  ƒ n  t t ƒ |  _  t |  j  d ƒ t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t |  j  t d | d t | d t | d t | d t | d t | d t ƒ	 t ƒ  d S(   s>  Draw a new box around the specified point
        
        ARGUMENTS:
            coords - the coordinates for the center of the box
        RETURNS:
            None
        EFFECTS:
            Deletes the current box if one is present and creates a new box
            Then issues a graphics_draw() command
        i   i   i    i   N(	   R?   R   R   t   BATON_TITLER   R   t   BATON_COLORt
   BOX_LENGTHR   (   RR   RÆ   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt	   __drawBox“  s"    	UUUUUUUUUUUUc         C   s  |  j  r t |  j  ƒ n  t t ƒ |  _  t |  j  d ƒ t |  j  t d | d | d | d | d | d | d ƒ	 t |  j  t d | d | d | d | d | d | d ƒ	 | \ } } d } | d k r*d d g d d g d d	 g d	 d
 g d
 d g d d g d d g d d g d
 d g g	 } nq| d k r�d d g d d g d d	 g d	 d
 g d
 d g d d g d d g d d g d
 d g g	 } n| d k rd d g d d g d d g d d g d d
 g d
 d	 g d	 d g d d g d d g d d g d
 d g d d g d d g g } n� | d k r›d d g d d g d d g d d g d d
 g d
 d	 g d	 d g d d g d d g d d g d
 d g d d g g } n  xk | D]c } | \ }	 }
 | |	 } | |
 } t |  j  t d | d | d | d | d | d | d ƒ	 q¢Wt ƒ  d S(   s  Draw batons for a new nucleotide candidate
        
        ARGUMENTS:
            phos5 - the coordinates of the 5' phosphate
            c1    - the coordinates of the C1'
            phos3 - the coordinates of the 3' phosphate
            base  - a 2 item list consisting of (baseType, baseCoords)
                    baseType is either C, U, G, or A
                    baseCoords is a dictionary of atom type => coordinates
        EFFECTS:
            Draws the specified nucleotide
            Issues a graphics_draw() command
        i   i   i    i   R-   s   C1'R=  t   C2t   N3t   C4t   C5t   C6t   O2t   N4RŠ   t   O4R‰   R<  t   C8t   N7t   N2t   O6Rˆ   t   N6N(	   R?   R   R   Rœ  R   R   R�  R.   R   (   RR   t   phos5t   c1t   phos3t   baseR^  R_  t   bondListt	   bondAtomst   atom1t   atom2t   atom1Coordst   atom2Coords(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __drawNt»  s,    	==ZZ~u

Ac         C   sD   t  t ƒ |  _ t |  j d ƒ x |  j D] } |  j | ƒ q) Wd S(   s&  Draw crosses for all phosphate candidates
        
        ARGUMENTS:
            None
        RETURNS:
            None
        EFFECTS:
            Draws crosses for each point in self.__candidatePhosphates
            Note that this function does not issue a graphics_draw() command
        i   N(   R   t   CANDIDATE_PHOS_TITLER=   R   R7   t   _TraceGui__drawPhosCross(   RR   t   curPeak(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __drawPhosPeaksë  s    c         C   sz   |  j  d k	 r/ t |  j  ƒ r/ t |  j  ƒ n  t t ƒ |  _  t |  j  d ƒ x% |  j |  j D] } |  j	 | ƒ q_ Wd S(   sX  Draw crosses for all C1' candidates for the currently selected phosphate
        
        ARGUMENTS:
            None
        RETURNS:
            None
        EFFECTS:
            Draws crosses for each point in self.__candidateC1s for the current phosphate
            Note that this function does not issue a graphics_draw() command
        i   N(
   R>   R.   R   R   R   t   CANDIDATE_C1_TITLER   R9   R8   t   _TraceGui__drawC1Cross(   RR   Rº  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __drawC1Peaksþ  s    c         C   s  |  j  d k r d |  _  n	 d |  _  d } |  j d k rL |  j |  j } n	 |  j } |  j d k	 rz |  j d |  j ƒ n  |  j d k	 rŸ |  j d |  j ƒ n  t	 |  j
 ƒ t	 |  j ƒ t	 |  j ƒ |  j d k	 rå t	 |  j ƒ n  t ƒ  |  j | d | ƒd S(   s3  Switch the direction of the trace ( from 3'->5' to 5'->3', or vice-versa)
        ARGUMENTS:
            widget   - the button used to call this function
            prevPhos - the coordinates of the previous phosphate atom
            window   - the RCrane window
        RETURNS:
            None
        i   i   R¾   N(   R1   R.   R@   R7   R8   RD   Rî   RF   Rï   R   R=   R>   R?   RB   R   Rí   (   RR   Rø   RÀ   Rx   R6  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __switchDirection	  s$    
			c         C   sg   |  j  d k r0 |  j d k r' d } qW d } n' |  j d k rN |  j j } n	 |  j  } |  j j | ƒ S(   sê   Get the coordinates of the previous phosphate
        
        ARGUMENTS:
            None
        RETURNS:
            the coordinates of the previous phosphate (phosphate -1 if tracing 5'->3', phosphate 1 if tracing 3'->5')
        i   iÿÿÿÿi    N(   R0   R.   R1   R/   R–   R—   (   RR   t   prevResIndex(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __getPrevPhosCoordsG	  s    				c         C   sð   |  j  d k r* |  j j |  j ƒ d k	 sN |  j  d k r[ |  j j |  j ƒ r[ |  j ƒ  n‘ |  j  d k r‚ d d d d d g } n d d	 d
 d d g } d } x? | D]. } |  j j | |  j ƒ } | d k	 r¤ Pq¤ q¤ Wd GHt S|  j	 | ƒ d S(   sã   Start an extend chain call
        
        ARGUMENTS:
            None
        RETURNS:
            False if we could not find any atoms to use for starting coordinates (if this happens, something has gone very wrong)
        i   i   s   O3's   C3's   C2's   O2's   C1's   O5's   C5's   C4's   O4's2   No suitable atoms found to start phosphate search.N(
   R1   R/   R—   R0   R.   Rq  Rí   t   getAtomCoordsFromIndexRN   RP   (   RR   t	   atomOrdert   startCoordsR4  (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __extendChainSetup^	  s    	*$c         C   s>   |  j  d k r |  j j ƒ  St |  j j |  j j ƒ d Sd S(   s¶   Calculate the number of nucleotides that have been traced thus far
        
        ARGUMENTS:
            None
        RETURNS:
            The number of nucleotides traced
        i   N(   R0   R.   R/   R•   t   absR–   RS  (   RR   (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __numNtsTracedƒ	  s    	c   
      C   s×  |  j  j | ƒ } d	 } d	 } |  j d k r| | d |  j  j ƒ  k rJ t S|  j  j | d ƒ } |  j  j d | d ƒ } n? | d k rŒ t S|  j  j | d ƒ } |  j  j d | d ƒ } | d	 k	 rå t | | ƒ t k rå t	 } n t } | d	 k	 rt | | ƒ t
 k rt	 } n t } d	 } | s-| r.|  j d k rI| d } n
 | d } |  j  j | ƒ s°|  j  j | ƒ d	 k r†t	 } n  |  j  j | ƒ }	 |	 t k r°t	 } q°n  |  j  j | ƒ d d k rÐt S|  j d k r |  j  j | ƒ d	 k r t	 } q.|  j d k r.|  j  j | ƒ r.t	 } q.n  | r{|  j d k rV|  j  j | ƒ n |  j  j | d ƒ | rtt Sd SnX | r¸|  j d k r¸|  j  j | | d ƒ | r±t Sd Sn | rÏ| rÈt Sd Sn t Sd	 S(
   sž  If we're doing an extend chain, figure out if we've joined up to the next segment of the molecule.
        (i.e. if we're tracing 5'->3', has the 3' end of the newly traced segment met up with the next residue)
        If we are, then set up the molecule to prepare for the join (i.e. remove redundant phosphates)
        
        ARGUMENTS:
            endingResIndex - the residue index of the last residue of the newly traced segment
                we could determine this ourselves, but __nextNtBuildBackbone will have just finished determining
                it when this function is called
        RETURNS:
            False if the new segment was not joined
            1 if the segment was joined and a residue containing only a phosphate was deleted or merged into another residue
                (i.e. the residue numbering has changed by 1
            2 if the segment was joined no residues were deleted
        i   i   s   O5'i    s   O3'R�   i   i   N(   R/   R—   R.   R1   R•   RN   RÂ  R   t   CONNECTED_DISTANCE_CUTOFF_PHOSRt   R"   Rq  Rš   t   resTypeFromIndexR#   t   resNumR›   t   deleteResFromIndext   mergeRes(
   RR   Rw  t   newSegmentPhosCoordR�   t   nextOxyt   nextPhosIsCloset   nextOxyIsCloset   cantCalcPseudoTorst   nextResIndext   nextResType(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   __extendChainJoined’	  sh    !	!	
	'	"(7   t   __name__t
   __module__t   __doc__R.   RW   RP   Rí   RW  R´   R«   Rû   Rý   Rü   Rî   R®   R$  R%  R&  t   _TraceGui__adjustBaseCloseWinR#  Rï   Ri   Rj   Rk   RE  RH  RG  RF  Rm   R\   Rl   R©   Rª   R¬   R­   R¯   R²   Rd  R±   R”   R³   R°   R“  R¹  R½  R¤   Rg   R¥   Rf   R¡   Rµ   Rñ   RQ   R™   Rl  (    (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyR'   :   sj   ^	fÿ u	45i	,		%		}	1	'	'							(		"				9	7	7	.	.	:		 	­			:					(	0			0		%	(    (C   R×  t   cootR    R   R   R   R   R   R   R   R   R	   R
   R   R   R  R   R]   R2   t   copyR   R�   R   t	   strucCalcR   R   R   R   t
   rotamerSeqR   R   R   R   R   t   reviewSuitesGuiR   t   guiUtilsR   R   R   R   R   t   pseudoMoleculeR   R    t   citationPopupR!   R"   t   reportInputErrorsR#   R3   t   dirnamet   abspatht   __file__R5   R”  R•  R—  R˜  R¸  R¼  Rž  R�  Rœ  Rš  RÈ  R'   (    (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/python2.7/site-packages/coot/rcrane/traceGui.pyt   <module>   s<   X	"(