-Jalview supports both GFF and its own Jalview Features file format for the import of sequence annotation. Features and alignment annotation are also extracted from other formats such as Stockholm, and AMSA. URL links may also be attached to features. See the online documentation for more details of the capabilities of the jalview features file.
-
-\section{Working with structures}
-Jalview provides integration between protein sequences and protein structures by providing a linked view of structures associated with protein sequences in the alignment. The Java based GPL molecular viewer Jmol\footnote{see the Jmol homepage www.jmol.org for more information.} is incorporated, enabling sophisticated molecular visualization to be prepared and investigated alongside analysis of associated sequences. \footnote{Earlier versions of Jalview included MCView - a simple main chain structure viewer. Structures are visualised as an alpha carbon trace and can be viewed, rotated and coloured in a structure viewer and the results interpreted on a sequence alignment.}
-
-PDB format files can be imported directly or structures can be retrieved from the the Macromolecular Structure Database (MSD) using the {\sl Sequence Fetcher}.
-
-\subsection{Automatic association of PDB structures with sequences}
-Jalview can automatically determine which structures are associated with a sequence, if that sequence has an ID from a public database such as Uniprot. Right-click on any sequence ID and select {\sl $<$Sequence ID$>$ $\Rightarrow$ Associate Structure with Sequence $\Rightarrow$ Discover PDB IDs } from the context menu (where {\sl $<$Sequence ID$>$} is the ID of the sequence on which you clicked) (Figure \ref{auto}). Jalview will attempt to associate the sequence with a Uniprot sequence and from there discover any associated PDB structures. This takes a few seconds and applies to all sequences in the alignment which have valid Uniprot IDs. On moving the cursor over the sequence ID the tool tip now shows the Uniprot ID and any associated PDB structures.
-
-\begin{figure}[htbp]
-\begin{center}
-%TODO fix formatting
-\parbox{1.5in}{
-{\centering
-\begin{center}
-\includegraphics[width=1.5in]{images/auto1.pdf}
-\end{center}}
-} \parbox{3.25in}{
-{\centering
-\begin{center}
-\includegraphics[scale=0.5]{images/auto2.pdf}
-\end{center}
-}
-} \parbox{1.5in}{
-{\centering
-\begin{center}
-\includegraphics[width=1.5in]{images/auto3.pdf}
-\end{center}
-}
-}
-
-\caption{{\bf Automatic PDB ID discovery.} The tooltip (left) indicates that no PDB structure has been associated with the sequence. After PDB ID discovery (center) the tool tip now indicates the Uniprot ID and any associated PDB structures (right)}
-\label{auto}
-\end{center}
-\end{figure}
-
-\subsection{Viewing Protein Structures}
-The structure viewer can be launched through the sequence ID context menu. Select {\sl Structure $\Rightarrow$ View PDB entry $\Rightarrow$ $<$PDB ID$>$}. The structure 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 the sequence to which the structure is linked in the alignment panel highlights the respective residue by showing its sidechain. Moving the cursor over the structure shows a tooltip and highlights the corresponding residue in the alignment.
-
-\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 visualisation} The structure viewer is launched from the sequence ID context menu (left) and allows the structure to be visualised using the embedded Jmol molecular viewer (right). }
-\label{structure}
-\end{center}
-\end{figure}
-
-\subsubsection{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 sequence in the associated alignment view. 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 www.rasmol.org}-like scripting language, and this is used by Jalview 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.
-
-
-\exercise{Viewing Structures}{
-\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$ 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$ View PDB Entry: 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{Colouring features by score or description
+text}
+\label{featureschemes}
+Sometimes, you may need to visualize the differences in information carried by
+sequence features of the same type. This is most often the case when features
+of a particular type are the result of a specific type of database query or calculation. Here, they may also carry information within their textual description, or most commonly for calculations, a score related to the property being investigated. Jalview can shade sequence
+features using a graduated colourscheme in order to highlight these variations.
+In order to apply a graduated scheme to a feature type, select the `Graduated
+colour' entry in the Sequence feature type's popup menu, which is opened by
+right-clicking the feature type's color in the settings dalog box. Two types
+of colouring styles are currently supported: the default is quantitative
+colouring, which shades each feature based on its score, with the highest
+scores receiving the 'Max' colour, and the lowest scoring features coloured
+with the 'Min' colour. Alternately, you can select the `Colour by label'
+option to create feature colours according to the description text associated
+with each feature. This is useful for general feature types - such as
+Uniprot's 'DOMAIN' feature - where the actual type of domain is given in the
+feature's description.
+
+Graduated feature colour schemes can also be used to exclude low or
+high-scoring features from the alignment display. This is done by choosing your
+desired threshold type (either above or below), using the drop-down menu in the
+dialog box. Then, adjust the slider or enter a value in the text box to set the
+threshold for displaying this type of feature.
+
+The feature settings dialog box allows you to toggle between a graduated and
+simple feature colourscheme using the pop-up menu for the feature type. When a
+graduated scheme is applied, it will be indicated by in the colour column for
+that feature type - with coloured blocks or text to indicate the colouring
+style and a greater than ($>$) or less than ($<$) symbol to indicate when a
+threshold has been defined.
+
+\subsection{Using features to re-order the alignment}
+\label{featureordering}
+The presence of sequence features on certain seqences or in a particular
+region of an alignment can quantitatively identify important trends in
+the aligned sequences. In this case, it is more useful to
+re-order the alignment based on the number of features or their associated scores, rather than simply re-colour the aligned sequences. The sequence feature settings
+dialog box provides buttons two buttons, `Seq sort by Density' and `Seq sort by
+Score' that allow you to reorder the alignment according to the number of
+sequence features present on each sequence, and also according to any scores
+associated with a feature. Each of these buttons uses the currently displayed
+features to determine the ordering, but
+if you wish to re-order the alignment using a single type of feature, then you can do this from the feature type's
+popup menu. Simply right-click the type's style in the Feature Settings dialog
+box, and select one of the {\sl Sort by score} and {\sl Sort by density}
+options to re-order the alignment. Finally, if a specific region is selected,
+then only features found in that region of the alignment will be used to
+create the new alignment ordering.
+
+\exercise{Shading and sorting alignments using sequence features}{
+\label{shadingorderingfeatsex}
+\exstep{Re-load the alignment from \ref{dasfeatretrexcercise}.
+}
+\exstep{Open the
+feature settings panel, and, after first clearing the current
+selection, press the {\em Seq Sort by Density} button a few times.}
+\exstep{Use the DAS fetcher to retrieve the Kyte and Doolittle Hydrophobicity
+scores for the protein sequences in the alignment.
+{\sl Hint: the nickname for the das source is `kd$\_$hydrophobicity'.}}
+\exstep{Change the feature settings so only the hydrophobicity features are
+displayed. Mouse over the annotation and also export and examine the GFF and
+Jalview features file to better understand how the hydrophobicity measurements
+are recorded.}
+\exstep{Apply a graduated colourscheme to the hydrophobicity annotation to
+reveal the variation in average hydrophobicity across the alignment.}
+\exstep{Select a range of alignment columns, and use one of the sort by feature buttons to order the alignment according to that region's average
+hydrophobicity.}
+\exstep{Save the alignment as a project, for use in exercise
+\ref{threshgradfeaturesex}.} }
+
+\exercise{Shading alignments with combinations of graduated feature
+colourschemes}{
+\label{threshgradfeaturesex}
+\exstep{Reusing the annotated alignment from exercise
+\ref{shadingorderingfeatsex}, experiment with the colourscheme threshold to
+highlight the most, or least hydrophobic regions. Note how the colour scheme icon for the feature type changes when you change the threshold type.}
+\exstep{Change the colourscheme so
+that features at the threshold are always coloured grey, and the most
+hydrophobic residues are coloured red, regardless of the threshold value
+({\em hint - there is a switch on the dialog to do this for you}).}
+\exstep{Enable the Uniprot {\em chain} annotation in the feature settings
+display and re-order the features so it is visible under the hydrophobicity
+annotation.}
+\exstep{Apply a graduated colourscheme to the {\em chain}
+annotation so that it distinguishes the different canonical names associated
+with the mature polypeptide chains.}
+\exstep{Export the alignment's sequence features using the Jalview sequence
+feature file format, to see how the different types of graduated feature
+colour styles are encoded. }