-\documentclass[11pt]{report}
+\documentclass[a4paper,11pt]{report}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
+\usepackage{hyperref}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
-\textwidth = 6.5 in
-\textheight = 9 in
-\oddsidemargin = 0.0 in
-\evensidemargin = 0.0 in
-\topmargin = 0.0 in
-\headheight = 0.0 in
-\headsep = 0.0 in
-\parskip = 0.2in
-\parindent = 0.0in
+\textwidth = 6.5 in \textheight = 9 in \oddsidemargin = 0.0 in \evensidemargin =
+0.0 in \topmargin = 0.0 in \headheight = 0.0 in \headsep = 0.0 in \parskip =
+0.2in \parindent = 0.0in
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}{Definition}
-\title{Jalview 2.2: A manual and introductory tutorial}
-\author{David Martin}
-\r%\renewcommand{menustyle}{\tt}\r%do something more advanced here.\r\begin{document}\r
+\title{Jalview 2.4: A manual and introductory tutorial }
+\author{David Martin, James Procter, Andrew Waterhouse, Geoff Barton}
+% how the hell do we add another panel with text like : This tutorial introduces
+% the user to the features of Jalview, a multiple sequence alignment editor and
+% viewer available from http://www.jalview.org to the title page.
+
+% \renewcommand{menustyle}{\tt} %do something more advanced here.
+\begin{document}
\newcounter{ecount}
\newcounter{exstep}[ecount]
\renewcommand{\theecount} {\arabic{ecount}}
\renewcommand{\theexstep} {\arabic{ecount}.\alph{exstep}}
-\newcommand{\exercise}[2] { \refstepcounter{ecount} \begin{center} \fbox{\parbox[b][\height]{6in}{ {\bf Exercise \theecount : #1 } \par #2 }} \end{center}}
+\newcommand{\exercise}[2] { \refstepcounter{ecount}
+\begin{center} \fbox{\parbox[b][\height]{6in}{
+{\bf Exercise \theecount : #1 }
+\par #2 }} \end{center}
+% this doesn't work - page refs are off \addcontentsline{toc}{subsection}{ Exercise \theecount : #1 }
+}
\newcommand{\exstep}[1]{ \stepcounter{exstep} {\sl \theexstep.} \begin{minipage}[t]{5.5in} #1 \end{minipage} \par \vspace *{1mm} }
%%% Remove the % on the next 2 lines to hide tutorials.
%\renewcommand{\exercise}[2]{}
\maketitle
-\tableofcontents\r
+\tableofcontents
-\chapter{Basics}\r\section{Introduction}
+\chapter{Basics}
+\section{Introduction}
\subsection{Jalview}
-Jalview is a sequence multiple alignment viewer, editor and analysis tool. Jalview is designed to be platform independent (running on Mac, MS Windows, Linux and any other platform that supports Java), capable of editing and analysing large alignments (thousands of sequences) with minimal degradation in performance, and able to show multiple integrated views of the alignment and other data. Jalview can read and write many common sequence formats including FASTA, Clustal, MSF(GCG) and PIR.
-
-Jalview 2.2 provides improved access to databases and analyses via web services, allowing the retrieval and display of third party data such as features and structures in association with the sequences. Jalview is typically run as a stand alone application or as an applet embedded in a web page, allowing customised integration with alignment databases such as pFam\footnote{A demonstration version of Jalview (Jalview Micro Edition) also runs on a mobile phone but the functionality is limited to sequence colouring.}.
+Jalview is a sequence multiple alignment viewer, editor and analysis tool.
+Jalview is designed to be platform independent (running on Mac, MS Windows, Linux
+and any other platform that supports Java), capable of editing and analysing
+large alignments (thousands of sequences) with minimal degradation in
+performance, and able to show multiple integrated views of the alignment and
+other data. Jalview can read and write many common sequence formats including
+FASTA, Clustal, MSF(GCG) and PIR.
+
+
+There are two types of Jalview program. The Jalview Desktop is a stand alone
+application that provides powerful editing, visualization, annotation and
+analysis capabilities. The JalviewLite applet has the same core visualization,
+editing and analysis capabilities as the desktop, but is designed to be embedded
+in a web page, allowing customised integration with alignment databases such as
+pFam\footnote{A demonstration version of Jalview (Jalview Micro Edition) also
+runs on a mobile phone but the functionality is limited to sequence colouring.}.
+
+
+Jalview 2.4 was released in September 2008. The Jalview Desktop in this version
+provides access to sequence, alignment and protein structure databases, and
+alignment and analysis web services, and includes the Jmol\footnote{ Provided
+under the LGPL licence at http://www.jmol.org} protein structure viewer. It is
+also a Distributed Annotation System (DAS) client\footnote{with thanks to Andreas
+Prlic} which facilitates the retrieval and display of third party sequence
+annotation in association with sequences and any associated structure.
+
+\subsection{Jalview's Capabilities}
+% TODO add references to appropriate sections for each capability described here.
+Figure \ref{jvcapabilities} gives an overview of the main features of the Jalview desktop application. Its primary function is the editing and visualization of sequence alignments, and their interactive analysis. Tree building, principle components analysis, physico-chemical property conservation and sequence consensus analyses are built in to the program. Web services enable Jalview to access remote alignment and secondary structure prediction services, as well as to retrieve protein and nucleic acid sequences, alignments, protein structures and sequence annotation. Sequences, alignments, trees, structures, features and alignment annotation may also be exchanged with the local filesystem. Multiple visualizations of an alignment may be worked on simultaneously, and the user interface provides a comprehensive set of controls for colouring and layout. Alignment views are dynamically linked with Jmol structure displays, a tree viewer and spatial cluster display, facilitating interactive exploration of alignment structure. Finally, the application provides a Jalview project format enabling the current state of an alignment and analysis windows to be stored, and WYSIWIG style figure generation capabilities for use in publications.
+\begin{figure}[htbp]
+\begin{center}
+\includegraphics[width=5.5in]{images/jvcapabilities.pdf}
+\label{jvcapabilities}
+\end{center}
+\caption{{\bf Capabilities of the Jalview Desktop.} The Jalview Desktop Application provides a stable environment for the creation, editing and analysis of alignments and the generation of figures.}
+\end{figure}
\subsubsection{Jalview History}
-Jalview was initially developed in 1996 by Michele Clamp, James Cuff, Steve Searle and Geoff Barton at the University of Oxford and then the European Bioinformatics Institute. Development of Jalview slowed considerably before resuming with funding from the BBSRC\footnote{Biotechnology and Biological Sciences Research Council grant {\sl "VAMSAS: Visualisation and Analysis of Molecules, Sequence Alignments and Structures"}, a joint project to enable interoperability between Jalview, TOPALi and AstexViewer.} in 2004 with Andrew Waterhouse and Jim Procter bringing current developments in bioinformatics into Jalview 2 through the latest web and Java technology. Jalview continues to be one of the worlds most popular\footnote{and in the authors opinion, the best.} sequence alignment and analysis tools.
+Jalview was initially developed in 1996 by Michele Clamp, James Cuff, Steve
+Searle and Geoff Barton at the University of Oxford and then the European
+Bioinformatics Institute. Development of Jalview 2 was made possible with
+eScience funding from the BBSRC\footnote{Biotechnology and Biological Sciences
+Research Council grant {\sl "VAMSAS: Visualisation and Analysis of Molecules,
+Sequence Alignments and Structures"}, a joint project to enable interoperability
+between Jalview, TOPALi and AstexViewer.} in 2004, enabling Andrew Waterhouse and
+Jim Procter to re-engineer the original program to introduce current developments
+in bioinformatics and take advantage of the latest web and Java technology. The
+2.4 version released in September 2008 introduces experimental support for a data
+exchange framework developed as part of this project, to enable Jalview to be
+used in conjunction with other programs for the analysis of sequences, alignments
+and structures. Jalview continues to be one of the worlds most
+popular\footnote{and in the authors opinion, the best.} sequence alignment and
+analysis tools.
+
\subsubsection{Citing Jalview}
-If you use Jalview in your work you should cite {\sl "The Jalview Java alignment editor"} Michele Clamp, James Cuff, Stephen M. Searle and Geoffrey J. Barton (2004) {\sl Bioinformatics} {\bf 20} 426-427.
+If you use Jalview in your work you should cite {\sl "The Jalview Java alignment
+editor"} Michele Clamp, James Cuff, Stephen M. Searle and Geoffrey J. Barton
+(2004) {\sl Bioinformatics} {\bf 20} 426-427.
\r\subsection{About this tutorial }
-This tutorial is written in a manual format with short exercises where appropriate, typically at the end of each section. The first chapter concerns the basic operation of Jalview and should be sufficient for those who just want to open an alignment, perform basic editing and colouring, and produce publication and presentation quality graphical output.
+This tutorial is written in a manual format with short exercises where
+appropriate, typically at the end of each section. The first chapter concerns the
+basic operation of Jalview and should be sufficient for those who just want to
+open an alignment, perform basic editing and colouring, and produce publication
+and presentation quality graphical output.
+
+The second chapter covers analysis in Jalview, sequence alignment and
+visualisation of external features and structural data.
+
+The third chapter covers the detail of Jalview and is aimed at the user who is
+already familiar with Jalview operation but wants to get more out of their
+Jalview experience.
-The second chapter covers analysis in Jalview, sequence alignment and visualisation of external features and structural data.
+\subsubsection{Typographic Conventions}
-The third chapter covers the detail of Jalview and is aimed at the user who is already familiar with Jalview operation but wants to get more out of their Jalview experience.
-\r\section{Obtaining and starting Jalview}\r
+Keystrokes using the special non-symbol keys are represented in the tutorial by enclosing the pressed keys with square brackets ({\em e.g.} [RETURN] or [CTRL]). Keystroke combinations are combined with a '-' symbol ({\em e.g.} [CTRL]-C means press [CTRL] and the 'C' key). Menu options are given as a path from the menu that contains them - for example {\sl File $\Rightarrow$ Input Alignment $\Rightarrow$ From URL} means to select the 'From URL' option from the 'Input Alignment' submenu of a window's 'File' dropdown menu.
+\r\section{Obtaining and starting The Jalview Desktop Application}
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=4.5in]{images/download.pdf}
\label{download}
\end{center}
\end{figure}
-\r Jalview can be run in three ways; as an application from the web via Java Web Start, as an application loaded onto your hard drive, or as an applet embedded in a web page. This tutorial is only concerned with running the application via Web Start, though much of the information will be useful whichever way you run Jalview.\r\rThe Jalview web site is http://www.jalview.org/ and Jalview can be launched by navigating to the Download page (via the menu on the left hand side) and clicking the 'Start with Java Webstart' button. (figure \ref{download}). This will always launch the latest public release of Jalview.\r
-\rThe application will start automatically though you may be prompted to accept a security certificate signed by the Barton Group. You can trust us so click trust or accept as appropriate. The splash screen (figure \ref{splash}) gives information about the latest version and the paper to cite in your publications. This information is also available on the Jalview web site and from the {\sl Help $\Rightarrow$ About} menu option.\r \r%[fig 2]
+
+This tutorial is based on the application version of Jalview, the Jalview
+Desktop. Much of the information will also be useful for users of the JalviewLite
+applet. This version of Jalview 2 is designed to be launched from web pages, but
+has the same core editing, analysis and visualization capabilities (see the
+\href{http://www.jalview.org/examples/applets.html}{JalviewLite Applet Examples}
+page for examples). The Jalview Desktop, however, is much more powerful, and
+includes additional support for interaction with external web services, and
+production of publication quality graphics.
+
+The Jalview Desktop can be run in two ways; as an application launched from the
+web via Java Web Start, or as an application loaded onto your hard drive. Both
+versions are obtained from the Download page at the the Jalview web site
+(http://www.jalview.org/).
+
+Jalview can be started directly with webstart by navigating to the Download page
+(via the menu on the left hand side), and clicking the 'Start with Java Webstart'
+button. (figure \ref{download}). This will always launch the latest stable
+release of Jalview.\par
+
+The application will start automatically though you may be prompted to accept a
+security certificate signed by the Barton Group. You can trust us so click trust
+or accept as appropriate. The splash screen (figure \ref{splash}) gives
+information about the latest version and the paper to cite in your publications.
+This information is also available on the Jalview web site and from the {\sl Help
+$\Rightarrow$ About} menu option.
+
+%[fig 2]
\begin{figure}[htbp]
+
\begin{center}
\includegraphics[width=4.5in]{images/splash.pdf}
\caption{{\bf Jalview splash screen}}
\label{splash}
\end{center}
\end{figure}
+\rWhen Jalview starts it will automatically load an example alignment from the
+Jalview site. Later in the tutorial we will discover how to alter this behaviour.
+This alignment looks like figure \ref{startpage}.
-
-\rWhen Jalview starts it will automatically load an example alignment from the Jalview site. Later in the tutorial we will discover how to alter this behaviour. This alignment looks like figure \ref{startpage}. \r%[figure 3 ]\r
+%[figure 3 ]
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=4in]{images/start.pdf}
\exercise{Starting Jalview}{
\label{start}
-\exstep{Point your web browser at the Jalview web site and start Jalview by clicking on the 'Start with Java WebStart' button.} }
+\exstep{Point your web browser at the \href{http://www.jalview.org}{Jalview web site} and start Jalview by clicking on the 'Start with Java WebStart' button.} }
\subsection{Getting Help}
\begin{figure}[htbp]
\begin{center}
-\parbox[c]{2in}{\centerline{\includegraphics[width=1.75in]{images/help1.pdf}}}
+\parbox[c]{2in}{\centerline{\includegraphics[width=2.75in]{images/help1.pdf}}}
\parbox[c]{4in}{\includegraphics[width=4in]{images/help2.pdf}}
\caption{{\bf Accessing the built in Jalview documentation}}
\label{help}
\subsubsection{Email lists}
-The Jalview developers can be contacted with news of bugs, feature requests and so on via the email address {\tt help@jalview.org}. A mailing list for information related to Jalview announcements and new releases can also be found on the Jalview web site.
+The Jalview Discussion list {\tt jalview-discuss@jalview.org} provides a forum for Jalview users and developers to raise problems and exchange ideas. The Jalview developers may also be contacted directly in the case of specific bugs, feature requests and so on via the email address {\tt help@jalview.org}. Finally, the {\tt jalview-announce@jalview.org} list can be subscribed to if you wish to be kept informed of new releases and developments. Archives and mailing list subscription details can be found on the Jalview web site.
\r\section{Navigation}
-The major features of the Jalview application are illustrated in Figure \ref{anatomy}. Each area of the alignment window has a separate context menu accessed by clicking the right mouse button.
+The major features of the Jalview Desktop are illustrated in Figure \ref{anatomy}. The alignment window is the primary window for editing and visualization, and can contain several independent views of the alignment being worked with. The other windows (Trees, Structures, PCA plots, etc) are linked to a specific alignment view. Each area of the alignment window has a separate context menu accessed by clicking the right mouse button.
Jalview has two navigation and editing modes: normal mode, where editing and navigation is performed using the mouse, and cursor mode where editing and navigation are performed using the keyboard. The F2 key is used to switch between these two modes.
\begin{figure}[htb]
\begin{center}
\includegraphics[width=6.5in]{images/jalview_anatomy.pdf}
-\caption{{\bf The anatomy of Jalview.} The major features of the Jalview application are labelled.}
+\caption{{\bf The anatomy of Jalview.} The major features of the Jalview Desktop Application are labelled.}
+% TODO: modify text labels to be clearer - black on grey and black border for clarity
\label{anatomy}
\end{center}
\end{figure}
\subsection{Navigation in Normal mode}
-\rJalview always starts up in Normal mode. With anything more than a few residues or sequences, alignments become difficult to visualise on the screen. Jalview shows a window on the alignment, limited by the size of the window and the font used to render it. You can move about the alignment by clicking and dragging the ruler scroll bar to move horizontally, or by clicking and dragging the alignment scroll bar to the right of the alignment to move vertically. If all the rows or columns in the alignment are displayed, the scroll bars will not be visible.\r\rIt can help, especially when examining a large alignment, to have an overview of the whole alignment. Select {\sl View $\Rightarrow$ Overview Window} from the window menu (Figure \ref{overview}).\r%(figure 4)
+\rJalview always starts up in Normal mode, where the mouse is used to interact with the displayed alignment view. You can move about the alignment by clicking and dragging the ruler scroll bar to move horizontally, or by clicking and dragging the alignment scroll bar to the right of the alignment to move vertically. If all the rows or columns in the alignment are displayed, the scroll bars will not be visible.\r\r Each alignment view shown in the alignment window presents a window onto the visible regions of the alignment. This means that with anything more than a few residues or sequences, alignments can become difficult to visualise on the screen because only a small area can be shown at a time. It can help, especially when examining a large alignment, to have an overview of the whole alignment. Select {\sl View $\Rightarrow$ Overview Window} from the window menu (Figure \ref{overview}).\r%(figure 4)
\begin{figure}[htbp]
\begin{center}
-\includegraphics[width=1.5in]{images/overviewmenu.pdf}
\includegraphics[width=4.5in]{images/overview.pdf}
\caption{{\bf Alignment Overview Window}}
\label{overview}
\end{center}
\end{figure}
-\rThe red box in the overview window shows the current view in the alignment window. You can navigate around the alignment by dragging the red box. %Try this now and see how the view in the alignment window changes.\r\r\parbox[c]{3in}{We can close these windows by clicking on the icons indicated by arrows, or by selecting {\sl Window $\Rightarrow$ Close All} from the main menu. }
+\rThe red box in the overview window shows the current view in the alignment window. A percent identity histogram is plotted below the alignment overview. Shaded parts indicate rows and columns of the alignment that are hidden (in this case, a single row at the bottom of the alignment). You can navigate around the alignment by dragging the red box. %Try this now and see how the view in the alignment window changes.\r\r\parbox[c]{3in}{Alignment and analysis windows are closed by clicking on the usual 'close' icon (indicated by arrows on Mac OS X). If you want to close all the alignments and analysis windows at once, then use the {\sl Window $\Rightarrow$ Close All} option from the Jalview desktop (\em{warning: make sure you have saved your work because this cannot be undone !}). }
\parbox[c]{3in}{\centerline{\includegraphics[width=2.5in]{images/start_closeall.pdf}
}}
-\r
+
\subsection{Navigation in Cursor mode}
-\parbox[c]{5in}{Cursor mode provides a fast means for an experienced use to navigate to the part of the alignment in which they are interested. On pressing F2 to enter cursor mode the position of the cursor is indicated by a black background and white text. The cursor can be placed using the mouse or moved by pressing the arrow keys ($\uparrow$, $\downarrow$, $\leftarrow$, $\rightarrow$).
+\parbox[c]{5in}{Cursor mode navigation enables the experienced user to quickly and precisely navigate, select and edit parts of an alignment. On pressing F2 to enter cursor mode the position of the cursor is indicated by a black background and white text. The cursor can be placed using the mouse or moved by pressing the arrow keys ($\uparrow$, $\downarrow$, $\leftarrow$, $\rightarrow$).
}\parbox[c]{1.25in}{\centerline{\includegraphics[width=0.8in]{images/cursor1.pdf}}}
Rapid movement to specific positions is accomplished as listed below:
Move to sequence 7 by pressing {\sl 7 S}. Move to column 18 by pressing {\sl 1 8 C}. Move to residue 18 by pressing {\sl 1 8 P}. Note that these can be two different positions if gaps are inserted into the sequence. Move to sequence 5, column 13 by typing {\sl 1 3 , 5 [RETURN]}.
}
}
-\r\section{Loading your own sequences}\r\rJalview provides many ways to load your own sequences. %For this section of the tutorial you will need to download the file http://www.jalview.org/tutorial/alignment.fa to a suitable location on your hard drive.\r\r\subsection{Drag and Drop}\r In some operating systems (Mac OS X, Windows XP) you can just drag a file icon from a file browser window and drop it on an open Jalview application window (Figure \ref{drag}). The file will then be opened as a new alignment window. %You can try this with the tutorial file you have downloaded. When you have opened the file, close it again by selecting the close control on the window.\rIf you drop an alignment file onto an open alignment window it will be appended to that alignment.\r%[fig 5]\r\begin{figure}[htbp]
-\begin{center}
-\includegraphics[width=2in]{images/drag2.pdf}
-\includegraphics[width=2in]{images/drag3.pdf}
-\caption{{\bf An alignment can be opened by dragging the file onto the Jalview window. }}
-\label{drag}
-\end{center}
-\end{figure}
-
-%\includegraphics[width=2in]{images/drag1.pdf}
+\r\section{Loading your own sequences}\r\rJalview provides many ways to load your own sequences. %For this section of the tutorial you will need to download the file http://www.jalview.org/tutorial/alignment.fa to a suitable location on your hard drive.\r\r\subsection{Drag and Drop}\r In some operating systems (Mac OS X, Windows XP) you can just drag a file icon from a file browser window and drop it on an open Jalview application window. The file will then be opened as a new alignment window. %You can try this with the tutorial file you have downloaded. When you have opened the file, close it again by selecting the close control on the window.\rIf you drop an alignment file onto an open alignment window it will be appended to that alignment.\r% (Figure \ref{drag})
+% %[fig 5]\r% \begin{figure}[htbp]\r% \begin{center}\r% \includegraphics[width=2in]{images/drag2.pdf}\r% \includegraphics[width=2in]{images/drag3.pdf}\r% \caption{{\bf An alignment can be opened by dragging the file onto the Jalview window. }}\r% \label{drag}\r% \end{center}\r% \end{figure}\r% \r% %\includegraphics[width=2in]{images/drag1.pdf}
\r\subsection{From a File}\r Jalview can read sequence alignments from a sequence alignment file. This is a text file, not a word processor document. For entering sequences from a wordprocessor document see Cut and Paste (section \ref{cutpaste}) below. Select {\sl File $\Rightarrow$ Input Alignment $\Rightarrow$ From File} from the main menu (Figure \ref{loadfile}). You will then get a file selection window where you can choose the file to open. Remember to select the appropriate file type. Jalview can automatically identify some sequence file formats.\r\r%[fig 6]\r\begin{figure}[htbp]
\begin{center}
\label{loadfile}
\end{center}
\end{figure}
-\r\subsection{From a URL}\r Jalview can read sequence alignments directly from a URL. Please note that the files must be in a sequence alignment format - a pretty HTML alignment or graphics file cannot be read by Jalview. \rSelect {\sl File $\Rightarrow$ Input Alignment $\Rightarrow$ From URL} from the main menu and a window will appear asking you to enter the URL (figure \ref{loadurl}). Jalview will attempt to automatically discover the file format.\r\r%[fig 7]
+\r\subsection{From a URL}\r Jalview can read sequence alignments directly from a URL. Please note that the files must be in a sequence alignment format - a pretty HTML alignment or graphics file cannot be read by Jalview. \rSelect {\sl File $\Rightarrow$ Input Alignment $\Rightarrow$ From URL} from the main menu and a window will appear asking you to enter the URL (figure \ref{loadurl}). Jalview will attempt to automatically discover the file format.\r\r%[fig 7]
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=2in]{images/menuloadurl.pdf}
\end{figure}
\r\subsection{Cut and Paste}
\label{cutpaste}\rDocuments such as those produced by Microsoft Word cannot be readily understood by Jalview. The way to read sequences from these documents is to select the data from the document and copy it to the clipboard. Select {\sl File $\Rightarrow$ Input Alignment $\Rightarrow$ From Textbox} from the main menu and a textbox window will appear (Figure \ref{loadtext}). Paste the sequences you have copied to the clipboard and, presuming that they are in the right format, Jalview will happily read them.\r%[fig 8]
-\r
+
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=2in]{images/menuloadtext.pdf}
\end{center}
\end{figure}
-\r\subsection{From a public database}\rJalview can retrieve sequences and sequence alignments from public databases such as Uniprot, Pfam and the PDB. This facility avoids having to manually locate, save and load the sequences.\rSelect {\sl File $\Rightarrow$ Fetch Sequence(s) \ldots} from the main menu and a window will appear (Figure \ref{loadseq}). Select the appropriate database, enter a sequence ID/accession number, or several separated by a semicolon and Jalview will retrieve it/them from the public databases housed at the European Bioinformatics Institute.\r\r%[fig 9]\r\begin{figure}[htbp]
+\r\subsection{From a public database}
+\label{fetchseq}\rJalview can retrieve sequences and sequence alignments from the public databases housed at the European Bioinformatics Institute, such as Uniprot, Pfam and the PDB, as well as any DAS sequence server registered at the configured DAS registry. This facility avoids having to manually locate, save and load the sequences, and allows Jalview to gather additional metadata provided by the source, such as annotation and database cross references.
+Select {\sl File $\Rightarrow$ Fetch Sequence(s) \ldots} from the main menu and a window will appear (Figure \ref{loadseq}). Use the menu box to select the appropriate database, enter a sequence ID/accession number, or several separated by a semicolon and Jalview will attempt to retrieve it/them from the chosen database source. Example queries are provided to test that a source is operational, but can also be used as a guide on the type of accession numbers understood by the source.\r%[fig 9]\r\begin{figure}[htbp]
\begin{center}
-\includegraphics[width=3in]{images/fetchseq.pdf}
+\includegraphics[width=2.5in]{images/fetchseq.pdf}
\caption{{\bf Retrieving sequences from a public database}}
\label{loadseq}
\end{center}
Drag the alignment.fa file from the desktop onto the Jalview window. The alignment should open. Try dragging onto an empty Jalview and onto an existing alignment and observe the results.
}
\exstep{
-Select {\sl File $\Rightarrow$ Fetch Sequence(s)\ldots } from the main menu. Select the {sl PFAM} database and enter the accession number PF03460. Click OK. An alignment of about 107 sequences should load.
+Select {\sl File $\Rightarrow$ Fetch Sequence(s).. } from the main menu. Select the {\sl PFAM (seed)} database and enter the accession number PF03460. Click OK. An alignment of about 107 sequences should load.
}
-\exstep{Open the URL \textsf{http://www.jalview.org/tutorial/alignment.fa} in a web browser. Select and copy the entire text to the clipboard (usually via the browser's {\sl Edit $\Rightarrow$ Copy} menu option). Ensure Jalview is running and select {\sl File $\Rightarrow$ Input Alignment $\Rightarrow$ From Textbox} . Paste the clipboard into the large window using the {\sl Edit $\Rightarrow$ Paste} text box menu option. Click {\sl Close} and the alignment will be loaded.
+\exstep{Open the URL \textsf{http://www.jalview.org/tutorial/alignment.fa} in a web browser. Select and copy the entire text to the clipboard (usually via the browser's {\sl Edit $\Rightarrow$ Copy} menu option). Ensure Jalview is running and select {\sl File $\Rightarrow$ Input Alignment $\Rightarrow$ From Textbox} . Paste the clipboard into the large window using the {\sl Edit $\Rightarrow$ Paste} text box menu option. Click {\sl Close} and the alignment will be loaded.
}
-}\r\section{Writing sequence alignments}\r\subsection{Saving the alignment}\rJalview allows the current sequence alignments to be saved to file so they can be restored at a later date, passed to colleagues or analysed in other programs. From the alignment window menu select {\sl File $\Rightarrow$ Save As} and a dialog box will appear (Figure \ref{savealign}). You can navigate to an appropriate directory in which to save the alignment. Jalview offers several different formats in which an alignment can be saved. The jalview format is the only one which will preserve the colours, groupings and similar information in the alignment. The other formats produce text files containing just the sequences with no visualisation information. Unfortunately only Jalview can read Jalview files. Using the {\sl File $\Rightarrow$ Output To Textbox} menu option allows the alignment to be copied and pasted into other documents or web servers.
-\r%[fig 10]\r
+}\r\section{Writing sequence alignments}\r\subsection{Saving the alignment}\rJalview allows the current sequence alignments to be saved to file so they can be restored at a later date, passed to colleagues or analysed in other programs. From the alignment window menu select {\sl File $\Rightarrow$ Save As} and a dialog box will appear (Figure \ref{savealign}). You can navigate to an appropriate directory in which to save the alignment. Jalview will remember the last filename and format used to save (or load) the alignment, enabling you to quickly update the file after editing by using the {\sl File $\Rightarrow$ Save} entry.
+
+Jalview offers several different formats in which an alignment can be saved. The jalview format is the only one which will preserve the colours, groupings and similar information in the alignment. The other formats produce text files containing just the sequences with no visualisation information, although some allow limited annotation and sequence features to be stored (e.g. AMSA). Unfortunately only Jalview can read Jalview files. The {\sl File $\Rightarrow$ Output To Textbox} menu option allows the alignment to be copied and pasted into other documents or web servers.
+\r%[fig 10]
\begin{figure}[htbp]
\begin{center}
-\includegraphics[width=1.75in]{images/saveas.pdf}
-\includegraphics[width=3.5in]{images/saveas2.pdf}
+\parbox[c]{1.0in}{
+\includegraphics[width=1.0in]{images/saveas.pdf}
+}
+\parbox[c]{4in}{
+\includegraphics[width=4in]{images/saveas2.pdf}
+}
\caption{{\bf Saving alignments in Jalview to disk}}
\label{savealign}
\end{center}
\end{figure}
-\subsection{Jalview Projects}\r\parbox[c]{4in}{If you wish to save the complete Jalview session rather than just one alignment (e.g. because you have calculated trees or multiple different alignments) then your work should be saved as a Jalview Project file. From the main menu select {\sl File $\Rightarrow$ Save Project} and a file save dialog box will appear. Loading a project will restore Jalview to exactly the view at which the file was saved, complete with all alignments, trees etc. rendered appropriately.}
+\subsection{Jalview Projects}\r\parbox[c]{4in}{If you wish to save the complete Jalview session rather than just one alignment (e.g. because you have calculated trees or multiple different alignments) then your work should be saved as a Jalview Project file. From the main menu select {\sl File $\Rightarrow$ Save Project} and a file save dialog box will appear. Loading a project will restore Jalview to exactly the view at which the file was saved, complete with all alignments, trees, annotation and displayed structures rendered appropriately.}
\parbox[c]{2in}{
\centerline {
\includegraphics[width=1.5in]{images/saveproj.pdf}
\r\subsection{Selecting parts of an alignment}
Selections can be of arbitrary regions in an alignment, one or more complete columns, or one or more complete sequences.
-A selected region can be copied and pasted as a new alignment using the {\sl Edit $\Rightarrow$ Copy} and {\sl Edit $\Rightarrow$ Paste $\Rightarrow$ As New Alignment} alignment window menu options.\r
+A selected region can be copied and pasted as a new alignment using the {\sl Edit $\Rightarrow$ Copy} and {\sl Edit $\Rightarrow$ Paste $\Rightarrow$ As New Alignment} alignment window menu options.
To clear (unselect) the selection press the [ESC] (escape) key.
\label{selectrows}
\end{center}
\end{figure}
-\rTo select multiple complete sequences, click and drag the mouse along the sequence ID panel. Multiple sequences will be selected. The same technique as used for columns above can be used with SHIFT-Click and CTRL-Click to select discontinuous ranges of sequences (Figure \ref{selectrows}).\r%[fig 14]
-
-
-
+\rTo select multiple complete sequences, click and drag the mouse along the sequence ID panel. Multiple sequences will be selected. The same technique as used for columns above can be used with SHIFT-Click and CTRL-Click to select discontinuous ranges of sequences (Figure \ref{selectrows}).\r%[fig 14]
\subsubsection{Making selections in Cursor mode}
Navigate to the bottom right corner of the proposed selection and press the [M] key. This marks the bottom right corner of the selection. The selection can then be treated in the same way as if it had been created in normal mode.
-
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=1.5in]{images/csel1.pdf}
\includegraphics[width=1.5in]{images/csel2.pdf}
\includegraphics[width=1.5in]{images/csel3.pdf}
\includegraphics[width=1.5in]{images/csel4.pdf}
-\caption{{\bf Making a selection in cursor mode.}Navigate to the top left corner (left), press [Q] (left center), navigate to the bottom right corner (right center) and press [M] (right)}
+\caption{{\bf Making a selection in cursor mode.} Navigate to the top left corner (left), press [Q] (left center), navigate to the bottom right corner (right center) and press [M] (right)}
\label{cselect}
\end{center}
\end{figure}
+
+\subsubsection{Inverting the current selection}
+
+The current sequence or column selection can be inverted, using {\tr Select $\Rightarrow$ Invert {\bf Sequence/Column} Selection} in the Alignment window. Inverting the selection is particularly useful when hiding regions in a large alignment (see section \ref{hidecol} below). Instead of selecting the columns and rows that are to be hidden, simply select the region that is to be kept visible, and then invert the selection.
\r\r\subsection{Creating groups}\rSelections are lost as soon as a different region is selected. Groups can be created which are labeled regions of the alignment. To create a group, first select the region which is to comprise the group. Then click the right mouse button on the selection to bring up a context menu. Select {\sl Selection $\Rightarrow$ Group $\Rightarrow$ Group} then enter a name for the group in the dialogue box which appears.
\begin{figure}[htbp]
\end{center}
\end{figure}
-By default the selection will have a box drawn around it. The appearance of the group can be changed (see section \ref{colours} below). This group will stay defined even when the selection is removed.\r
+By default the new group will have a box drawn around it. The appearance of the group can be changed (see section \ref{colours} below). This group will stay defined even when the selection is removed.
+
+\subsection{Exporting the current selection}
+
+The current selection can be copied to the system clipboard (in PFAM format). It can also be output to a textbox using the output functions in the pop-up menu obtained by right clicking the current selection. The textbox enables quick manual editing of the alignment prior to importing it into a new window (using the [New Window] button) or saving to a file with the {\sl File $\Rightarrow$ Save As } pulldown menu option from the text box.
+
\exercise{Making selections and groups}{
\label{exselect}
\exstep{ Repeat the step above but selecting columns by clicking on the ruler bar instead of selecting rows by clicking on the sequence ID.
}
\exstep{Press [F2] to enter Cursor mode. Navigate to column 59, row 1 by pressing {\sl 5 9 , 1 [RETURN]}. Press {\sl Q} to mark this position. Now navigate to column 65, row 8 by pressing {\sl 6 5 , 8 [RETURN]}. Press {\sl M} to complete the selection.}
+\exstep{
+\label{exselectgrpcolour}
+Open the popup menu by right-clicking the selected region with the mouse. Open the {\sl Selection $\Rightarrow$ Group $\Rightarrow$ Group Colour } menu and select 'Percentage Identity'. This will turn the selected region into a group. }
+\exstep{Hold down [CTRL] and use the mouse to select and deselect sequences by clicking on their Sequence ID label. Note how the group expands to include newly selected sequences, and the 'Percentage Identity' colouring changes. }
+\exstep{
+Use the mouse to click and drag the right-hand edge of the selected group. Note again how the group resizes.}
+\exstep{
+Right click on the text area to open the selection popup-menu. Follow the menus an pick an output format from the {\sl Selection $\Rightarrow$ Output to Textbox \ldots} submenu.
}
+\exstep{Try manually editing the alignment and then press the [New Window] button to import the file into a new alignment window.}
+% more? change colouring style. set border colour.
+}
\r\subsection{Reordering the alignment}\rSequence reordering is simple. Highlight the sequences to move then press the up or down arrow keys as appropriate (Figure \ref{reorder}). If you wish to move a sequence up past several other sequences it is often quicker to select the group past which you want to move it and then move the group rather than the individual sequence.\r\r\begin{figure}[htbp]
\begin{center}
\includegraphics[width=3in]{images/move1.pdf}
\end{figure}
\exercise{Reordering the alignment}{
-\exstep{Open an alignment (e.g.the PFAM domain PF03460). Select one sequence. Using the up and down arrow keys, alter it's position in the alignment.
+\exstep{Open an alignment (e.g.the PFAM domain PF03460). Select one sequence. Using the up and down arrow keys, alter its position in the alignment.
+}
+\exstep{Hold [CTRL] and select two sequences separated by one or more un-selected sequences. Note how multiple sequences are grouped together when they are re-ordered using the up and down arrow keys.
+}
+}
+
+
+\subsection{Hiding regions}
+
+It is sometimes convenient to exclude some sequences or residues in the alignment without actually deleting them. Jalview allows sequences or alignment columns within a view to be hidden, and this facility has been used to create several different views of the example alignment in the file that is loaded when Jalview is first started (See Figure \ref{startpage}).
+
+To hide a set of sequences, select them and right-click the mouse on the selected sequence IDs to bring up the context menu. Select {\sl Hide Sequences} and the sequences will be concealed, with a small triangle indicating their position (Figure \ref{hideseq}). To unhide (reveal) the sequences, right click on the triangle and select {\sl Reveal Sequences} from the context menu.
+
+
+ \begin{figure}[htbp]
+\begin{center}
+\includegraphics[width=1.5in]{images/hide1.pdf}
+\includegraphics[width=2.5in]{images/hide2.pdf}
+\includegraphics[width=1.75in]{images/hide3.pdf}
+\caption{{\bf Hiding Sequences} Hidden sequences are represented by a blue triangle in the sequence ID panel}
+\label{hideseq}
+\end{center}
+\end{figure}
+
+
+
+A similar mechanism applies to columns (Figure \ref{hidecol}). Selected columns (indicated by a red marker) can be hidden and revealed in the same way via the context menu (right click) on the ruler bar. The hidden selection is indicated by a blue triangle in the ruler bar.
+
+ \begin{figure}[htbp]
+\begin{center}
+\includegraphics[width=2in]{images/hide4.pdf}
+\includegraphics[width=3in]{images/hide5.pdf}
+\includegraphics[width=1in]{images/hide6.pdf}
+\caption{{\bf Hiding Columns} Hidden columns are represented by a blue triangle in the ruler bar}
+\label{hidecol}
+\end{center}
+\end{figure}
+
+\subsubsection{Representing a group with a single sequence}
+
+Instead of hiding a group completely, it is sometimes useful to work with just one representative sequence. The {\sl <Sequence ID> $\Rightarrow$ Represent group with <Sequence ID> } option from the sequence ID pop-up menu enables this variant of the hidden groups function. The remaining representative sequence can be visualized and manipulated like any other. However, any alignment edits that affect the sequence will also affect the whole sequence group.
+
+\exercise{Hiding and revealing regions}{
+\exstep{Close all windows then open the PFAM accession PF03460. Select a contiguous set of sequences by clicking and dragging on the sequence ID panel. Right click on the selected sequence IDs and select {\sl Hide Sequences}.
+}
+\exstep{
+Right click on the blue triangle indicating hidden sequences and select {\sl Reveal Sequences}. (If you have hidden all sequences then you will need to use the alignment window menu option {\sl View $\Rightarrow$ Show $\Rightarrow$ All Sequences.})
+}
+\exstep{
+Repeat but using a non-contiguous set of sequences. Note that when multiple regions are hidden there are two options, {\sl Reveal Sequences} and {\sl Reveal All}.
+}
+\exstep{Repeat the above but hiding and revealing columns instead of sequences.
}
+\exstep{Select some sequences and pick one to represent the rest. Bring up the sequence ID pop-up menu for that sequence and select the {\sl Represent group with <Sequence ID> } option. Use the pop-up menu again to reveal the hidden sequences that you just picked a representative for.}
}
+
+
+
\subsection{Introducing and removing gaps}
Jalview provides interactive editing, allowing sequences to be dragged to create gaps.
\subsubsection{Introducing gaps in all sequences of a group}
-To insert gaps in all sequences in a selection or group, place the mouse cursor on any residue in the selection or group to the immediate right of the position in which a gap should appear. Hold down the CTRL key and the left mouse button, then drag the sequences to the right until the required number of gaps has appeared.
+To insert gaps in all sequences in a selection or group, place the mouse cursor on any residue in the selection or group to the immediate right of the position in which a gap should appear. Hold down the CTRL key and the left mouse button, then drag the sequences to the right until the required number of gaps has appeared.
\begin{figure}[htb]
\begin{center}
\end{figure}
Gaps can be removed by dragging the residue to the immediate right of the gap leftwards whilst holding down [SHIFT] (for single sequences) or [CTRL] (for a group of sequences).
+\subsubsection{Sliding Sequences}
-\subsubsection{Editing in Cursor mode}
-
-Gaps can be inserted in cursor mode by pressing [SPACE]. Gaps will be inserted at the cursor, pushing the residue under the cursor to the right. To insert {\sl n} gaps type {\sl n} and then press [SPACE]. To insert gaps into all sequences of a group, use [CTRL]-[SPACE] or [SHIFT]-[SPACE] (both keys held down together).
+Pressing the [$\Leftarrow$] or [$\Rightarrow$] when one or more sequences are selected will ``slide'' the selected sequences to the left or right (respectively).
-Gaps can be removed in cursor mode by pressing [BACKSPACE]. The gap under the cursor will be removed. To remove {\sl n} gaps, type {\sl n} and then press [BACKSPACE]. Gaps will be deleted up to the number specified. To delete gaps from all sequences of a group, use [CTRL]-[BACKSPACE] or [SHIFT]-[BACKSPACE] (both keys held down together).
+\subsubsection{Locked Editing}
+\label{lockededits}
+Normally, when a gap is inserted or removed in the alignment, the whole row is affected. However, if the edit is performed within a selected region, gaps will only be removed or inserted within the selected region. Edits are similarly constrained when they occur adjacent to a hidden column.
-
\subsubsection{Undoing edits}
Jalview supports the undoing of edits via the {\sl Edit $\Rightarrow$ Undo Edit} alignment window menu option. Each editing action is stored and can be reversed in sequence. Colouring of the alignment is not reversible via the {\sl Undo} option.
+% % better idea to introduce hiding sequences, and use the invert selection, hide
+% others, to simplify manual alignment construction
\exercise{Editing alignments}{
-\exstep{
-Load the URL \textsf{http://www.jalview.org/tutorial/unaligned.fa} which contains part of the ferrodoxin alignment from PF03460. Select the lower 5 sequences.
-}
-\exstep{
-Place the mouse cursor over the selection at column 24. ({\tt RVG{\bf G}QAK} in O23813\_ MAIZE). Hold down [CTRL], press down the mouse button and drag the sequences two spaces to the right until the G is aligned with the G in the row above. Release the mouse button and the [CTRL] key.
-}
-\exstep{ Repeat for the next residue Q until it aligns with the Q in the row above.
-}
-\exstep{
-Try editing a single sequence. Hold down [SHIFT] and drag the sequence to the right. Just the clicked on sequence should move.
-}
-\exstep{
-Delete the gaps created in the previous step by [SHIFT]-Clicking on the residue and dragging it to the left.
-}
-\exstep{
-Use the {\sl Edit $\Rightarrow$ Undo Edit} menu option to step backwards through the edits you have made.
-}
+\label{mousealedit}
+\exstep{ Load the URL
+\textsf{http://www.jalview.org/tutorial/unaligned.fa} which contains part of the
+ferrodoxin alignment from PF03460.
+
+ You are going to manually reconstruct the alignment that jalview loads by
+ default. Remember to use [CTRL]+Z to undo an edit, or the {\tr File $\LeftArrow$
+ Reload } function to revert the alignment back to the original version if you
+ want to start again.
+ }
+
+\exstep{ Select the first 7 sequences, and press H to hide them (or right click
+on the sequence IDs to open the sequence ID popup menu, and select {\tr Hide
+Sequences}). }
+
+\exstep{ Select FER3\_RAPSA and FER\_BRANA. Slide the sequences to
+the left so the initial {\bf A} lies at column 57 using the $\Rightarrow$ key.}
+
+\exstep{ Select FER1\_SPIOL, FER1\_ARATH, FER2\_ARATH, Q93Z60\_ARATH and
+O80429\_MAIZE (Hint: press [CTRL]-I to invert the sequence selection and then
+deleset FER1\_MAIZE), and use the $\Rightarrow$ key to slide them to so they
+begin at column 5 of the alignment view.}
+
+\exstep{ Select all the visible
+sequences in the block by pressing [CTRL]-A. Insert a single gap in all selected
+sequences at column 38 by holding [CTRL] and clicking on the R in FER1\_SPIOL and
+dragging one column to right. Insert another gap at column 47 in all sequences in
+the same way.}
+
+\exstep{ Correct the feredoxin domain alignment for FER1\_SPIOL by
+insert two additional gaps after the gap at column 47: hold [SHIFT] and click and
+drag on the G and move it two columns to the right.}
+
+\exstep{ Now complete the
+alignment of FER1\_SPIOL with a {\bf locked edit} by pressing [ESC] and select
+columns 47 to 57 of the FER1\_SPIOL row. Move the mouse onto the G at column 50,
+hold [SHIFT] and drag the G to the left by one column to insert a gap at column
+57.}
+
+\exstep{ In the next two steps you will complete the alignment of the last two sequences.
+
+Select the last two sequences (FER1\_MAIZE and O80429\_MAIZE), then press [SHIFT]
+and click and drag the initial methionine of O80429\_MAIZE 5 columns to the right
+so it lies at column 10. Keep holding [SHIFT] and click and drag to insert
+another gap at the proline at column 25 (16P). Remove the gap at
+column 44, and insert 4 gaps at column 47 (after AAPM).}
+
+\exstep{ Hold [SHIFT] and drag the I at column 39 of FER1\_MAIZE 2 columns to the
+right. Remove the gap at FER1\_MAIZE column 49 by [SHIFT]+click and drag left by
+one column. Insert three gaps in FER1\_MAIZE at column 47 by holding [SHIFT] and
+click and drag the S in FER1\_MAIZE to the right by three columns. Finally,
+remove the gap in O80429\_MAIZE at column 56 using [SHIFT]-drag to the left on
+42R.}
+
+\exstep{ Use the
+{\sl Edit $\Rightarrow$ Undo Edit} and {\sl Edit $\Rightarrow$ Redo Edit} menu option to step backwards and replay the
+edits you have made}
}
+\subsubsection{Editing in Cursor mode}
+
+Gaps can be inserted in cursor mode by pressing [SPACE]. Gaps will be inserted at the cursor, pushing the residue under the cursor to the right. To insert {\sl n} gaps type {\sl n} and then press [SPACE]. To insert gaps into all sequences of a group, use [CTRL]-[SPACE] or [SHIFT]-[SPACE] (both keys held down together).
+
+Gaps can be removed in cursor mode by pressing [BACKSPACE]. The gap under the cursor will be removed. To remove {\sl n} gaps, type {\sl n} and then press [BACKSPACE]. Gaps will be deleted up to the number specified. To delete gaps from all sequences of a group, use [CTRL]-[BACKSPACE] or [SHIFT]-[BACKSPACE] (both keys held down together).
+
\exercise{Keyboard edits}{
-\exstep{Load the sequence alignment at \textsf{http://www.jalview.org/tutorial/unaligned.fa}. Enter cursor mode by pressing [F2]}
+\exstep{Load the sequence alignment at \textsf{http://www.jalview.org/tutorial/unaligned.fa}, or continue using the edited alignment from exercise \ref{mousealedit}. If you continue from the previous exercise, then first right click on the sequence ID panel and select {\tr Reveal All}.
+
+Now, enter cursor mode by pressing [F2]}
\exstep{Insert 58 gaps at the start of the first sequence (FER\_CAPAA). Press {\sl 58} then {\sl [SPACE]}. }
-\exstep{Go down one sequence and select rows 2-5 as a block. Click on the second sequence id (FER\_CAPAN). Hold down shift and click on the fifth (FER1\_PEA). }
+\exstep{Go down one sequence and select rows 2-5 as a block. Click on the second sequence ID (FER\_CAPAN). Hold down shift and click on the fifth (FER1\_PEA). }
\exstep{Insert 6 gaps at the start of this group. Go to column 1 row 2 by typing {\sl 1,2} then pressing {\sl [RETURN]}. Now insert 6 gaps. Type {\sl 6} then hold down [CTRL] and press the space bar.}
\exstep{Now insert one gap at column 34 and another at 38. Insert 3 gaps at 47. Press {\sl 3 4 C} then [CTRL]-[SPACE]. Press {\sl 3 8 C} then [CTRL]-[SPACE]. Press {\sl 4 7 C} then {\sl 3 [CTRL-SPACE]} the first through fourth sequences are now aligned.}
\exstep{The fifth sequence (FER1\_PEA) is poorly aligned. We will delete some gaps and add some new ones. Navigate to the start of sequence 5 and delete 3 gaps. Press {\sl 1 , 5 [RETURN]} then {\sl 3 [BACKSPACE]} to delete three gaps. Go to column 31 and delete the gap. Press {\sl 3 1 C [BACKSPACE]} .}
\exstep{ Similarly delete the gap now at column 34, then insert two gaps at column 38 . Press {\sl 3 4 C [BACKSPACE] 3 8 C 2 [SPACE]}. Delete three gaps at 44 and insert one at 47 by pressing {\sl 4 4 C 3 [BACKSPACE] 4 7 C [SPACE]}. The top five sequences are now aligned.}
}
-\r\subsection{Hiding regions}
-
-It can be the case that one does not wish to view some sequences or residues in the alignment but does not wish to remove them from the alignment. Jalview allows sequences or regions to be hidden. To hide a set of sequences, select them and right-click the mouse on the selected sequence id's to bring up the context menu. Select {\sl Hide Sequences} and the sequences will be concealed, with a small triangle indicating their position (Figure \ref{hideseq}). To unhide (reveal) the sequences, right click on the triangle and select {\sl Reveal Sequences} from the context menu.
-
-
- \begin{figure}[htbp]
-\begin{center}
-\includegraphics[width=1.5in]{images/hide1.pdf}
-\includegraphics[width=2.5in]{images/hide2.pdf}
-\includegraphics[width=1.75in]{images/hide3.pdf}
-\caption{{\bf Hiding Sequences} Hidden sequences are represented by a blue triangle in the sequence ID panel}
-\label{hideseq}
-\end{center}
-\end{figure}
-
-
-
-A similar mechanism applies to columns (Figure \ref{hidecol}). Selected columns can be hidden and revealed in the same way via the context menu (right click) on the ruler bar. The hidden selection is indicated by a blue triangle in the ruler bar.
-
- \begin{figure}[htbp]
-\begin{center}
-\includegraphics[width=2in]{images/hide4.pdf}
-\includegraphics[width=3in]{images/hide5.pdf}
-\includegraphics[width=1in]{images/hide6.pdf}
-\caption{{\bf Hiding Columns} Hidden columns are represented by a blue triangle in the ruler bar}
-\label{hidecol}
-\end{center}
-\end{figure}
-
-\exercise{Hiding and revealing regions}{
-\exstep{Close all windows then open the PFAM accession PF03460. Select a contiguous set of sequences by clicking and dragging on the sequence ID panel. Right click on the selected sequence IDs and select {\sl Hide Sequences}.
-}
-\exstep{
-Right click on the blue triangle indicating hidden sequences and select {\sl Reveal Sequences}. (If you have hidden all sequences then you will need to use the alignment window menu option {\sl View $\Rightarrow$ Show $\Rightarrow$ All Sequences.})
-}
-\exstep{
-Repeat but using a non-contiguous set of sequences. Note that when multiple regions are hidden there are two options, {\sl Reveal Sequences} and {\sl Reveal All}.
-}
-\exstep{Repeat the above but hiding and revealing columns instead of sequences.
-}
-}
\r\section{Colouring sequences}
-\label{colours}\r
+\label{colours}
-Colouring sequences is a key aspect of alignment presentation. Jalview allows both for colouring of the whole alignment and colouring of selections/groups. The colour schemes available are the same for both mechanisms and are described in section \ref{colscheme} below.
+Colouring sequences is a key aspect of alignment presentation. Jalview allows both for colouring of the whole alignment and colouring of selections/groups. There are two main types of colouring styles: simple static residue colourschemes, dynamic schemes which use conservation and consensus analysis to control colouring. A hybrid colouring is also possible, where static residue schemes are modified using a dynamic scheme. The individual schemes are described in section \ref{colscheme} below.
\subsection{Colouring the whole alignment}
-\parbox[c]{3.75in}{The alignment can be coloured via the Colour menu option in the alignment window. Selecting the colour scheme causes all residues to be coloured.
-
-For certain colour schemes, the intensity of the colour can be scaled by a conservation threshold. Selecting {\sl Colour $\Rightarrow$ By Conservation} brings up a selection box allowing the alignment colouring to be modified. Selecting a higher threshold limits colouring to higher conserved groups (Figure \ref{colcons}).
+\parbox[c]{3.75in}{The alignment can be coloured via the {\sl Colour} menu option in the alignment window. Selecting the colour scheme causes all residues to be coloured. The menu is divided into two three sections. The first section gives options for the behaviour of the menu options, the second lists static and dynamic colourschemes available for selection, and the last gives options for making hybrid colourschemes using conservation shading or colourscheme thresholding.
}\parbox[c]{3in}{
\centerline {
}
}
-%For certain colour schemes, the intensity of the colour can be scaled by a conservation threshold. Selecting {\sl Colour $\Rightarrow$ By Conservation} brings up a selection box allowing the alignment colouring to be modified. Selecting a higher threshold limits colouring to higher conserved groups.
-
- \begin{figure}[htbp]
-\begin{center}
-\includegraphics[width=2in]{images/colourcons1.pdf}
-\includegraphics[width=2in]{images/colourcons3.pdf}
-\includegraphics[width=2in]{images/colourcons5.pdf}
-\caption{{\bf Conservation Threshold} The transparency of the residue colouring is controlled by the conservation threshold. The effect of 0\% (left), 50\% (center) and 100\% (right) thresholds are shown.
-}
-\label{colcons}
-\end{center}
-\end{figure}
-
-
-
-
-%fig
\subsection{Colouring a group or selection}
Selections or groups can be coloured via two ways. The first is via the alignment Colour menu but ensuring that the Apply to all groups flag is not selected. This will have to be turned off specifically as it is on by default.
\end{center}
\end{figure}
+\subsection{Shading by conservation}
+For many colour schemes, the intensity of the colour in a column can be scaled by the degree of amino acid property conservation. Selecting {\sl Colour $\Rightarrow$ By Conservation} brings up a selection box (the {\sl Conservation Threshold dialog box}) allowing the alignment colouring to be modified. Selecting a higher value limits colouring to higher conserved groups (Figure \ref{colcons}).
+
+ \begin{figure}[htbp]
+\begin{center}
+\includegraphics[width=2in]{images/colourcons1.pdf}
+\includegraphics[width=2in]{images/colourcons3.pdf}
+\includegraphics[width=2in]{images/colourcons5.pdf}
+\caption{{\bf Conservation Shading} The density of the ClustalX style residue colouring is controlled by the conservation threshold. The effect of 0\% (left), 50\% (center) and 100\% (right) thresholds are shown.
+}
+\label{colcons}
+\end{center}
+\end{figure}
+
+\subsection{Thresholding by percentage identity}
+
+'Thresholding' is another hybrid colour model where a residue is only coloured if it is not excluded by an applied threshold. Selecting {\sl Colour $\Rightarrow$ Above Identity Threshold} brings up a selection box with a slider controlling the minimum percentage identity threshold to be applied. Selecting a higher threshold (by sliding to the right) limits the colouring to columns with a higher percentage identity (as shown by the Consensus histogram in the annotation panel).
+
+\subsection{Colouring by Annotation}
+\parbox[c]{3in}{
+Any of the quantitative annotation on an alignment can be used to threshold or shade the whole alignment. The {\sl Colour $\Rightarrow$ By Annotation} options opens a dialog which allows you to select which annotation to use, the minimum and maximum shading colours or whether an existing colouring is to be thresholded.
+}\parbox[c]{3in}{
+\centerline{\includegraphics[width=2.5in]{images/col_byannot.pdf}}}
\subsection{Colour schemes}
+
\label{colscheme}
-Full details on each colour scheme can be found in the Jalview on-line help.
-\r
+Full details on each colour scheme can be found in the Jalview on-line help. A brief description of each one is provided below:
+
\subsubsection{ClustalX}
\subsubsection{Nucleotide}
\parbox[c]{3.5in}{
-Residues are coloured with four colours corresponding to the four nucleotide bases. All non ACTG residues are uncoloured.
+Residues are coloured with four colours corresponding to the four nucleotide bases. All non ACTG residues are uncoloured. See section \ref{workingwithnuc} for further information about working with nucleic acid sequences and alignments.
}
\parbox[c]{3in}{
\includegraphics[width=2.75in]{images/col_nuc.pdf}
Open a sequence alignment, for example the PFAM domain PF03460. Select the alignment menu option {\sl Colour $\Rightarrow$ ClustalX}. Note the colour change. Now try all the other colour schemes in the {\sl Colour} menu. Note that some colour schemes do not colour all residues.
}
\exstep{
-Colour the alignment using {\sl Colour $\Rightarrow$ Blosum62}. Select a group of around 4 similar sequences. Use the context menu (right click on the group) option {\sl Selection $\Rightarrow$ Group $\Rightarrow$ Group Colour $\Rightarrow$ Blosum62} to colour the selection. Notice how some residues which were not coloured are ntw coloured. The calculations performed for colouring schemes just apply to the group being coloured, not the whole alignment.
+Colour the alignment using {\sl Colour $\Rightarrow$ Blosum62}. Select a group of around 4 similar sequences. Use the context menu (right click on the group) option {\sl Selection $\Rightarrow$ Group $\Rightarrow$ Group Colour $\Rightarrow$ Blosum62} to colour the selection. Notice how some residues which were not coloured are now coloured. The calculations performed for dynamic colouring schemes like Blosum62 are based on the group being coloured, not the whole alignment (this also explains the colouring changes observed in the group selection exercise step \ref{exselectgrpcolour}).
}
\exstep{
Keeping the same selection as before, colour the complete alignment using {\sl Colour $\Rightarrow$ Taylor}. Select the menu option {\sl Colour $\Rightarrow$ By Conservation}. Slide the selector from side to side and observe the changes in the alignment colouring in the selection and in the complete alignment.
}
\subsubsection{User Defined}
-This dialogue allows the user to create any number of names colour schemes at will. Any residue may be assigned any colour. The colour scheme can then be named. If you save the colour scheme, this name will appear on the Colour menu
+This dialogue allows the user to create any number of named colour schemes at will. Any residue may be assigned any colour. The colour scheme can then be named. If you save the colour scheme, this name will appear on the Colour menu
\begin{figure}[htbp]
The new colour scheme appears in the list of colour schemes in the {\sl Colour} menu and can be selected in future Jalview sessions.
}
}
-\r\section{Screen layout and graphics output}\r
+\r\section{Alignment formatting and graphics output}
+
+Jalview is a WYSIWIG alignment editor. This means that for most kinds of graphics output, the layout that is seen on screen will be the same as what is output in an exported graphics file. It is therefore important to pick the right kind of display layout prior to generating figures.
+
+\subsection{Multiple Alignment Views}
-\subsection{Screen layout}
+Jalview is able to create multiple independent visualizations of the same underlying alignment - these are called {\tr Views}. Because each view displays the same underlying data, any edits performed in one view will update the alignment or annotation visible in all views.
+
+\parbox[c]{4in}{Alignment views are created using the {\tr View $\RightArrow$ New View} option of the alignment window. This will create a new view with the same groups, alignment layout and display options as the current one. Views may be gathered (by pressing G) together as named tabs on the alignment window, or displayed simultaneously in their own window (by pressing X).}\parbox[c]{2.75in}{
+\begin{center}\centerline{
+\includegraphics[width=2.5in]{images/mulv_tabs.pdf}}
+\end{center}
+}
+
+% JBPNote make an excercise on views ?
+
+\subsection{Alignment layout}
Jalview provides two screen layout modes, unwrapped (the default) where the alignment is in one long line across the window, and wrapped, where the alignment is on multiple lines, each the width of the window. Most layout options are controlled by the Format menu option in the alignment window.
\subsubsection{Wrapped alignments}
-Wrapped alignments can be toggled on and off using the {\sl Format $\Rightarrow$ Wrap} menu option (Figure \ref{wrap}). Note that the annotation lines are also wrapped. Wrapped alignments are great for publications and presentations but are hard to work with on the screen. Selecting regions can be difficult if they span more than one line.
-
+Wrapped alignments can be toggled on and off using the {\sl Format $\Rightarrow$ Wrap} menu option (Figure \ref{wrap}). Note that the annotation lines are also wrapped. Wrapped alignments are great for publications and presentations but are of limited use when working with large numbers of sequences. Furthermore, alignment annotation (see section \ref{featannot}) cannot be interactively created or edited in wrapped mode, and selection of large regions is difficult.
\begin{figure}[htbp]
\begin{center}
+% this view still refers to Jalview 2.2 and the menu is missing the Center Columns option
\parbox[c]{2in}{\includegraphics[width=2in]{images/wrap1.pdf}}
\parbox[c]{4in}{\includegraphics[width=4in]{images/wrap2.pdf}}
\caption{{\bf Wrapping the alignment}}
\end{center}
\end{figure}
-\exercise{Screen Layout}{
+\exercise{Alignment Layout}{
\label{exscreen}
\exstep{Start Jalview and open the URL \textsf{http://www.jalview.org/examples/exampleFile.jar}. Select {\sl Format $\Rightarrow$ Wrap} from the alignment window menu. Experiment with the various options from the {\sl Format} menu. to adjust the ruler placement, sequence ID format and so on. }
\exstep{Hide all the annotation rows by selecting {\sl View $\Rightarrow$ Show Annotations} from the alignment window menu. Reveal the annotations by selecting the same menu option.}
-\exstep{Right click on the annotation row labels to bring up the context menu. Select {\sl Hide This Row}. Bring up th econtext menu again and select {\sl Show All Hidden Rows} to reveal them}
+\exstep{Right click on the annotation row labels to bring up the context menu. Select {\sl Hide This Row}. Bring up the context menu again and select {\sl Show All Hidden Rows} to reveal them}
\exstep{Annotations can be reordered by clicking and dragging the row to the desired position. Click on the {\sl Consensus} row and drag it upwards to just above {\sl Quality}. The rows should now be reordered. Features and annotations are covered in more detail in section \ref{featannot} below.}
-\exstep{Drag the Secondary Structure label to resize the Alignment Annotation panel}
+\exstep{Move the mouse to the top left hand corner of the Secondary Structure annotation row label - a grey up/down arrow symbol should appear - when this is shown, the height of the {\sl Annotation Area} can be changed by Clicking and dragging the mouse up or down.}
}
\subsection{Graphical output}
-\parbox[c]{4in}{Jalview allows alignments to be exported in three different formats, each of which is suited to a particular purpose. Image export is via the {\sl File $\Rightarrow$ Export Image $\Rightarrow$ \ldots } alignment window menu option. }
+\parbox[c]{4in}{Jalview allows alignments figures to be exported in three different formats, each of which is suited to a particular purpose. Image export is via the {\sl File $\Rightarrow$ Export Image $\Rightarrow$ \ldots } alignment window menu option. }
\parbox[c]{2in}{\centerline{\includegraphics[width=1.25in]{images/image.pdf}}}
\subsubsection{HTML}
-\parbox[c]{3in}{HTML is the format used by web pages. Jalview outputs the alignment as an HTML table with all the colours and fonts as seen. This file can then be viewed directly with any web browser. Each residue is placed in an individual table cell. Unwrapped alignments will produce a very wide page.}
+\parbox[c]{3in}{HTML is the format used by web pages. Jalview outputs the alignment as an HTML table with all the colours and fonts as seen. Any additional annotation will also be embedded as sensitive areas on the page, such as URL links for each seuqence's ID label. This file can then be viewed directly with any web browser. Each residue is placed in an individual table cell. Unwrapped alignments will produce a very wide page.}
\parbox[c]{3.5in}{\centerline{\includegraphics[width=3in]{images/image_html.pdf}}}
\subsubsection{EPS}
\exstep{Export the alignment using the {\sl File $\Rightarrow$ Export Image $\Rightarrow$ EPS} menu option. Open the file in a suitable program such as Ghostview or Preview (Mac OS X). Zoom in and note that the image is indefinitely scalable.}
}
-\chapter{Analysis}
+\chapter{Analysis and Annotation}
\section{Analysis of alignments}
-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. Other, more computationally intensive analyses, are run outside Jalview via web services, typically accessed via the {\sl Web Services}. It is anticipated that Jalview will extend further the range of Web Services based analyses.
+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.
This section describes the built in analyses. Web Services are described in a subsequent section.
\subsection{PCA}
This calculation creates a spatial representation of the similarities within the current selection or the whole alignment if no selection has been made. After the calculation finishes, a 3D viewer displays the each sequence as a point in 3D 'similarity space'. Sets of similar sequences tend to lie near each other in this space.
-Note: The calculation is computationally expensive, and may fail for very large sets of sequences - usually because the JVM has run out of memory. A future release of Jalview will be able to avoid this by executing the calculation via a web service.
+Note: The calculation is computationally expensive, and may fail for very large sets of sequences - because the JVM has run out of memory. See the FAQ on the Jalview web site for instructions on how to increase the memory available to Jalview.
\subsubsection{What is PCA?}
Principal components analysis is a technique for examining the structure of complex data sets. The components are a set of dimensions formed from the measured values in the data set, and the principle component is the one with the greatest magnitude, or length. The sets of measurements that differ the most should lie at either end of this principle axis, and the other axes correspond to less extreme patterns of variation in the data set.
\exstep{Select the menu option {\sl Calculate $\Rightarrow$ Principle Component Analysis}. A new window will open. Move this window so that the tree, alignment and PCA viewer window are all visible. Try rotating the plot by clicking and dragging the mouse on the plot in the PCA window. Note that clicking on points in the plot will highlight them on the alignment and tree.
}
\exstep{
-Click on the tree window. Careful selection of mouse location will divide the alignment into a number of groups, each of a different colour. Note how the colour of the sequence id label matches the colour in the PCA plot.
+Click on the tree window. Careful selection of the tree partition location will divide the alignment into a number of groups, each of a different colour. Note how the colour of the sequence ID label matches both the colour of the partitioned tree and the points in the PCA plot.
}
}
-
\subsection{Trees}
-Jalview can calculate and display trees, providing interactive tree-based grouping of sequences though a tree viewer. All trees are calculated via the {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ \ldots} submenu. Trees can be calculated from distance matrices determined from \% identity or aggregate BLOSUM 62 score and reconstructed with either average distance (UPGMA) or Neighbour joining algorithms. The sequence alignment from which a tree is calculated is the current selection, or the whole alignment if no selection is present.
+Jalview can calculate and display trees, providing interactive tree-based grouping of sequences though a tree viewer. All trees are calculated via the {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ \ldots} submenu. Trees can be calculated from distance matrices determined from \% identity or aggregate BLOSUM 62 score using either average distance (UPGMA) or Neighbour joining algorithms. The input data for a tree calculation is either the visible portions of the current selection, or the whole alignment if no selection is present.
-On calculating a tree, a new window opens (Figure \ref{trees1}) which contains the tree. Various display options can be found in the tree window {\sl View} menu, and export options in the {\sl File $\Rightarrow$ Save As} submenu. Newick format is a standard file format for trees which allows them to be exported to other programs. Jalview can also read in external trees in Newick format via the {\sl File $\Rightarrow$ Load Associated Tree} menu option. The sequence ID's have to match between the alignment and the loaded tree. Nodes for which no sequence is found in the alignment are ignored.
+On calculating a tree, a new window opens (Figure \ref{trees1}) which contains the tree. Various display options can be found in the tree window {\sl View} menu, and export options in the {\sl File $\Rightarrow$ Save As} submenu. Newick format is a standard file format for trees which allows them to be exported to other programs. Jalview can also read in external trees in Newick format via the {\sl File $\Rightarrow$ Load Associated Tree} menu option. Leaf names on imported trees will be matched to the associated alignment - unmatched leaves will still be displayed, and can be highlighted using the {\sl View $\Rightarrow$ Show Unlinked Leaves }.
\begin{figure}
\end{center}
\end{figure}
-\subsubsection{Other Calculations}
+%\subsubsection{Multiple Views and Input Data recovery from PCA and Tree Viewers}
+% move to ch. 3 ?
+%Both PCA and Tree viewers are linked analysis windows. This means that their selection and display are linked to a particular alignment, and control and reflect the selection state for a particular view.
+
+\subsubsection{Recovering input data for a tree or PCA plot calculation}
+\parbox[c]{4in}{
+The {\sl File $\RightArrow$ Input Data } option will open a new alignment window containing the original data used to calculate the tree or PCA plot (if available). This function is useful when a tree has been created and then the alignment subsequently changed.
+} \parbox[c]{3in}{\centerline{\includegraphics[width=2.75in]{images/pca_vmenu.pdf}
+}}
+
+\subsubsection{Changing the associated view for a tree or PCA viewer}
+\parbox[c]{5in}{
+The {\sl View $\Rightarrow$ Associated View $\Rightarrow$ .. } submenu is shown when the viewer is associated with an alignment that is involved in multiple views. Selecting a different view does not affect the tree or PCA data, but will change the colouring and display of selected sequences in the display in accord with the colouring and selection state of the newly associated view.
+} \parbox[c]{=2in}{\centerline{ \includegraphics[width=1.3in]{images/pca_fmenu}
+}}
+
+
+\exercise{Trees}{
+\exstep{ Open the alignment at \textsf{http://www.jalview.org/tutorial/alignment.fa}. Select {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ Neighbour Joining Using BLOSUM62}. A new tree window will appear.}
+\exstep{Click on the tree window. A cursor will appear. Note that placing this cursor divides the tree into a number of groups by colour. Place the cursor to give about 4 groups, then select {\sl Calculate $\Rightarrow$ Sort $\Rightarrow$ By Tree Order $\Rightarrow$ Neighbour Joining Tree using BLOSUM62 from ... }. The sequences are reordered to match the order in the tree and groups are formed implicitly.}
+\exstep{Select {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ Neighbour Joining Using \% Identity}. A new tree window will appear. The group colouring makes it easy to see the diferences between the two trees, calculated using different methods.}
+\exstep{Select from sequence 2 column 60 to sequence 12 column 123. Select {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ Neighbour Joining Using BLOSUM62}. A new tree window will appear. It can be seen that the tree contains 11 sequences. It has been coloured according to the already selected groups from the first tree and is calculated purely from the residues in the selection.
+Comparing the location of individual sequences between the two trees illustrates the importance of selecting appropriate regions of the alignment for the calculation of trees.
+}
+\exstep{Recover the input data for the tree you just calculated. Check the {\sl Edit $\Rightarrow$ Pad Gaps } option is not ticked, and insert one gap in the alignment. Now select {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ Neighbour Joining Using BLOSUM62}.
+
+A warning dialog box {\bf ``Sequence's must be aligned'' } appears because the sequences input to the tree calculation are of different lengths. }
+
+\exstep{Now select {\sl Edit $\RightArrow$ Pad Gaps } and try to perform the tree calculation again - this time a new tree should appear.
+
+This demonstrates the use of the {\sl Pad Gaps } editing preference, which ensures that all sequences are the same length after editing. }
+
+}
+
+\subsection{Tree Based Conservation Analysis}
+\label{treeconsanaly}
+\exercise{Tree Based Conservation Analysis}{
+\exstep{Load the PF03460 Seed alignment using the sequence fetcher. Colour it with the {\sl Taylor colourscheme}, and apply {\sl Conservation } shading. }
+\exstep{Build a Neighbourjoining tree using BLOSUM62 and use the sort submenu to order alignment using the calculated tree.}
+\exstep{Select a point on the tree to partition the alignment, and examine the variation in colouring between different groups.
+
+You may find it easier to browse the alignment by if you uncheck the {\sl Show Annotations} view option, and open the overview window to aid navigation.}
+\exstep{Try changing the colourscheme to BLOSUM62 (whilst ensuring that {\sl Apply Colour to All Groups} is selected)}
+}
+
+\subsection{Redundancy Removal}
+
+The redundancy removal dialog box is opened using the {\sl Edit $\Rightarrow$ Remove Redundancy\ldots} option in the alignment menu. As its menu option placement suggests, this is actually an alignment editing function, but it is convenient to describe it here. The redundancy removal dialog box presents a percentage identity slider which sets the redundancy threshold. Aligned sequences which exhibit a percentage identity greater than the current threshold are highlighted in black. The [Remove] button can then be used to eliminate these sequences from the alignment as an edit operation.
+\begin{figure}
+\begin{center}
+\includegraphics[width=5.5in]{images/redundancy.pdf}
+\end{center}
+\label{removeredundancydialog}
+\caption{The Redundancy Removal dialog box opened from the edit menu. Sequences that exceed the current \%age identity threshold and are to be removed are highlighted in black.}
+\end{figure}
+
+\exercise{Remove redundant sequences}{
+\exstep{Re-use or recreate the alignment and tree which you worked with in the tree based conservation analysis exercise (exercise \ref{treeconsanaly})}
+\exstep{Open the Remove Redundancy dialog and adjust the threshold to 90\%. Remove the seuqences that are more than 90\% similar under this alignment.}
+\exstep{Select the Tree viewer's {\sl View $\Rightarrow$ Show Linked Leaves} option, and note that the removed sequences are now prefixed with a * in the tree view.}
+\exstep{Use the [Undo] button on the dialog to recover the sequences. Note that the * symbols disappear from the tree display.}
+\exstep{Experiment with the redundancy removal and observe the relationship between the percentage identity threshold and the pattern of unlinked nodes in the tree display.}
+}
+
+\subsection{Other Calculations}
On loading a sequence alignment, Jalview calculates alignment quality, conservation and consensus as alignment annotations. Conservation is calculated according to Livingstone and Barton\footnote{{\sl "Protein Sequence Alignments: A Strategy for the Hierarchical Analysis of Residue Conservation." } Livingstone C.D. and Barton G.J. (1993) {\sl CABIOS } {\bf 9}, 745-756}. Consensus is the modal residue (or {\tt +} where there is an equal top residue). The inclusion of gaps in the consensus calculation can be toggled by right-clicking on the the Consensus label and selecting {\sl Ignore Gaps in Consensus} from the context menu. Quality is a measure of the inverse likelihood of unfavourable mutations in the alignment. Further details on these calculations can be found in the on-line documentation.
These annotations can be hidden and deleted but are only created on loading an alignment. If they are deleted then the alignment should be saved and reloaded to restore them. Jalview provides a toggle to autocalculate a consensus sequence upon editing. This is normally left selected but for large alignments can be turned off via the {\sl Calculate $\Rightarrow$ Autocalculate Consensus} menu option if the interface is too sluggish.
-Jalview can calculate optimal pairwise alignments between arbitrary sequences via the {\sl Calculate $\Rightarrow$ Pairwise Alignments\ldots} menu option. Global alignments of all pairwise combinations of the selected sequences are performed and the results returned in a text box.
+\subsubsection{Pairwise Alignments}
+
+Jalview can calculate optimal pairwise alignments between arbitrary sequences via the {\sl Calculate $\Rightarrow$ Pairwise Alignments\ldots} menu option. Global alignments of all pairwise combinations of the selected sequences are performed and the results returned in a text box.
\begin{figure}[htbp]
\begin{center}
\end{center}
\end{figure}
-\exercise{Trees}{
-\exstep{ Open the alignment at \textsf{http://www.jalview.org/tutorial/alignment.fa}. Select {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ Neighbour Joining Using BLOSUM62}. A new tree window will appear.}
-\exstep{Click on the tree window. A cursor will appear. Note that placing this cursor divides the tree into a number of groups by colour. Place the cursor to give about 4 groups, then select {\sl Calculate $\Rightarrow$ Sort $\Rightarrow$ By Tree Order $\Rightarrow$ Neighbour Joining Tree using BLOSUM62 from ... }. The sequences are reordered to match the order in the tree and groups are formed implicitly.}
-\exstep{Select {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ Neighbour Joining Using \% Identity}. A new tree window will appear. The group colouring makes it easy to see the diferences between the two trees, calculated using different methods.}
-\exstep{Select from sequence 2 column 60 to sequence 12 column 123. Select {\sl Calculate $\Rightarrow$ Calculate Tree $\Rightarrow$ Neighbour Joining Using BLOSUM62}. A new tree window will appear. It can be seen that the tree contains 11 sequences. It has been coloured according to the already selected groups from the first tree and is calculated purely from the residues in the selection.
-Comparing the location of individual sequences between the two trees illustrates teh importance of selecting appropriate resides for calculation of trees.
-}
-}
\section{Web Services}
-Web services are a technology which allows the Jalview application to offload compute intensive tasks to remote servers via the internet. Jalview will construct a job, ask the remote server to run the job, monitor status of the job and, finally, retrieve the results of the job and display them. The Jalview user is kept informed of the progress of the job through a status window.
+Web services are a technology which allows the Jalview application to access databases remotely and offload computationally intensive tasks to High Performacne Computing facilities {\sl via} the internet. Access to remote database resources are described in other sections. They include sequence retrieval (in section \ref{fetchseq}), database reference retrieval (in section \ref{fetchdbrefs}) and sequence feature retrieval with DAS, which is described in \ref{das}. The next few sections describe the computational analysis services available to Jalview.
-It is essential that you have a continuous network connection in order to successfully use Web Services from Jalview.
+\subsection{Remote Analysis Services}
+Jalview will construct a job, ask the remote server to run the job, monitor status of the job and, finally, retrieve the results of the job and display them. The Jalview user is kept informed of the progress of the job through a status window.
-\subsection{Realignment}
+Currently, web service jobs and their status windows are not stored in Jalview Project Files\footnote{This may be rectified in future versions.}, so it is important that you do not close Jalview whilst a job is running. It is also essential that you have a continuous network connection in order to successfully use Web Services from Jalview, since it periodically checks the progress of running jobs.
+
+\subsection{Multiple Sequence Alignment}
+
+Sequences can be aligned using any of three algorithms: ClustalW\footnote{{\sl "CLUSTAL W: improving the sensitivity of progressive multiple sequence alignment through sequence weighting, position specific gap penalties and weight matrix choice."} Thompson JD, Higgins DG, Gibson TJ (1994) {\sl Nucleic Acids Research} {\bf 22}, 4673-80}, Muscle\footnote{{\sl "MUSCLE: a multiple sequence alignment method with reduced time and space complexity"} Edgar, R.C. (2004) {\sl BMC Bioinformatics} {\bf 5}, 113} or MAFFT\footnote{{\sl "MAFFT: a novel method for rapid multiple sequence alignment based on fast Fourier transform"} Katoh, K., Misawa, K., Kuma, K. and Miyata, T. (2002) {\sl Nucleic Acids Research} {\bf 30}, 3059-3066. and {\sl "MAFFT version 5: improvement in accuracy of multiple sequence alignment"} Katoh, K., Kuma, K., Toh, H. and Miyata, T. (2005) {\sl Nucleic Acids Research} {\bf 33}, 511-518.} Of these, ClustalW is the slowest but is historically widely used. Muscle is fast and probably the most accurate for smaller alignments and MAFFT is probably the best for large alignments.
-Proteins can be realigned using any of three algorithms: ClustalW\footnote{{\sl "CLUSTAL W: improving the sensitivity of progressive multiple sequence alignment through sequence weighting, position specific gap penalties and weight matrix choice."} Thompson JD, Higgins DG, Gibson TJ (1994) {\sl Nucleic Acids Research} {\bf 22}, 4673-80}, Muscle\footnote{{\sl "MUSCLE: a multiple sequence alignment method with reduced time and space complexity"} Edgar, R.C. (2004) {\sl BMC Bioinformatics} {\bf 5}, 113} or MAFFT\footnote{{\sl "MAFFT: a novel method for rapid multiple sequence alignment based on fast Fourier transform"} Katoh, K., Misawa, K., Kuma, K. and Miyata, T. (2002) {\sl Nucleic Acids Research} {\bf 30}, 3059Ð3066. and {\sl "MAFFT version 5: improvement in accuracy of multiple sequence alignment"} Katoh, K., Kuma, K., Toh, H. and Miyata, T. (2005) {\sl Nucleic Acids Research} {\bf 33}, 511Ð518.} Of these, ClustalW is the slowest but is historically widely used. Muscle is fast and probably the most accurate for smaller alignments and MAFFT is probably the best for large alignments.
To run an alignment web service, select the appropriate method from the {\sl Web Service $\Rightarrow$ Alignment $\Rightarrow$ \ldots} submenu (Figure \ref{webservices}). A progress window will appear giving information about the job and any errors that occur. After successful completion of the job, a new window is opened with the results, in this case an alignment.
\end{center}
\end{figure}
+\subsubsection{Realignment}
+
+The re-alignment option (only supported by ClustalW currently) submits the current selection to the alignment service complete with existing gaps. Use this option to align additional sequences to an existing alignment (a simple form of profile alignment).
+
+\subsubsection{Alignments of sequences including hidden regions}
+
+If the view or selected region that is submitted for alignment contains hidden regions, then only the visible sequences will be submitted to the service. Furthermore, each contiguous segment of sequences will be aligned independently (resulting a number of alignment 'subjobs' appearing in the status window). Finally, the results of each subjob will be concatenated with the hidden regions in the input data prior to their display in a new window. This approach ensures that 1) hidden column boundaries in the input data are preserved in the resulting alignment - in a similar fashion to the constraint that hidden columns place on alignment editing (see section \ref{lockededits}). 2) hidden columns can be used to preserve existing parts of an alignment whilst the visible parts are locally refined.
+
\exercise{Multiple Sequence Alignment}{
\exstep{ Close all windows and open the alignment at {\sf http://www.jalview.org/tutorial/unaligned.fa}. Select {\sl Web Service $\Rightarrow$ Alignment $\Rightarrow$ Muscle Multiple Protein Sequence Alignment}. A window will open giving the job status. After a short time, a second window will open with the results of the alignment.}
\exstep{Select the first sequence set by clicking on the window and try running ClustalW and MAFFT (from the {\sl Web Services $\Rightarrow$ Alignment} menu) on the same initial alignment. Compare them and you should notice small differences.
}
+\exstep{Select the last three sequences in the MAFFT alignment, and de-align them with {\sl Edit $\Rightarrow$ Remove All Gaps}. Press [ESC] to deselect them and then submit the view for re-alignment with ClustalW.}
+\exstep{Use [CTRL]-Z to recover the alignment of the last three sequences in the MAFFT alignment. Once the ClustalW re-alignment has completed, compare the results of re-alignment of the three sequences with their alignment in the original MAFFT result.}
+\exstep{Select columns 60 to 125 in the original MAFFT alignment and hide them. Select {\sl Web Services $\RightArrow$ Alignment $\RightArrow$ MAFFT} to submit the visible portion of the alignment to MAFFT. When the web service job pane appears, note that there are now two alignment job status panes shown in the window.}
+\exstep{When the MAFFT job has finished, compare the alignment of the N-terminal visible region in the result with the corresponding region of the original alignment. If you wish, select and hide a few more columns in the N-terminal region, and submit the alignment to the service again and explore the effect of local alignment on the non-homologous parts of the N-terminal region.}
+}
-
-}
-\r
\subsection{Secondary Structure Prediction}
Secondary structure prediction is performed using the Jpred\footnote{{\sl "Jpred: A Consensus Secondary Structure Prediction Server"} Cuff, J. A., Clamp, M. E., Siddiqui, A. S., Finlay, M. and Barton, G. J. (1998) {\sl Bioinformatics} {\bf 14}, 892-893} server at the University of Dundee\footnote{http://www.compbio.dundee.ac.uk/~www-jpred/}. The behaviour of this calculation depends on the current selection:
\end{center}
\end{figure}
+\subsubsection{Hidden Columns and JNet Predictions}
+\label{hcoljnet}
+Hidden columns can be used to exclude parts of a sequence or profile from the input sent to the JNet service. For instance, if a sequence is known to include a large loop insertion, hiding that section prior to submitting the JNet prediction may\footnote{This, of course, cannot be guaranteed, but the profile calculated by JNet will at least be different.} result in a more reliable secondary structure prediction either side of the insertion. Prediction results returned from the service will be mapped back onto the visible parts of the sequence, to ensure a single frame of reference is maintained in your analysis.
+
\exercise{Secondary Structure Prediction}{
+\label{secstrpredex}
\exstep{ Open the alignment at \textsf{http://www.jalview.org/tutorial/alignment.fa}. Select the sequence {\sl FER\_MESCR} by clicking on the sequence ID. Then select {\sl Web Services $\Rightarrow$ Secondary Structure Prediction $\Rightarrow$ JNet Secondary Structure Prediction} from the alignment window menu. A status window will appear and after some time a new window with the JPred prediction will appear. Note that the number of sequences in the results window is many more than in the original alignment as JNet performs a PSI-BLAST search to expand the prediction dataset.
}
+% TODO: check how long this takes - about 2 mins once it gets on the cluster.
\exstep{
Select a different sequence and perform a JNet prediction in the same way. There will probably be minor differences in the predictions.
}
+\exstep{
+Select the second sequence prediction, and copy and paste it into the first prediction window. You can now compare the two predictions. Jnet secondary structure prediction annotation are examples of {\bf sequence associated alignment annotation}.
+% which is described in section \ref{seqassocannot} below.
+}
+\exstep{
+Select and hide some columns in one of the profiles that were returned from the JNet service, and then submit the profile for prediction again.
+}
+\exstep{
+When you get the result, verify that the prediction has not been made for the hidden parts of the profile, and that the JPred reliability scores differ from the prediction made on the full profile.
+
+{\sl Note: you may want to keep this data for use in exercise \ref{viewannotfileex}.}
+}
}
\section{Features and Annotation}
\label{featannot}
-Features and annotations are additional information that is overlaid on the sequences and the alignment. Annotations are properties of the alignment as a whole - as the alignment changes, the annotations will change along with it. Features are properties of the individual sequences. They do not change with the alignment. Annotations are associated with columns in the alignment. Features are associated with specific residues in the sequence.
+Features and annotations are additional information that is overlaid on the sequences and the alignment. Generally speaking, annotations are associated with columns in the alignment. Features are associated with specific residues in the sequence.
+
+Annotations are rendered below the alignment, in the annotation panel, and often reflect properties of the alignment as a whole. The conservation, consensus and quality scores are examples of dynamic annotation. As the alignment changes, these annotations will change along with it. Conversely, features are properties of the individual sequences. They do not change with the alignment, but are shown mapped on to specific residues within the alignment.
+
+Features and annotation can be interactively created, or retrieved from external data sources. DAS (the Distributed Annotation System) is the primary source of sequence features, whilst webservices like JPred (see \ref{jpred} above) can be used to analyse a given sequence or alignment and generate annotation for it.
+
\subsection{Creating sequence features}
Sequence features can be created by simply selecting the area in a sequence (or sequences) to form the feature and selecting {\sl Selection $\Rightarrow$ Create Sequence Feature } from the right-click context menu (Figure \ref{features}). A dialogue box allows the user to customise the feature with respect to name, group, and colour. The feature is then associated with the sequence. Moving the mouse over a residue associated with a feature brings up a tool tip listing all features associated with the residue.
\exstep{Open the alignment at \textsf{http://www.jalview.org/tutorial/alignment.fa}. We know that the Cysteine residues at columns 97, 102, 105 and 135 are involved in iron binding so we will create them as features. Navigate to column 97, sequence 1. Select the entire column by clicking in the ruler bar. Then right-click on the selection to bring up the context menu and select {\sl Selection $\Rightarrow$ Create Sequence Feature}. A dialogue box will appear.
}
\exstep{
-Enter a suitable Sequence Feature Name (e.g. "Iron binding site") in the appropriate box. Click on teh Feature Colour bar to change the colour if desired, add a short description ("One of four Iron binding Cysteines") and press OK. The features will then appear on the sequences.
+Enter a suitable Sequence Feature Name (e.g. "Iron binding site") in the appropriate box. Click on the Feature Colour bar to change the colour if desired, add a short description ("One of four Iron binding Cysteines") and press OK. The features will then appear on the sequences.
}
\exstep{Roll the mouse cursor over the new features. Note that the position given in the tool tip is the residue number, not the column number. To demonstrate that there is one feature per sequence, clear all selections by pressing [ESC] then insert a gap in sequence 3 at position 95. Roll the mouse over the features and you will see that the feature has moved with the sequence. Delete the gap you created.
}
\exstep{
Add a similar feature to column 102. When the feature dialogue box appears, clicking the Sequence Feature Name box brings up a list of previously described features. Using the same Sequence Feature Name allows the features to be grouped.}
-\exstep{Select {\sl View $\Rightarrow$ Feature Settings\ldots} from the alignment window menu. The Sequence Feature Settings window will appear. Move this so that you can see the features you have just created. Click the check box for "Iron binding site" under {\sl Display} and note that display of this feature type is turned off. Click it again and note that the features are now displayed. Close the sequence feature settings box by clicking {\sl OK} or {\sl Cancel}.}
+\exstep{Select {\sl View $\Rightarrow$ Feature Settings\ldots} from the alignment window menu. The Sequence Feature Settings window will appear. Move this so that you can see the features you have just created. Click the check box for "Iron binding site" under {\sl Display} and note that display of this feature type is now turned off. Click it again and note that the features are now displayed. Close the sequence feature settings box by clicking {\sl OK} or {\sl Cancel}.}
}
\subsection{Creating user defined annotation}
}
\exstep{ Select columns 70-77 on the annotation row. Right-click and choose {\sl Sheet} from the context menu. You will be prompted for a label. Enter "B" and press OK. A new line showing the sheet as an arrow appears. The colour of the label can be changed but not the colour of the sheet arrow.
}
+\exstep{Right click on the annotation row that you just created. Select {\sl Export Annotation} and, in the {\bf Export Annotation} dialog box that will open, select the Jalview format and click the [To Textbox] button.
+
+The format for this file is given in the Jalview help. Press [F1] to open it, and find the ``Annotations File Format'' entry in the ``Alignment Annotations'' section of the contents pane. }
+
+\exstep{Export the file to a text editor and edit the file to change the name of the annotation row. Save the file and drag it onto the alignment view.}
+\exstep{Try to add an additional helix somewhere along the row by editing the file and re-importing it.
+{\sl Hint: Use the {\bf Export Annotation} function to view what helix annotation looks like in a jalview annotation file.}}
+\exstep{Use the {\sl Alignment Window $\Rightarrow$ File $\Rightarrow$ Export Annotation..} function to export all the alignment's annotation to a file.}
+\exstep{Open the exported annotation in a text editor, and use the {\bf Annotation File Format} documentation to modify the style of the Conservation, Consensus and Quality annotation rows so they appear as several lines on a single line graph.
+{\sl Hint: You need to change the style of annotation row in the first field of the annotation row entry in the file, and create an annotation row grouping to overlay the three quantitative annotation rows.}
+}
+\exstep{ \label{viewannotfileex} Recover or recreate the secondary structure prediction that you made in exercise \ref{secstrpredex}. Use the {\sl File $\Rightarrow$ Export Annotation} function to view the jnet secondary structure prediction annotation row. Note the {\bf SEQUENCE\_REF} statements surrounding the row specifying the sequence association for the annotation. }
}
-
-\subsection{Importing features from databases}
-Jalview supports feature retrieval from public databases exported via the Distributed Annotation System\footnote{http://www.biodas.org/}. To retrieve features, select {\sl View $\Rightarrow$ Feature Settings\ldots} from the alignment window menu. Select the {\sl DAS Settings} tab in the Feature Settings Window (Figure \ref{das}). A list of DAS sources compiled from the major public DAS registry\footnote{} is shown in the left hand pane. Highlighting an entry on the left brings up information about that source in the right hand panel.
+\section{Importing features from databases}
+
+Jalview supports feature retrieval from public databases either directly or {\sl via} the Distributed Annotation System (DAS\footnote{http://www.biodas.org/}). It includes built in parsers for Uniprot and EMBL records retrieved from the EBI. Sequences retrieved from these sources using the sequence fetcher (see section \ref{fetchseq}) will already posess features.
+
+\subsection{Sequence Database Reference Retrieval}
+\label{fetchdbrefs}
+Jalview maintains a list of external database references for each sequence in an alignment. These are listed in a tooltip when the mouse is moved over the sequence ID. Sequences retrieved using the sequence fetcher will always have at least one database reference, but alignments imported from a file, or retrieved from alignment datasources like PFAM, generally have no database references.
+
+\subsubsection{Database References and Sequence Coordinate Systems}
+
+Jalview displays features in the local sequence's coordinate system which is given by its 'start' and 'end'. Any sequence features on the sequence will be rendered relative to the sequence's start position. If the start/end positions do not match the coordinate system from which the features were defined, then the features will be displayed incorrectly.
+
+\subsubsection{Automatic retrieval of a sequence's database references}
+Jalview includes a function to automatically verify and update each sequence's start and end numbering against any of the sequence databases that the {\sl Sequence Fetcher} has access to. This function is accessed by selecting {\sl Webservices $\Rightarrow$ Fetch DB References} from the Alignment window. When selected, Jalview will use the ID string from each sequence in the alignment or in the currently selected set to retrieve records from the external source. Any sequences that are retrieved are matched against the local sequence, and if the local sequence is found to be a sub-sequence of the retrieved sequence then the local sequence's start/end numbering is updated. A new database reference mapping is created mapping the local sequence to the external database, and the local sequence inherits any additional annotation retrieved from the database sequence.
+
+The database retrieval process terminates when a valid mapping is found for a sequence, or if all database queries failed to retrieve a matching sequence.
+
+\exercise{Retrieving Database References}{
+\exstep{Load the example alignment at http://www.jalview.org/tutorial/alignment.fa}
+\exstep{Move the mouse over the sequence IDs to verify there are no database references for the sequences.}
+\exstep{Use the {\sl Webservices $\Rightarrow$ Fetch DB References} menu option to retrieve database IDs for the sequences.}
+\exstep{Examine the tooltips for each sequence in the alignment as the retrieval progresses - note the appearance of new database references.}
+}
+
+\subsection{Retrieving Features {\sl via} DAS}
+Jalview includes a client to retrieve features from DAS annotation servers. To retrieve features, select {\sl View $\Rightarrow$ Feature Settings\ldots} from the alignment window menu. Select the {\sl DAS Settings} tab in the Feature Settings Window (Figure \ref{das}). A list of DAS sources compiled from the currently configured DAS registry\footnote{By default, this will be the major public DAS server registry maintained by the Sanger Institute: http://www.dasregistry.org} is shown in the left hand pane. Highlighting an entry on the left brings up information about that source in the right hand panel.
\begin{figure}[htbp]
\begin{center}
\includegraphics[width=2.5in]{images/das1.pdf}
\includegraphics[width=2.5in]{images/das2.pdf}
-\caption{{\bf Retrieving DAS annotations.} DAS featrues are retrieved using the {\sl DAS Settings} tab (left) and display customised using the {\sl Feature Settings} tab (right).}
+\caption{{\bf Retrieving DAS annotations.} DAS features are retrieved using the {\sl DAS Settings} tab (left) and their display customised using the {\sl Feature Settings} tab (right).}
\label{das}
\end{center}
\end{figure}
-Select appropriate DAS sources as required then click on {\sl Fetch DAS Features}. This can take some time if a large number of sources is selected and if the alignment contains a large number of sequences. The retrieved features are shown on the sequence and can be customised as described previously.
+Select appropriate DAS sources as required then click on {\sl Fetch DAS Features}. If you know of additional sources not listed in the by the configured registry, then you may add them with the {\sl Add Local Source} button. Use the {\sl Authority},{\sl Type}, and {\sl Label} filters to restrict the list of sources to just those that will return features for the sequences in the alignment.
+
+Following DAS feature retrieval, the {\sl Feature Settings} panel takes on a slightly different appearance (Figure \ref{das} (right)). Each data source is listed and groups of features from one data source can be selected/deselected by checking the labeled box at the top of the panel.
+
+
+\subsubsection{The Fetch Uniprot IDs dialog box}
+\label{discoveruniprotids}
+If any sources are selected which refer to Uniprot coordinates as their reference system, then you may be asked if you wish to retrieve Uniprot IDs for your sequence. Pressing [OK] instructs Jalview to verify the sequences against Uniprot records retrieved using the sequence's ID string. This operates in much the same way as the {\sl Web Services $\Rightarrow$ Fetch Database References } function described in section \ref{fetchdbrefs}. If a sequence is verified, then the start/end numbering will be adjusted to match the Uniprot record to ensure that features retrieved from the DAS source are rendered at the correct position.
+
+\subsubsection{Rate of feature retrieval}
+Feature retrieval can take some time if a large number of sources is selected and if the alignment contains a large number of sequences. This is because Jalview only queries a particular DAS source with one sequence at a time, to avoid overloading it. As features are retrieved, they are immediately added to the current alignment view. The retrieved features are shown on the sequence and can be customised as described previously.
-Following DAS feature retrieval, the {\sl Feature Settings} panel takes on a slightly different appearance (Figure \ref{das} (right)). Each data source is listed and groups of features from one data source ccan be selected/deselected by checking the labeled box at the top of the panel.
\exercise{Retrieving features with DAS}{
\exstep{Load the alignment at \textsf{http://www.jalview.org/tutorial/alignment.fa}. Select {\sl View $\Rightarrow$ Sequence Features\ldots} from the alignment window menu. Select the {\sl DAS Settings} tab. A long list of available DAS sources is listed. Select a small number, eg Uniprot, DSSP, signalP and netoglyc. Click {\sl OK}. A window may prompt whether you wish Jalview to map the sequence IDs onto Uniprot IDs. Click {\sl Yes}. Jalview will start retrieving features. As features become available they will be mapped onto the alignment.
}
\exstep{If Jalview is taking too long to retrieve features, the process can be cancelled with the {\sl Cancel Fetch} button. Rolling the mouse cursor over the sequences reveals a large number of features annotated in the tool tip. Close the Feature Settings window.
}
+\exstep{Move the mouse over the sequence ID panel. Non-positional features such as literature references and protein localisation predictions are given in the tooltip, below any database cross references associated with the sequence.}
+\exstep{Search through the alignment to find a feature with a link symbol next to it. Right click to bring up the alignment view popup menu, and find a corresponding entry in the {\sl Link } sub menu. }
+% TODO this doesn't work ! \includegraphics[width=.3in]{images/link.pdf}
+
\exstep{
Select {\sl View $\Rightarrow$ Feature Settings\ldots} to reopen the Feature Settings window. All the loaded feature types should now be displayed. Those at the top of the list sit on top of and obscure those below. Move the feature settings window so that the alignment is visible and uncheck some of the feature types by clicking the tick box in the display column.. Observe how the alignment display changes. Note that unselected feature types do not appear in the tool tip.
}
\exstep{Reorder the features by dragging feature types up and down the order in the Feature Settings panel. e.g. Click on {\sl CHAIN} then move the mouse downwards to drag it below {\sl DOMAIN}. Note that {\sl DOMAIN} is now shown on top of {\sl CHAIN} in the alignment window. Drag {\sl METAL} to the top of the list. Observe how the cysteine residues are now highlighted as they have a {\sl METAL} feature associated with them.
}
+\exstep{Press the {\sl Optimise Order} button. The features will be ordered according to increasing length, placing features that annotate shorter regions of sequence higher on the display stack.}
+
+\exstep{Select {\sl File $\Rightarrow$ Export Features} from the Alignment window. You can choose to export the retrieved features as a GFF file, or Jalview's own Features format.
+% TODO: describe working with features files and GFF
}
+}
+\subsection{Sequence Feature File Formats}
+
+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 simple 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.
+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}
-\includegraphics[width=3in]{images/auto2.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 $<$Sequence ID$>$ $\Rightarrow$ View PDB entry: $<$PDB ID$>$}. A viewer window will open with the alpha carbon chain(s) of the structure shown (Figure \ref{structure}). 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 and shows a label on the structure (Figure \ref{structure} (right)).
+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}
-\includegraphics[width=2.5in]{images/structure1.pdf}
-\includegraphics[width=2.5in]{images/structure2.pdf}
-\caption{{\bf Structure visualisation} The structure viewer is launched from the sequence ID context menu (left) and allows the structure to be visualised as a rotatable and zoomable alpha carbon trace (right). }
+\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{Customisng 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 and display parameters such as depth cueing and Z-buffering by selecting the appropriate option from the {\sl View} menu.
+\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.
-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.
\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.
+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 the alpha carbon 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{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.}
}
-\chapter{Advanced Jalview}
-\section{Customising Jalview}
-\subsection{Setting preferences}
-\section{The Jalview Interface}
-\subsection{Multiple views}
-\subsection{Keyboard Editing Mode}
-\section{Regions}
-\subsection{Locked Editing}
-\subsection{Alignments including hidden regions}
-\subsection{Secondary Structure predictions}
-\section{Features and Annotations}
-
-\subsection{Annotation display}
-\subsubsection{Altering annotation row height}
-\subsection{Annotation files}
-\subsection{Feature files}
-\subsection{Moving sequence associated annotation}
-\subsection{Propagating features}
-\section{Structures}
-\subsection{Working with Modeller files}
-\subsection{Using local PDB files}
-\section{Pairwise alignments}
-\r \end{document}\r
+\section{Working with DNA}
+\label{workingwithnuc}
+Jalview was originally developed for the analysis of protein sequences, but now includes some specific features for working with nucleic acid sequences and alignments. Nucleotide sequences and alignments are recognised based on the presence the nucleotide symbols [ACGT] of greater than 85\% in the sequences. Built in codon-translation tables can be used to translate ORFs into peptides for further analysis. EMBL records retrieved {\sl via} the sequence fetcher (see section \ref{fetchseq}) are also parsed in order to identify codon regions and extract peptide products.
+Furthermore, Jalview records mappings between protein sequences that are derived from regions of a nucleotide sequence. Mappings are used to to transfer annotation between nucleic acid and protein sequences, and to dynamically highlight regions in one sequence that correspond to the position of the mouse pointer in another.
+
+\subsection{Alignment and Colouring}
+
+Jalview provides a simple colourscheme for DNA bases, but does not apply any specific conservation or substitution score model for the shading of nucleotide alignments. However, pairwise alignments performed using the {\sl Alignment Window $\Rightarrow$ Calculations $\Rightarrow$ Pairwise Alignment \ldots} option will utilise an identity score matrix to calculate alignment score when alignment two nucleotide sequences.
+
+\subsubsection{Aligning Nucleic Acid Sequences}
+
+Jalview only has limited knowledge of the capabilities of the programs that are made available to it {\sl via} web services. In particular, only the ClustalW and MAFFT programs will successfuly recognise and align nucleic acid sequences. MAFFT will also choose an appropriate parameter model. Whilst Muscle may appear to align DNA, it simply treats the base symbols as amino-acids, often leading to a poor quality alignment. Furthermore, it will almost certainly fail to align RNA containing Uracil bases, since 'U' is not a valid one-letter amino acid code.
+
+\subsection{Translate cDNA}
+
+The {\sl Calculations $\Leftarrow$ Translate cDNA} function in the alignment window is only available when working with a nucleic acid alignment. It uses the standard codon translation table given in the online help to translate a nucleotide alignment, or the currently selected region, into a set of aligned peptide sequences. Any features or annotation present on the nucleotide alignment will also be translated, allowing DNA alignment analysis results to be transferred on to peptide products for further investigation.
+
+\subsection{Linked DNA and Protein Views}
+
+\parbox{3.5in}{
+Views of alignments involving DNA sequences are linked to views of alignments containing their peptide products in a similar way to views of protein sequences and views of their associated structures. Peptides translated from cDNA and extracted from EMBL records for DNA contigs are linked to their 'parent' coding regions. Mousing over a region of the peptide highlights codons in views showing the original coding region.
+}\parbox{3in}{
+\begin{center}
+%\begin{figure}[htbp]
+
+\includegraphics[width=2.8in]{images/cdnatranslinkedwin.pdf}
+
+%\caption{{\bf Linked DNA and Protein Views.} }
+%\end{figure}
+\end{center}
+}
+
+
+\subsection{Coding regions from EMBL records}
+
+Many EMBL records that can be retrieved from the sequence fetcher contain exons. Coding regions will be marked as features on the EMBL nucleotide sequence, and Uniprot database cross references will be listed in the tooltip displayed when the mouse hovers over the sequence ID. Uniprot database cross references extracted from EMBL records are sequence cross references, and associate a Uniprot sequence's coordinate system with the coding regions annotated on the EMBL sequence. Jalview utilises cross-reference information in two ways.
+\subsubsection{Retrieval of Protein or DNA Cross References}
+The {\sl Calculations $\Rightarrow$ Get Cross References } function is only available when Jalview recognises that there are protein/DNA cross-references present on sequences in the alignment. When selected, it retrieves the cross references from the alignment's dataset (a set of sequence and annotation metadata shared between alignments) or using the sequence database fetcher. This function can be used for EMBL sequences containing coding regions to open the Uniprot protein products in a new alignment window. The new alignment window that is opened to show the protein products will also allow dynamic highlighting of codon positions in the EMBL record for each residue in the product(s).
+
+\subsubsection{Retrieval of protein DAS features on coding regions}
+
+The Uniprot cross-references derived from EMBL records can be used by Jalview to visualize protein sequence features directly on nucleotide alignments. This is because the database cross references include the sequence coordinate mapping information to correspond regions on the protein sequence with that of the nucleotide contig. Jalview will use the Uniprot accessions associated with the sequence to retrieve features, and then map them onto the nucleotide sequence's coordinate system using the coding region location.
+
+\begin{figure}[htbp]
+\begin{center}
+\label{dnadasfeatures}
+\includegraphics[width=5in]{images/dnadasfeatures.pdf}
+
+\caption{Uniprot and PDB sum features retrieved {\sl via} DAS and mapped onto coding regions of EMBL record V00488}
+
+\end{center}
+\end{figure}
+
+\exercise{Visualizing protein features on coding regions}
+{
+\exstep{Use the sequence fetcher to retrieve EMBL record V00488.}
+\exstep{Ensure that {\sl View $\Rightarrow$ Show Sequence Features} is checked and change the alignment view format to Wrapped mode so the distinct exons can be seen.}
+\exstep{Open the DAS sequence feature fetcher window and fetch features for V00488 the Uniprot reference server, and any additional servers that work with the Uniprot coordinate system.}
+\exstep{Mouse over the features retrieved, note that they have been mapped onto the coding regions, and in some cases broken into several parts to cover the distinct exons.}
+\exstep{Open a new alignment view containing the Uniprot protein product with {\sl Calculations $\Rightarrow$ Get Cross References $\Rightarrow$ Uniprot } and examine the database references and sequence features. Experiment with the interactive highlighting of codon position for each residue.
+}
+}
+
+% \chapter{Advanced Jalview}
+%
+% \section{Customising Jalview}
+% \subsection{Setting preferences}
+%
+% The Jalview Desktop stores configuration and history information in a file stored in the users home directory, called '.jalview\_properties'. Many of the options stored in this file are presented in the {\sl Desktop $\Rightarrow$ Tools $\Rightarrow$ Preferences\ldots} dialog. These preferences include default settings for : {\bf Visual} layout settings for alignment views and controlling the display of the default alignment, {\bf Connection} preferences such as the standard set of URL paths that are available from the links menu and the URL which is opened when a Sequence's ID is double clicked, {\bf Editing} settings like {\sl Pad Gaps} and autocalculation of consensus, {\bf Output} settings control the degree of meta-information written in alignment files and mode of EPS figure generation, and finally the {\bf Das Settings} which allows the default DAS sources to be configured.
+%
+% \subsection{Adding your own URL links}
+%
+% \subsection{Working with Databases and Database Cross References}
+% \label{getcrossrefs}
+%
+% {\sl Calculations $\Rightarrow$ Get Cross References }
+%
+% \section{Jalview IO Interface}
+% \subsection{Multiple views}
+% \subsection{Annotation files}
+% \subsection{Feature files}
+% \subsection{Moving sequence associated annotation}
+% \subsection{Propagating features}
+% \section{Structures}
+% \subsection{Working with Modeller files}
+% \subsection{Using local PDB files}
+% \section{Pairwise alignments}
+\r \end{document}