+
+\section{Working with RNA}
+Jalview allows the creation of RNA secondary structure annotation, and includes
+the VARNA secondary structure viewer for the display of RNA base pair diagrams.
+It also allows the extraction of RNA secondary structure from 3D data when
+available.
+
+\subsection{Performing RNA Secondary Structure Predictions}
+Secondary structure consensus calculations can be performed by enabling the
+VIENNA service {\sl via} the {\sl Web Service $\Rightarrow$ Secondary
+Structure} menu. These consensus structures are created by analysing the
+covariation patterns in all visible sequences on the alignment. For more
+information see the VIENNA documentation.
+
+\begin{figure}[htbp]
+\begin{center}
+\label{rnaviennaservice}
+\includegraphics[width=5in]{images/rnaViennaServiceWindow.pdf}
+
+\caption{Secondary structure consensus calculations can be performed by enabling the
+VIENNA service {\sl via} the {\sl Web Service $\Rightarrow$ Secondary
+Structure} menu.}
+
+\end{center}
+\end{figure}
+
+\begin{figure}[htbp]
+\begin{center}
+\label{rnaviennaaltpairs}
+\includegraphics[width=5in]{images/rnaViennaAlternateProbs.pdf}
+
+\caption{VIENNA can calculate alternate RNA base pairing probabilities. These
+are shown in Jalview as tool-tips on the RNA secondary structure probability
+score.}
+
+\end{center}
+\end{figure}
+
+
+\exercise{Viewing RNA Structures}
+{ \label{viewingrnaex}
+
+\exstep{Import RF00162 from the Rfam (Seed) source using {\sl Fetch sequence(s)}
+from the Desktop's File menu.}
+
+\exstep{Select {\sl Colour by RNA Helices} to
+shade the alignment by the secondary structure annotation provided by Rfam.}
+
+\exstep{Open VARNA with {\sl Structure $\Rightarrow$ View Structure
+$\Rightarrow$ RNA Secondary Structure}.
+In the VARNA Structures Manager toggle between (i) secondary structure
+(alignment) (with gaps) and (ii) trimmed secondary structure (alignment).
+Explore the difference between trimmed and untrimmed views.
+Click on different residues in the VARNA diagram - you should also see them
+highlighted and selected in the sequence alignment window.}
+
+\exstep{In the VARNA Structures Manager, right click on display window to
+bring up the pop up context menu. Explore the options within the File, Export,
+Display and Edit sections.
+
+{\em VARNA views are stored in Jalview project files, in the same way as 3D
+structure views produced by Jmol and Chimera.}}
+
+\exstep{Enable the calculation and display of an RNAAliFold secondary structure
+prediction for the alignment by selecting {\sl Web Service $\Rightarrow$ Secondary
+Structure Prediction $\Rightarrow$ RNAAliFold }.}
+% Compare this with the annotationline provided by Rfam.
+
+\exstep{Edit the RNAAliFold calculation settings to show
+Base Pair probabilities. Explore how editing the alignment affects the consensus
+calculation.}
+
+\exstep{Import 2GIS from the PDB database into a new window with {\sl Fetch
+sequence(s)}.}
+
+\exstep{Click on a sequence in Sequence ID panel and select {\sl Structure
+$\Rightarrow$ View Structure $\Rightarrow$ 2GIS}, to view the structure in Jmol
+window. Click on different residues and located them in the sequence alignment window.}
+
+%\exstep{Add and link a Jmol structure view
+%for Bacillus\_amyloliquef.9 for 3NPB (from the PDB). Display the secondary
+%structure along-side the consensus structure for the alignment by adding
+%reference annotation from the 3D structure.
+
+%{\sl Hint: You need to make sure the RNAview service is enabled in your {\sl
+%Structure} preferences to obtain RNA secondary structure annotation from PDB
+%files.}}
+
+ }
+
+\chapter{Webservices}
+
+\section{What are Web Services ?}
+
+\label{jvwebservices}
+The term ``Webservices'' refers to a variety of data exchange
+mechanisms based on HTTP.\footnote{HTTP: Hyper-Text Transfer Protocol.}
+
+\parbox[c]{4.5in}{Jalview can exploit public webservices to access databases
+remotely, and also submit data to public services by opening pages with your web browser. These types of
+services are `one-way', {\sl i.e.} data is either sent to the webservice or
+retrieved from it by Jalview. The desktop application can also interact
+with `two-way' remote analysis services in order to offload computationally
+intensive tasks to High Performance Computing facilities. Most of these two-way
+services are provided by {\bf Ja}va {\bf B}ioinformatics {\bf A}nalysis {\bf
+W}eb {\bf S}ervice (JABAWS) servers\footnote{See
+http://www.compbio.dundee.ac.uk/jabaws for more information and to download
+your own server.}, which provides an easily installable system for performing
+a range of bioinformatics analysis tasks. }
+\parbox[c]{1.75in}{\includegraphics[width=1.65in]{images/wsmenu.pdf}}
+
+\subsection{One-Way Web Services}
+
+There are two types of one way service in Jalview. Database services,
+which were introduced in in Section \ref{fetchseq}, provide sequence and
+alignment data. They can also be used to add sequence IDs to an alignment
+imported from a local file, prior to further annotation retrieval, as described
+in Section \ref{featuresfromdb}.
+% The final type of one way service are sequence
+% and ID submission services.
+% exemplified by the `Envision2 Services' provided
+% by the ENFIN Consortium\footnote{ENFIN is the European Network for Functional
+% INtegration. Please see http://www.enfin.org for more information. }.
+
+% \subsubsection{One-way submission services}
+% Jalview can use the system's web browser to submit sets of sequences and
+% sequence IDs to web based applications. Single sequence IDs can be passed to
+% a web site using the user definable URL links listed under the {\sl
+% Links} submenu of the sequence ID popup menu. These are configured
+% in the {\sl Connections} tab of the {\sl Preferences} dialog box.
+%
+% The Envision 2 services presented in the webservice menu provides are the first
+% example of one-way services where multiple sequences or sequence IDs can be
+% sent. The {\sl Web service $\Rightarrow$ Envision 2 Services} menu entry
+% provides two sub-menus that enable you to submit the sequences or IDs
+% associated with the alignment or just the currently selected sequences to one
+% of the Envision2 workflows. Selecting any one will open a new browser window on
+% the Envision2 web application. The menu entries and their tooltips provide
+% details of the Envision2 workflow and the dataset set that will be submitted
+% ({\sl i.e.} the database reference type, or associated sequence subset). Please
+% note, due to technical limitations, Jalview can currently only submit small
+% numbers of sequences to the workflows - if no sequence or ID submissions are
+% presented in the submenus, then try to select a smaller number of sequences to
+% submit.
+
+\subsection{Remote Analysis Web Services}
+Remote analysis services enable Jalview to use external computational
+facilities. There are currently three types of service - multiple sequence
+alignment, protein secondary structure prediction, and alignment analysis.
+Many of these are provided by JABA servers, which are described at the end of
+this section. In all cases, Jalview will construct a job based on the alignment
+or currently selected sequences, 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.
+
+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.
+
+
+\section{JABA Web Services for Sequence Alignment and Analysis}
+\label{jabaservices}
+JABA stands for ``JAva Bioinformatics Analysis'', which is a system developed
+by Peter Troshin and Geoff Barton at the University of Dundee for running
+computationally intensive bioinformatics analysis programs. A JABA installation
+typically provides a range of JABA web services (JABAWS) for use by other
+programs, such as Jalview.
+
+Exercises in the remainder of this section will demonstrate the simplest way of
+installing JABA on your computer, and configuring Jalview so it can access the JABA services. If you
+need any further help or more information about the services, please go to the
+\href{http://www.compbio.dundee.ac.uk/jabaws}{JABAWS home page}.
+%% \subsubsection{Aims}
+%% \begin{list}{$\bullet$}{}
+%% \item Gain experience using the different alignment services provided by
+% JABA
+%%\item Learn about the way that Jalview stores user presets for JABA services
+%%\item Learn how to install JABA services and configure Jalview to access them
+%%\end{list}
+
+\subsection{Changing the Web Services Menu Layout}
+\label{changewsmenulayout}
+If you are working with a lot of different JABA services, you may wish to change
+the way Jalview lays out the web services menu. You can do this from the Web
+Services tab of the {\sl Preferences} dialog box.
+
+\exercise{Changing the Layout of the Web Services Menu}{
+\label{changewsmenulayoutex}
+\exstep{Make sure you have loaded an alignment into Jalview, and examine the
+current layout of the alignment window's {\sl Web Service} menu.}
+\exstep{Open the preferences dialog box and select the web services tab.}
+\exstep{Ensure the {\sl Enable JABAWS services} checkbox is selected, and unselect
+the {\sl Enable Enfin Services} checkboxes.}
+\exstep{Hit {\sl Refresh Services} to update the web services menu -- once the
+progress bar has completed, open the {\sl Web Service} menu to view the changes.}
+\exstep{Select the {\sl Index by host} checkbox and refresh the services once again.
+
+{\sl Observe the way the layout of the JABAWS Alignment submenu changes.}
+}
+\exstep{Do the same with the {\sl Index by type} checkbox.}
+}
+
+Jalview provides these options for configuring the layout of the {\sl Web Service}
+menu because different Jalview users may have access to a different number of
+JABA services, and each will have their own preference regarding the layout of
+the menu.
+
+\begin{figure}[htbc]
+\begin{center}
+\includegraphics[width=3in]{images/jvjabawsconfig.pdf}
+\caption{{\bf The Jalview Web Services preferences panel.} Options are provided
+for configuring the list of JABA servers that Jalview will use, enabling and
+disabling Enfin services, and configuring the layout of the web services
+menu.}
+\label{jvjabawsconfig}
+\end{center}
+\end{figure}
+
+
+\subsubsection{Testing JABA services}
+The JABAWS configuration dialog shown in Figure \ref{jvjabawsconfig} has colour
+codes to indicate whether the Desktop can access the server, and whether all
+services advertised by the server are functional. The colour codes are:
+
+\begin{list}{$\bullet$}{}
+ \item Red - Server cannot be contacted or reports a connection error.
+ \item Amber - Jalview can connect, but one or more services are non-functional.
+ \item Green - Server is functioning normally.
+\end{list}
+ %TODO green and a tick, red and a cros, amber and a value indicating whether its all going
+
+Test results from JABAWS are reported on Jalview's console output (opened from
+the Tools menu). Tests are re-run every time Jalview starts, and when the
+[Refresh Services] button is pressed on the Jalview JABAWS configuration panel.
+
+\subsubsection{Resetting the JABA Services Setting to their Defaults}
+Once you have configured a JABAWS server and selected the OK button of the
+preferences menu, the settings will be stored in your Jalview preferences file,
+along with any preferences regarding the layout of the web services menu. If
+you should ever need to reset the JABAWS server list to its defaults, use the
+`Reset Services' button on the Web Services preferences panel.
+
+\subsection{Running your own JABA Server}
+You can download and run JABA on your own machine using the `VMWare' or
+VirtualBox virtual machine environments. If you would like to do
+this, there are full instructions at the
+\href{http://www.compbio.dundee.ac.uk/jabaws/}{JABA web site}.
+
+\exercise{Installing a JABA Virtual Machine on your Computer}{
+\label{jabawsvmex}{\sl This tutorial will demonstrate the simplest way of
+installing JABA on your computer, and configuring Jalview so it can access the JABA services.
+
+{\bf Prerequisites}
+
+You will need a copy of VMWare Player/Workstation/Fusion on your machine.
+}
+
+\exstep{If you do not have VMWare player installed, download it from
+www.vmware.com (this takes a few minutes -- you will need to register and wait
+for an email with a download link).}
+\exstep{Download the JABA virtual appliance archive called `jaba-vm.zip' from
+\textsf{http://www.compbio.dundee.ac.uk/jabaws/archive/jabaws-vm.zip}
+
+WARNING: This is large (about 300MB) and will take some time to download.
+}
+\exstep{Unpack the archive's contents to a place on your machine with at least
+2GB of free space (On Windows, right click on the archive, and use the 'Extract
+archive..' option).
+}
+\exstep{Open the newly extracted directory and double click the VMWare virtual
+machine configuration file (jabaws.vcf). This will launch the VMWare player.
+}
+\exstep{Once VMWare player has started up, it may ask the question ``Did you move or copy
+this virtual appliance?'' -- select `Copy'.}
+\exstep{You may be prompted to download the VMWare linux tools. These are not
+necessary, so close the window or click on `Later'.}
+\exstep{You may also be prompted to install support for one or more devices (USB
+or otherwise). Say `No' to these options.}
+\exstep{Once the machine has loaded, it will display a series of IP addresses
+for the different services provided by the VM. Make a note of the JABAWS URL --
+this will begin with `http:' and end with `/jabaws''.}
+}
+
+\exercise{Configuring Jalview to Access your new JABAWS Virtual Appliance}{
+\label{confnewjabawsappl}
+\exstep{Start Jalview (If you have not done so already).}
+\exstep{Enable the Jalview Java Console by selecting its option from the Tools
+menu.
+
+{\sl Alternately, use the System Java console if you have
+configured it to open when Jalview is launched, {\sl via} your system's Java
+preferences (under the `Advanced' tab on Windows).}}
+\exstep{Open the {\sl Preferences} dialog and locate the Web Services tab.}
+\exstep{Add the URL for the new JABAWS server you started in Exercise
+\ref{jabawsvmex} to the list of JABAWS urls using the `New Service
+URL' button.}
+\exstep{You will be asked if you want to test the service. Hit `Yes' to do this
+-- you should then see some output in the console window.
+
+{\sl Take a close look at the output in the console. What do you think is
+happening?}
+}
+\exstep{Hit OK to save your preferences -- you have now added a new JABA
+service to Jalview!}
+\exstep{Try out your new JABA services by loading the ferredoxin sequences from
+http://www.jalview.org/tutorial/alignment.fa}
+\exstep{Launch an alignment using one
+of the JABA methods provided by your server. It will be listed under the JABAWS Alignment submenu of the {\sl Web Service} menu on the alignment window.
+
+{\sl Note: You can watch the JABA VM appliance's process working by opening the
+process monitor on your system. (On Windows XP, this involves right-clicking the
+system clock and opening the task manager -- then selecting the 'Processes' tab
+and sort by CPU).}
+}
+}
+
+\end{document}