VIDA Sketcher Window
-----------------------

The 2D sketcher window contains a basic 2D sketching environment at 
the top and a 1D text entry mechanism below that. The 1D input mechanism provides 
a very fast way to specify a new molecule or get started with new molecule
creation. The 1D input mechanism supports SMILES, IUPAC and common names, as well 
as FASTA sequences for small peptides (sequence must be prefixed by a leading 
angle bracket (>) character). Disconnected fragments can be specified on the 1D 
input line by entering a vertical bar (|) character between the entries.  Once a 
valid molecule has been specified in the 1D area, that molecule will be depicted in the 2D sketching area.

A basic overview of the 2D sketcher can be seen in :ref:`Figure: 2D Sketcher<figure_sketcher>`


.. figure:: images/2D_sketcher.png
   :scale: 75
   :align: center

   **2D Sketcher**

.. list-table::
  :widths: 15 50
  :header-rows: 1
  
  * - Icon
    - Description
  * - .. image:: images/2D_sketcher_icons/pencil.png
    - **Pencil:**  This is the default drawing tool.  With the pencil icon selected (highlighted) click in the 
      main sketcher window to start drawing a new molecule.  Clicking on an atom in 
      the main sketcher window will incrementally build up a carbon chain.  The attachment points 
      are highlighted in orange.  Clicking on a bond will toggle the bond order.
      This tool can also be used to close rings.  Click on the first 
      atom and drag to the second atom where the ring will close.

      Hovering the mouse over an atom or bond highlights it orange.  Right-click on the highlighted 
      atom to access a right-click menu which allows the user to *Set Element*, *Set Formal Charge* 
      or *Delete* the selected atom/bond.  If a bond is highlighted then the 
      right-click menu offers an option to *Set Bond Order*.  There are also options to 
      *Attach...* (through an atom) or *Fuse...* (through an atom or bond) a functional group.  
      In these cases a secondary dialog opens 
      in which a SMILES string can be input of the group to be attached or fused. 
  * - .. image:: images/2D_sketcher_icons/bond.png
    - **Bond order:**  
      Clicking on a bond in the main sketcher window will cycle through the
      available bond orders for that bond.

      Bond order can also be set through the *Set Bond Order* option of the right-click menu.
      Hovering the mouse over an individual bond will temporarily highlight it orange
      and the right-click menu will operate on that bond only.  If multiple bonds are 
      selected (and therefore highlighted orange) using the *Selection* tool (below) then they
      will ALL be set to the new bond order using *Bond Order* in the right-click menu.
      Available options are 0-4 where 0 will break the bond.
  * - .. image:: images/2D_sketcher_icons/element.png
    - **Element:**  
      Click on the small arrow to open a dropdown menu and select from some commonly 
      used elements.  Clicking on an atom in the main 2D sketcher window will cause 
      that atom to be changed to the selected atom type.  In addition to the 
      commonly used atoms there is an "X" dummy atom type.  Clicking the "..." option in 
      the list opens a full periodic table of the elements from which any element 
      can be selected.

      This icon shows an image of the currently active atom type.  The default is 
      "C".

      Atoms types can also be set through the *Set Element* option of the right-click menu.
      Hovering the mouse over a single atom will temporarily highlight it orange
      and the right-click menu will operate on that atom only.  If multiple atoms are 
      selected (and therefore highlighted orange) using the *Selection* tool (below) then they
      will ALL be set to the same atom type using *Set Element* in the right-click menu.
  * - .. image:: images/2D_sketcher_icons/charge.png
    - **Charge:**  Click on the small arrow to open a dropdown and select the formal 
      charge for an atom.  Options available are -2, -1, 0, +1, +2.  With the 
      charge icon active (highlighted white) clicking on any atom in the main 
      sketcher window will modify the atom to have the currently selected charge.

      This icon displays an image of the currently active charge.  
      The default is "-2".

      Formal charge can also be set through the *Set Formal Charge* option of the right-click menu.
      Hovering the mouse over an individual atom will temporarily highlight it orange
      and the right-click menu will operate on that atom only.  If multiple atoms are 
      selected (and therefore highlighted orange) using the *Selection* tool (below) then they
      will ALL be set to the new formal charge using *Set Formal Charge* in the right-click menu.
      This method provides a wider range of charge values than can be accessed using the *Charge* icon.
  * - .. image:: images/2D_sketcher_icons/rings.png
    - **Rings:**  
      Click on the small arrow to open a dropdown menu and select from some commonly 
      used rings, such as benzene, cyclopropane and cyclohexane. The selected  
      ring can be added to the growing molecule multiple times.  The attachment atom or fusion bond 
      is highlighted in orange and alternative fusion options can be accessed using 
      the mouse scroll wheel.  

      This icon shows an image of the currently active ring template.  The default is benzene.

.. list-table::
  :widths: 15 50
  :header-rows: 0

  * - .. image:: images/2D_sketcher_icons/templates.png
    - **Templates:**  
      Click on the small arrow to open a dropdown menu and select from numerous 
      predefined template functional groups, linkers and rings.  There is also an 
      option to define a Custom functional group.  This opens a new dialog into 
      which a SMILES string can be input.  The selected functional group, linker or 
      ring can be added to the growing molecule multiple times.  The attachment atom or fusion bond 
      is highlighted in orange and alternative fusion options can be accessed using 
      the mouse scroll wheel.

      This icon shows an image of the currently active functional group, linker or 
      ring.  The default is "C". 

      With the default "C" functional group selected clicking on an atom in the 
      main sketcher window will build up a carbon chain.  This tool can also be 
      used to close rings.  Click on the first atom and drag to the second atom 
      where the ring will close.
  * - .. image:: images/2D_sketcher_icons/stereo.png
    - **Stereochemistry:**  Click on the small arrow to open a dropdown and select 
      atom and bond CIP stereochemistry options.  Available options are R and S 
      for chiral atoms and E or Z for chiral bonds.  There is also an option to 
      invert the current stereochemistry.

      This icon displays an image of the currently active option.  
      The default is "Invert".

      If no stereochemistry is already set then clicking an atom with the *Invert* option 
      selected will initially set the stereochemistry to R and subsequent clicks with *Invert* will
      toggle between R and S.  In the case of bonds where no stereochemistry is already set the 
      *Invert* option will initially set the stereochemistry to E and then toggle between E and Z.
      Thus *Invert* can be considered a 'one stop shop'.
  * - .. image:: images/2D_sketcher_icons/select.png
    - **Select:**  With the arrow icon highlighted drag to draw a loop around the 
      atoms to be selected or Shift-click or Ctrl-click to incrementally select 
      multiple atoms and/or bonds.  The selected atoms and bonds will be 
      highlighted in orange.  

      A right-click menu allows the user to *Set Element*, *Set Formal Charge* 
      or *Delete* the selected atom(s).  This operation acts on ALL the selected atoms 
      *e.g.* they would all get the same charge.  If only bonds are selected then the 
      right-click menu offers an option to *Set Bond Order*.  There are also options to 
      *Attach...* (through an atom) or *Fuse...* (through an atom or bond) a functional group.  
      In these cases a secondary dialog opens 
      in which a SMILES string can be input of the group to be attached or fused.
  * - .. image:: images/2D_sketcher_icons/wand.png
    - **Clean up the display:** This tool is useful after portions of the molecule have been 
      deleted, especially if a ring has been cleaved.  It uses an OEDepict algorithm to 
      redraw the molecule according to an internal set of rules.
  * - .. image:: images/2D_sketcher_icons/undo.png
    - **Undo:**  Clicking on this icon will undo the last action in the main sketcher window.  
      Repetitive use will undo actions further back in the history.  *Ctrl-Z* is a keyboard
      shortcut that can also be used.
  * - .. image:: images/2D_sketcher_icons/eraser.png
    - **Eraser:**  Delete atoms and/or bonds by selecting the eraser tool and clicking on the 
      atom or bond to be deleted.

      Atoms and bonds can also be deleted through the *Delete* option of the right-click menu.
      Hovering the mouse over a single atom or bond will temporarily highlight it orange
      and the right-click menu will operate on that atom/bond.  If multiple atoms/bonds are 
      selected (and therefore highlighted orange) using the *Selection* tool (below) then they
      will ALL be deleted using *Delete* in the right-click menu.
