+\begin{figure}[htbp]
+\begin{center}
+\includegraphics[]{images/pdbdragdropassoc.pdf}
+
+\caption{{\bf Associating PDB files with sequences by drag-and-drop.} Dragging
+PDB files to an alignment of sequences with names matching the dragged
+files names (A), results in a dialog box (B) that gives the option to associate each file with any sequences with matching IDs. }
+\label{multipdbfileassocfig}
+\end{center}
+\end{figure}
+
+
+\subsection{Viewing Protein Structures}
+The structure viewer can be launched in two ways from the sequence ID context
+menu. To view a particular structure associated with a sequence in the
+alignment, simply select it from popup menu's associated structures submenu in
+{\sl Structure $\Rightarrow$ View Structure $\Rightarrow$ $<$PDB ID$>$}. The
+second way is most useful if you want to view all structural data available for
+a set of sequences in an alignment. If any of the {\bold currently selected}
+sequences have structures associated, the {\sl Structure } submenu of the
+sequence ID popup menu will include an option to {\sl View {\bold N}
+structures}. Selecting this option will open a new structure view containing
+the associated structures superposed according to the alignment.
+
+In both cases, each structure to be displayed will be downloaded or loaded from
+the local file system, and shown as a ribbon diagram coloured according to the
+associated sequence in the current alignment view (Figure \ref{structure}
+(right)). The structure can be rotated by clicking and dragging in the structure
+window. The structure can be zoomed using the mouse scroll wheel (if available).
+Moving the mouse cursor over a sequence to which the structure is linked in the
+alignment panel highlights the respective residue's sidechain atoms. The
+sidechain highlight may be obscured by other parts of the molecule. Similarly,
+moving the cursor over the structure shows a tooltip and highlights the
+corresponding residue in the alignment. Often, the position highlighted may not
+be in the visible portion of the current alignment view. If the alignment
+window's {\sl View $\Rightarrow$ Automatic Scrolling } option is not selected,
+then you may have to manually move the alignment scroll bars to see the
+highlighted region.
+
+\begin{figure}[htbp]
+\begin{center}
+\parbox{3in}{
+{\centering
+\begin{center}
+\includegraphics[scale=0.5]{images/structure1.pdf}
+\end{center}
+}
+}
+\parbox{3.2in}{
+{\centering
+\begin{center}
+\includegraphics[width=3in]{images/structure2.pdf}
+\end{center}
+}
+}
+\caption{{\bf Structure visualization} The structure viewer is launched from the sequence ID context menu (left) and allows the structure to be visualized using the embedded Jmol molecular viewer (right). }
+\label{structure}
+\end{center}
+\end{figure}
+
+\subsection{Customising structure display}
+
+Structure display can be modified using the {\sl Colour} and {\sl View} menus
+in the structure viewer. The background colour can be modified by selecting the
+{\sl Colours $\Rightarrow$ Background Colour\ldots} option.
+
+By default, the structure will be coloured in the same way as the
+associated sequence(s) in the alignment view from which it was launched. The
+structure can be coloured independently of the sequence by selecting an
+appropriate colour scheme from the {\sl Colours} menu. It can be coloured
+according to the alignment using the {\sl Colours $\Rightarrow$ By Sequence } option. The image in the structure viewer can be
+output to EPS or PNG format via the {\sl File $\Rightarrow$ Save As
+$\Rightarrow$ \ldots} submenu. The mapping between the structure and the
+sequence (How well and which parts of the structure relate to the sequence)
+can be viewed with the {\sl File $\Rightarrow$ View Mapping} menu option.
+
+\subsubsection{Using the Jmol visualization interface }
+
+Jmol has a comprehensive set of selection and visualization functions that are
+accessed from the Jmol popup menu (by right-clicking in the Jmol window or by
+clicking the Jmol logo). Molecule colour and rendering style can be
+manipulated, and distance measurements and molecular surfaces can be added to
+the view. It also has its own ``Rasmol\footnote{see
+http://www.rasmol.org}-like'' scripting language, which is described elsewhere\footnote{Jmol Wiki: \url{http://wiki.jmol.org/index.php/Scripting}
+
+Jmol Scripting reference:
+\url{http://www.stolaf.edu/academics/chemapps/jmol/docs/}}. Jalview utilises the
+scripting language to interact with Jmol and to store the state of a Jmol visualization within Jalview archives, in addition to the PDB data file originally loaded or retrieved by Jalview. To access the Jmol scripting environment directly, use the {\sl Jmol $\Rightarrow$ Console} menu option.
+
+If you would prefer to use Jmol to manage structure colours, then select the
+{\sl Colours $\Rightarrow$ Colour with Jmol} option. This will disable any
+automatic application of colour schemes when new structure data is added, or
+when associated alignment views are modified.
+
+
+\exercise{Viewing Structures}{\label{viewingstructex}
+\exstep{Load the alignment at
+\textsf{http://www.jalview.org/examples/exampleFile.jar}. Right-click on the
+sequence ID label for any of the sequences (e.g. {\sl FER1\_SPIOL}) to bring up
+the context menu. Select {\sl FER1\_SPIOL $\Rightarrow$ Structure $\Rightarrow$
+Associate Structure with Sequence $\Rightarrow$ Discover
+PDB ids}. Jalview will now attempt to find PDB structures for the sequences in
+the alignment. } \exstep{ Right-click on the sequence ID for {\sl FER1\_SPIOL}.
+Select { \sl FER1\_SPIOL $\Rightarrow$ Structure $\Rightarrow$ View Structure
+$\Rightarrow$ 1A70} A structure viewing window appears. Rotate the molecule by clicking and dragging in the structure viewing box. Zoom with the mouse scroll wheel. } \exstep{Roll the mouse cursor along the {\sl FER1\_SPIOL} sequence in the alignment. Note that if a residue in the sequence maps to one in the structure, a label will appear next to that residue in the structure viewer. Move the mouse over the structure. Placing the mouse over a part of the structure will bring up a tool tip indicating the name and number of that residue. The corresponding residue in the sequence is highlighted in black. Clicking the alpha carbon toggles the highlight and residue label on and off. Try this by clicking on a set of three or four adjacent residues so that the labels are persistent, then finding where they are in the sequence. } \exstep{Select {\sl Colours $\Rightarrow$ Background Colour\ldots} from the structure viewer menu and choose a suitable colour. Press {\sl OK} to apply this. Select {\sl File $\Rightarrow$ Save As $\Rightarrow$ PNG} and save the image. View this with your web browser. }
+\exstep{Select {\sl File $\Rightarrow$ View Mapping} from the structure viewer menu. A new window opens showing the residue by residue alignment between the sequence and the structure.}
+
+\exstep{Select {\sl File $\Rightarrow$ Save $\Rightarrow$ PDB file} and choose a new filename to save the PDB file. Once the file is saved, open the location in your file browser (or explorer window) and drag the PDB file that you just saved on to the Jalview desktop (or load it from the {\sl Jalview Desktop $\Rightarrow$ Input Alignment $\Rightarrow$ From File } menu). Verify that you can open and view the associated structure from the sequence ID pop-up menu's {\sl Structure } submenu in the new alignment window.}
+
+\exstep{Right click on the structure to bring up the Jmol window. Explore the menu options. Try to change the style of molecular display - by first using the {\sl Jmol $\Rightarrow$ Select $\Rightarrow$ all} command, and then the {\sl Jmol $\Rightarrow$ Style $\Rightarrow$ Scheme $\Rightarrow$ Ball and stick} command.}
+\exstep{Use the {\sl File $\Rightarrow$ Save As .. } function to save the alignment as a Jalview Project. Now close the alignment and the structure view, and load the project file you just saved.
+
+Verify that the Jmol display is as it was when you just saved the file.}
+}
+
+\subsection{Superimposing structures}
+\label{superposestructs}
+Many comparative biomolecular analysis investigations aim to determine if the
+biochemical properties of a given molecule are signficantly different to its
+homologues. When structure data is available, comparing the shapes of molecules
+by superimposing them enables substructure that may impart different behaviour
+to be quickly identified. The identification of optimal 3D superpositions
+involves aligning 3D data rather than sequence symbols, but the result can
+still be represented as a sequence alignment, where columns indicate positions
+in each molecule that should be superposed to recreate the optimal 3D alignment.
+
+Jalview can employ Jmol's 3D fitting routines\footnote{See
+\href{http://chemapps.stolaf.edu/jmol/docs/?ver=12.2#compare}{http://chemapps.stolaf.edu/jmol/docs/?ver=12.2$\#$compare}
+for more information.} to recreate 3D structure superpositions based on the
+correspondences defined by one or more sequence alignments involving structures shown in the Jmol display. Superposition based on the currently displayed alignment view happens automatically if a
+structure is added to an existing Jmol display using the {\sl Structure
+$\Rightarrow$ View PDB Structure $\Rightarrow$ ..}. A new Jmol view containing
+superposed structures can also be created using the {\sl Structure
+$\Rightarrow$ View all {\bf N} PDB Structures} option (when {\bf {\sl N}}
+$>$ 1) if the current selection contains two or more sequences with associated
+structures.
+
+\subsubsection{Obtaining the RMSD for a superposition}
+Figure \ref{mstrucsuperposition} shows a superposition created during the course
+of Exercise \ref{superpositionex}. The parts of each molecule used to construct
+the superposition are rendered using the cartoon style, with other parts of
+the molecule drawn in wireframe. The Jmol console, which has been opened after
+the superposition was performed, shows the RMSD report for the superposition.
+Full information about the superposition is also output to the Jalview console,
+including the precise atom pairs used to superpose structures.
+
+\subsubsection{Choosing which part of the alignment is used for structural
+superposition}
+Jalview uses the visible part of each alignment view to define which parts of
+each molecule are to be corresponded. Hiding a column in a view used for
+superposition will remove that correspondence from the set, allowing
+the selection of specific parts of the alignment to be used for
+superposition. Only columns that define a complete set of correspondences for
+all structures will be used for structural superposition, and as a consequence,
+the RMSD values generated for each pair of structures superimposed can be
+directly compared.
+
+In order to recompute a superposition after changing a view or editing the
+alignment, select the {\sl Jmol $\Rightarrow$ Align } menu option. The {\sl
+Jmol $\Rightarrow$ Superpose with ..} submenu allows you to choose which of the
+associated alignments and views are to be used to create the set of
+correspondences. This menu is useful when composing complex superpositions
+involving multi-domain and multi-chain complexes, when correspondences may be
+defined by more than one alignment.
+
+
+\begin{figure}[htbp]
+\begin{center}
+\includegraphics[width=5.5in]{images/fdxsuperposition.pdf}
+\caption{{\bf Superposition of two ferredoxin structures.} The alignment on the
+left was used by jalview to superpose structures associated with the
+FER1\_SPIOL and FER1\_MAIZE sequences in the alignment. Parts of each structure
+used for superposition are rendered as a cartoon, the remainder rendered in
+wireframe. The RMSD between corresponding positions in the structures before and
+after the superposition is shown in the Jmol console. }
+\label{mstrucsuperposition}
+\end{center}
+\end{figure}
+
+\exercise{Aligning structures using the ferredoxin
+sequence alignment.}{\label{superpositionex}
+
+\exstep{Continue with the Jalview project created in exercise
+\ref{viewingstructex}. Use the {\sl Discover PDB IDs} function to retrieve PDB
+IDs associated with the FER1\_MAIZE sequence.}
+\exstep{Once discovery has completed, use the {\sl
+View PDB Structure} submenu to view the PDB file associated with FER1\_MAIZE.
+Jalview will give you the option of aligning the structure to the one already
+open. To superimpose the structure associated with FER1\_MAIZE with the one
+associated with FER1\_SPIOL, press the {\bf Yes} button.
+
+{\sl The Jmol view will update to show both structures, and one will be
+moved on to the other.}}
+\exstep{Create a new view on the alignment, and hide all but columns 121
+through to 132.}
+\exstep{Use the {\sl Jmol} submenu to
+recompute the superposition using just columns 121-132 of the alignment.
+
+{\sl Note how the molecules shift position when superposed using a short part of
+the two structures.}}
+\exstep{Compare the initial and final RMSDs for superimposing molecules with
+the small section and with the whole alignment. Which view do you think give the
+best 3D superposition, and why ?} }
+
+\subsection{Colouring structure data associated with multiple alignments and
+views}
+Normally, the original view from which a particular structure view was
+opened will be the one used to colour structure data. If alignments involving
+sequences associated with structure data shown in a Jmol have multiple views, Jalview gives you full control
+over which alignment, or alignment view, is used to colour the structure
+display. Sequence-structure colouring associations are
+changed {\sl via} the {\sl View $\Rightarrow$ Colour by} menu, which lists all
+views associated with data shown in the embedded Jmol view. A tick is shown beside
+views currently used as colouring source, and moving the
+mouse over each view will bring it to the front of the alignment display,
+allowing you to browse available colour sources prior to selecting one. If the
+{\sl Select many views} option is selected, then multiple views can be selected as sources for colouring the
+structure data. {\sl Invert selection} and {\sl Select all} options are also provided to quickly change between multi-view selections.
+
+\begin{figure}[htbp]
+\begin{center}
+\includegraphics[width=5.5in]{images/mviewstructurecol.pdf}
+\caption{{\bf Choosing a different view for colouring a structure display}
+Browsing the {\sl View $\Rightarrow$ Colour by ..} menu provides full control
+of which alignment view is used to colour structures when the {\sl Colour
+$\Rightarrow$ Colour by sequence} option is selected.}
+\label{mviewstructurecol}
+\end{center}
+\end{figure}
+
+\subsubsection{Colouring complexes}
+
+The ability to control which multiple alignment or view is used to colour
+structural data is essential when working with data relating to
+multidomain biomolecules and complexes.
+
+In these situations, each chain identified in the structure may have a different
+evolutionary history, and a complete picture of functional variation can
+only be gained by integrating data from different alignments on the same
+structure view. An example of this is shown in Figure
+\ref{mviewalcomplex}, based on data from Song et. al\footnote{Structure of
+DNMT1-DNA Complex Reveals a Role for Autoinhibition in Maintenance DNA Methylation. Jikui Song, Olga Rechkoblit, Timothy H. Bestor, and Dinshaw J. Patel.
+{\sl Science} {\bf 331} 1036-1040
+\href{http://www.sciencemag.org/content/331/6020/1036}{DOI:10.1126/science.1195380}}
+
+\begin{figure}[htbp]
+\begin{center}
+\includegraphics[]{images/mchainstructureview.pdf}
+\caption{{\bf The biological assembly of Mouse DNA Methyltransferase-1 coloured
+by Pfam alignments for its major domains} Alignments for each domain within the
+Uniprot sequence DNMT1\_MOUSE have been used to visualise sequence conservation
+in each component of this protein-DNA complex. Instructions for recreating this figure are given in exercise \ref{dnmtcomplexex}. }
+\label{mviewalcomplex}
+\end{center}
+\end{figure}
+
+\exercise{Colouring a protein complex to explore domain-domain interfaces}{\label{dnmtcomplexex}
+
+\exstep{Download the PDB file at
+\textsf{http://www.jalview.org/tutorial/DNMT1\_MOUSE.pdb} to your desktop. This
+is the biological unit for PDB ID 3pt6, as identified by the PDBe's PISA server.}
+
+\exstep{Launch the Jalview desktop and ensure you have at least 256MB of
+free memory available.
+
+{\sl Use the following webstart link:
+\href{http://www.jalview.org/webstart/jalview_1G.jnlp}{http://www.jalview.org/webstart/jalview\_1G.jnlp}}.}
+\exstep{Retrieve the following
+{\bf full} PFAM alignments: PF02008, PF00145, PF01426. These will each be retrieved into their own alignment window.}
+\exstep{Drag the structure you downloaded in
+step 1 onto one of the alignments to associate it with the mouse sequence in
+that Pfam domain family.}
+\exstep{For every DNMT1\_MOUSE sequence in the alignment, use the sequence
+ID popup menu's structure submenu to view the DNMT1\_MOUSE structure for the associated mouse sequence. Check the contents of
+the {\sl View $\Rightarrow$ Colour by ..} submenu to see what alignments can be used to
+colour the sequence.}
+\exstep{Repeat the previous two steps for each of
+the other alignments. In each case, when performing the `View DNMT1\_MOUSE.pdb'
+step, Jalview will ask you if you wish to create a new Jmol view. You should
+respond `No', ensuring that each sequence fragment is associated with the same Jmol view.}
+\exstep{Pick a different colourscheme for each alignment, and use the {\sl
+Colour by ..} submenu to ensure they are all used to colour the complex shown
+in the Jmol window.}
+\exstep{The final step needed to reproduce the shading in Figure
+\ref{mviewalcomplex} is to use the {\sl Colour $\Rightarrow$ By
+Annotation } option in each alignment window to shade the alignment by the
+{\bf Conservation} annotation row. This function was described in section
+\ref{colourbyannotation}.
+
+{\sl Note: Choose a different shading scheme for each
+alignment so that the regions of strong physicochemical conservation are highlighted. This
+kind of shading will reveal conserved regions of interaction between domains
+in the structure.}}
+\exstep{Save your work as a Jalview project and verify that it can be opened again by starting another Jalview Desktop instance, and dragging the saved project into the desktop window.}
+{\sl Note: This exercise relies on new features introduced in Jalview 2.7. If
+you notice any strange behaviour when trying out this exercise, it may be a
+bug (see
+\href{http://issues.jalview.org/browse/JAL-1008}{http://issues.jalview.org/browse/JAL-1008}
+for one relating to highlighting of positions in the alignment window).} }
+
+\section{Analysis of alignments}
+\label{alignanalysis}
+Jalview provides support for sequence analysis in two ways. A number of analytical methods are `built-in' and run inside Jalview itself and are mostly accessed from the {\sl Calculate} alignment window menu. Computationally intensive analyses are run outside Jalview via web services - these are typically accessed via the {\sl Web Services} menu, and described in Section \ref{jvwebservices}. In this section, we describe the built-in analysis capabilities common to both the Jalview Desktop and the JalviewLite applet.