Merge branch 'features/JAL-2360colourSchemeApplicability' into
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 5 Jan 2017 13:45:13 +0000 (13:45 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 5 Jan 2017 13:45:13 +0000 (13:45 +0000)
features/JAL-2371collectionColourScheme

Conflicts:
src/jalview/appletgui/APopupMenu.java

19 files changed:
examples/appletDeployment.html
examples/appletParameters.html
examples/applets.html
help/help.jhm
help/helpTOC.xml
help/html/calculations/referenceseq.html
help/html/menus/alignmentMenu.html
help/html/menus/wsmenu.html
help/html/webServices/jnet.html
resources/lang/Messages.properties
resources/lang/Messages_es.properties
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/AlignFrame.java
src/jalview/bin/JalviewLite.java
src/jalview/gui/PopupMenu.java
src/jalview/ws/jws1/Discoverer.java
src/jalview/ws/jws1/JPredClient.java
src/jalview/ws/sifts/SiftsClient.java
test/jalview/ws/sifts/SiftsClientTest.java

index 7b4daee..e9c22e5 100644 (file)
        <tr>
                <td><strong>2.1</strong></td>
                <td><ul>
-          <li>Jalview Applet can read and display JNet secondary structure annotation 
+          <li>Jalview Applet can read and display JPred secondary structure annotation 
             directly via the <strong>jnetfile</strong> parameter. <br>
           </li>
           <li>Param &quot;UserDefinedColour&quot; - specify your own colours for each residue using a semi colon 
index 6ead5e6..7959c3a 100644 (file)
@@ -91,8 +91,9 @@ the applet can be interacted with <em>via</em> its
             <td>jnetfile</td>
             <td>fileName</td>
             <td>Secondary structure predictions from a <a
-            href="http://www.compbio.dundee.ac.uk/~www-jpred/">Jnet</a> Concise 
-              file will be added to the first sequence in the alignment.</td>
+            href="http://www.compbio.dundee.ac.uk/~www-jpred/">JPred</a> Concise 
+              file will be added to the first sequence in the alignment.<br/>
+              <em>jpredfile</em> can be used interchangeably with this parameter.</td>
           </tr>
           <tr> 
             <td>PDBfile(x)</td>
index d997f14..b789672 100644 (file)
@@ -136,7 +136,7 @@ Try out JalviewLite by pressing one of the buttons below.
 </applet>
                                                       </td>
       <td valign="middle">Displays a Multiple Sequence Alignment
-       Based JNet Prediction for a Sequence</td>
+       Based JPred Prediction for a Sequence</td>
     </tr>
   </table>
   <p>
index e034fc2..f69ed00 100755 (executable)
@@ -33,7 +33,7 @@
    <mapID target="wsparams" url="html/webServices/webServicesParams.html"/>
    <mapID target="wsprefs" url="html/webServices/webServicesPrefs.html"/>
    <mapID target="msaservice" url="html/webServices/msaclient.html"/>
-   <mapID target="jnet" url="html/webServices/jnet.html"/>
+   <mapID target="jpred" url="html/webServices/jnet.html"/>
    <mapID target="shmrws" url="html/webServices/shmr.html"/>
    <mapID target="newsreader" url="html/webServices/newsreader.html"/>
    <mapID target="disorder" url="html/webServices/proteinDisorder.html"/>
index 3a6b0b3..54abd53 100755 (executable)
@@ -70,7 +70,7 @@
                        <tocitem text="Sequence Alignment" target="msaservice"  expand="false">
                                <tocitem text="Multiple Alignment Subjobs" target="msaservice" />
                        </tocitem>
-                       <tocitem text="Secondary Structure Prediction" target="jnet" />
+                       <tocitem text="Secondary Structure Prediction" target="jpred" />
                        <tocitem text="RNAalifold RNA Secondary Structure Prediction" target="rnaalifold" />
                        <tocitem text="Protein Disorder Prediction" target="disorder" />
                        <tocitem text="Alignment Conservation Analysis" target="aacon" />
index a79541b..7c0e3dc 100644 (file)
@@ -58,7 +58,7 @@
     <li><strong>Defining a reference when importing
         annotation</strong><br />Jalview automatically assigns a reference
       sequence when importing analysis results, such as those returned
-      from <a href="../webServices/jnet.html">JPred4</a> . A reference
+      from <a href="../webServices/jnet.html">JPred</a> . A reference
       sequence can also be assigned via the <a
       href="../features/annotationsFormat.html#refsandviews">SET_REF</a>
       command in an alignment annotation file.</li>
index 167cb25..51ad601 100755 (executable)
         <ul>
           <li><strong>JPred Secondary Structure Prediction</strong><br>
             <em>Secondary structure prediction by network
-              consensus. See the <a href="../webServices/jnet.html">Jpred3</a>
+              consensus. See the <a href="../webServices/jnet.html">Jpred</a>
               client entry for more information. The behaviour of this
               calculation depends on the current selection:
               <ul>
                 <li>If nothing is selected, and the displayed
-                  sequences appear to be aligned, then a JNet prediction
+                  sequences appear to be aligned, then a JPred prediction
                   will be run for the first sequence in the alignment,
                   using the current alignment. Otherwise the first
                   sequence will be submitted for prediction.</li>
                 <li>If just one sequence (or a region on one
                   sequence) has been selected, it will be submitted to
-                  the automatic JNet prediction server for homolog
+                  the automatic JPred prediction server for homolog
                   detection and prediction.</li>
                 <li>If a set of sequences are selected, and they
                   appear to be aligned, then the alignment will be used
-                  for a Jnet prediction on the <strong>first</strong>
+                  for a JPred prediction on the <strong>first</strong>
                   sequence in the set (that is, the one that appears
                   first in the alignment window).
                 </li>
index 33282e9..b71bc1a 100755 (executable)
       <ul>
         <li><strong>JPred Secondary Structure Prediction</strong><br>
           <em>Secondary structure prediction by network consensus.
-            See the <a href="../webServices/jnet.html">Jpred3</a> client
+            See the <a href="../webServices/jnet.html">Jpred</a> client
             entry for more information. The behaviour of this
             calculation depends on the current selection:
             <ul>
               <li>If nothing is selected, and the displayed
-                sequences appear to be aligned, then a JNet prediction
+                sequences appear to be aligned, then a JPred prediction
                 will be run for the first sequence in the alignment,
                 using the current alignment. Otherwise the first
                 sequence will be submitted for prediction.</li>
               <li>If just one sequence (or a region on one
                 sequence) has been selected, it will be submitted to the
-                automatic JNet prediction server for homolog detection
+                automatic JPred prediction server for homolog detection
                 and prediction.</li>
               <li>If a set of sequences are selected, and they
                 appear to be aligned, then the alignment will be used
-                for a Jnet prediction on the <strong>first</strong>
+                for a JPred prediction on the <strong>first</strong>
                 sequence in the set (that is, the one that appears first
                 in the alignment window).
               </li>
index 396a3a7..077ace6 100755 (executable)
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  -->
 <head>
-<title>JNet Secondary Structure Prediction</title>
+<title>JPred Secondary Structure Prediction</title>
 </head>
 <body>
-  <strong>JNet Secondary Structure Prediction</strong>
+  <strong>JPred Secondary Structure Prediction</strong>
   <p>
     Secondary structure prediction methods attempts to infer the likely
     secondary structure for a protein based on its amino acid
   </p>
   The function available from the
   <strong>Web Service&#8594;Secondary Structure
-    Prediction&#8594;JNet Secondary Structure Prediction</strong> menu does two
+    Prediction&#8594;JPred Secondary Structure Prediction</strong> menu does two
   different kinds of prediction, dependent upon the currently selected
   region:
   </p>
   <ul>
     <li>If nothing is selected, and the displayed sequences appear
-      to be aligned, then a JNet prediction will be run for the first
+      to be aligned, then a JPred prediction will be run for the first
       sequence in the alignment, using the current alignment. Otherwise
       the first sequence will be submitted for prediction.</li>
     <li>If just one sequence (or a region on one sequence) has been
-      selected, it will be submitted to the automatic JNet prediction
+      selected, it will be submitted to the automatic JPred prediction
       server for homolog detection and prediction.</li>
     <li>If a set of sequences are selected, and they appear to be
-      aligned, then the alignment will be used for a Jnet prediction on
+      aligned, then the alignment will be used for a JPred prediction on
       the <strong>first</strong> sequence selected in the set (that is,
       the one nearest the top of the alignment window).
     </li>
   </ul>
   <p>
-    <strong>Note</strong>: JNet secondary structure prediction is a
+    <strong>Note</strong>: JPred secondary structure prediction is a
     'non-column-separable' service - predictions are based on the
     sequence profile of contiguous stretches of amino-acid sequence. A
     prediction will only be made on the visible parts of a sequence (see
     <a href="../features/hiddenRegions.html">hiding columns</a>) as if
     it were a contiguous polypeptide chain. Prediction accuracy at the
     hidden column boundaries may therefore be less than indicated by
-    JNet's own reliability score (see below).
+    JPred's own reliability score (see below).
   </p>
-  <p>The result of a JNet prediction for a sequence is a new
+  <p>The result of a JPred prediction for a sequence is a new
     annotated alignment window:</p>
   <img src="jnetprediction.gif">
   <p>The sequence for which the prediction was made is the first one
         significantly different primary predictions.</em></li>
   </ul>
   </p>
-  <em>JNet annotation created in Jalview 2.8.2 and later versions
+  <em>JPred annotation created in Jalview 2.8.2 and later versions
     can be displayed on other alignments via the <a
     href="../features/annotation.html#seqannots">Add reference
       annotation</a> Sequence ID popup menu option.
   </em>
-  <em>As of Jalview 2.6, the Jnet service accessed accessed via the
+  <em>As of Jalview 2.6, the JPred service accessed accessed via the
     'Secondary structure prediction' submenu should be considered a
     legacy Jalview SOAP service, and will be replaced in the near future
     by a JPred4 Rest service.</em>
index 5f47d2c..296a23f 100644 (file)
@@ -835,7 +835,7 @@ label.colour_by = Colour by...
 label.muscle_multiple_protein_sequence_alignment = Muscle Multiple Protein Sequence Alignment
 label.mafft_multiple_sequence_alignment = MAFFT Multiple Sequence Alignment
 label.clustalw_multiple_sequence_alignment = ClustalW Multiple Sequence Alignment
-label.jnet_secondary_structure_prediction = JNet Secondary Structure Prediction
+label.jnet_secondary_structure_prediction = JPred Secondary Structure Prediction
 label.multiharmony = Multi-Harmony
 label.unable_start_web_service_analysis = Unable to start web service analysis
 label.job_couldnt_be_started_check_input = The Job couldn't be started. Please check your input, and the Jalview console for any warning messages.
@@ -968,7 +968,7 @@ error.cannot_have_zero_length_vector_replacement_strings = Cannot have zero leng
 error.implementation_error_multiple_single_sequence_prediction_jobs_not_supported = Implementation Error! Multiple single sequence prediction jobs are not yet supported
 error.implementation_error_invalid_msa_index_for_job =Implementation Error! Invalid msaIndex for JPredJob on parent MSA input object!
 error.implementation_error_startjob_called = Implementation error - StartJob(JpredJob) called on {0}
-error.multiple_jnet_subjob_merge_not_implemented = Multiple JNet subjob merging not yet implemented
+error.multiple_jnet_subjob_merge_not_implemented = Multiple JPred subjob merging not yet implemented
 label.job_never_ran = Job never ran - input returned to user.
 error.implementation_error_minlen_must_be_greater_zero = Implementation error: minlen must be zero or more
 error.implementation_error_msawbjob_called = Implementation error - StartJob(MsaWSJob) called on a WSJobInstance {0}
@@ -1074,7 +1074,7 @@ exception.unexpected_handling_rnaml_translation_for_pdb = Unexpected exception w
 exception.couldnt_recover_sequence_properties_for_alignment = Couldn't recover sequence properties for alignment
 exception.unknown_format_for_file = Unknown format {0} for file \: \n{1}
 label.remove_gaps = Remove Gaps
-exception.couldnt_recover_sequence_props_for_jnet_query = Couldn't recover sequence properties for JNet Query sequence!
+exception.couldnt_recover_sequence_props_for_jnet_query = Couldn't recover sequence properties for JPred Query sequence!
 exception.server_timeout_try_later = Server timed out - try again later\n
 exception.web_service_returned_null_try_later= Server at {0} returned null object, it probably cannot be contacted. Try again later.
 exception.cannot_contact_service_endpoint_at = Cannot contact service endpoint at {0}
@@ -1096,7 +1096,7 @@ info.job_couldnt_be_run_exceeded_hard_limit = Job could not be run because it ex
 info.job_couldnt_be_run_incorrect_param_setting = Job could not be run because some of the parameter settings are not supported by the server.\n{0}\nPlease check to make sure you have used the correct parameter set for this service\!\n
 info.no_jobs_ran = No jobs ran
 info.failed_to_submit_prediction = Failed to submit the prediction\:\n{0} {1}
-info.invalid_jnet_job_result_data ={0}\n{1}\nInvalid JNet job result data\!\n{2}
+info.invalid_jnet_job_result_data ={0}\n{1}\nInvalid JPred job result data\!\n{2}
 info.failed_to_submit_sequences_for_alignment = Failed to submit sequences for alignment.\nIt is most likely that there is a problem with the server.\nJust close the window\n
 info.alignment_object_method_notes = \nAlignment Object Method Notes\n
 info.server_exception = \n{0} Server exception\!\n{1}
index 5ba1408..72461e2 100644 (file)
@@ -767,7 +767,7 @@ label.colour_by = Colorear por...
 label.muscle_multiple_protein_sequence_alignment = Alineamiento múltiple de secuencias de proteínas con Muscle
 label.mafft_multiple_sequence_alignment = Alineamiento múltiple de secuencias con MAFFT
 label.clustalw_multiple_sequence_alignment = Alineamiento múltiple de secuencias con ClustalW
-label.jnet_secondary_structure_prediction = Predicción de la estructura secundaria con JNet
+label.jnet_secondary_structure_prediction = Predicción de la estructura secundaria con JPred
 label.multiharmony = Multi-Harmony
 label.unable_start_web_service_analysis = No es posible iniciar el servicio web de análisis
 label.job_couldnt_be_started_check_input = El trabajo no puede arrancarse. Por favor, compruebe los parámetros de entrada y los mensajes de advertencia de la consola de Jalview.
@@ -900,7 +900,7 @@ error.cannot_have_zero_length_vector_replacement_strings = No es posible tener u
 error.implementation_error_multiple_single_sequence_prediction_jobs_not_supported = ¡Error de implementación! Todavía no se soportan varios trabajos de predicción asociados a una única secuencia.
 error.implementation_error_invalid_msa_index_for_job = ¡Error de implementación! Valor msaIndex no válido para JPredJob en el objeto de entrada MSA padre!
 error.implementation_error_startjob_called = Error de implementación - StartJob(JpredJob) invocado en {0}
-error.multiple_jnet_subjob_merge_not_implemented = Todavía no se han implementado varios subtrabajos JNet conjuntos.
+error.multiple_jnet_subjob_merge_not_implemented = Todavía no se han implementado varios subtrabajos JPred conjuntos.
 label.job_never_ran = El trabajo nunca se ejecutó - entrada devuelta al usuario.
 error.implementation_error_minlen_must_be_greater_zero = Error de implementación: minlen debe ser cero o más
 error.implementation_error_msawbjob_called = Error de implementación - StartJob(MsaWSJob) invocado en un WSJobInstance {0}
@@ -1006,7 +1006,7 @@ exception.unexpected_handling_rnaml_translation_for_pdb = Excepcion inesperada c
 exception.couldnt_recover_sequence_properties_for_alignment = No es posible recuperar las propiedades de la secuencia para el alineamiento
 exception.unknown_format_for_file = Formato desconocido {0} para el fichero \: \n{1}
 label.remove_gaps = Eliminar huecos
-exception.couldnt_recover_sequence_props_for_jnet_query = No ha sido posible recuperar las propiedades de la secuencia para la secuencia JNet Query!
+exception.couldnt_recover_sequence_props_for_jnet_query = No ha sido posible recuperar las propiedades de la secuencia para la secuencia JPred Query!
 exception.server_timeout_try_later = Tiempo de conexi\u00F3n ha expirado - int\u00E9ntelo de nuevo m\u00E1s tarde\n
 exception.web_service_returned_null_try_later= El servidor {0} ha devuelto un objeto nulo, por lo que probablemente no se haya podido contactar con él. Inténtelo de nuevo más tarde.
 exception.cannot_contact_service_endpoint_at = No es posible contactar por el punto de acceso al servicio en {0}
@@ -1027,7 +1027,7 @@ info.job_couldnt_be_run_exceeded_hard_limit = No es posible ejecutar el trabajo
 info.job_couldnt_be_run_incorrect_param_setting = No es posible ejecutar el trabjao porque el servidor no soporta algunos de los par\u00E1metros.\n{0}\nPor favor, aseg\u00FArese de que ha usado los par\u00E1metros adecuados para este servicio\n
 info.no_jobs_ran = No se ha ejecutado ningún trabajo
 info.failed_to_submit_prediction = Error al enviar la predicci\u00F3n\:\n{0} {1}
-info.invalid_jnet_job_result_data ={0}\n{1}\nResultados del trabajo JNet no v\u00E1lidos\!\n{2}
+info.invalid_jnet_job_result_data ={0}\n{1}\nResultados del trabajo JPred no v\u00E1lidos\!\n{2}
 info.failed_to_submit_sequences_for_alignment = Error al enviar la secuencias para el alineamiento.\nLo m\u00E1s probable es que haya un problema en el servidor.\nSimplemente, cierre la ventana\n
 info.alignment_object_method_notes = \nNotas sobre los m\u00E9todos del objeto alineamiento\n
 info.server_exception = \n{0} Excepci\u00F3n del servidor\!\n{1}
index f126d55..941052d 100644 (file)
@@ -42,8 +42,10 @@ import jalview.schemes.Blosum62ColourScheme;
 import jalview.schemes.BuriedColourScheme;
 import jalview.schemes.ClustalxColourScheme;
 import jalview.schemes.CollectionColourScheme;
+import jalview.schemes.CollectionColourSchemeI;
 import jalview.schemes.HelixColourScheme;
 import jalview.schemes.HydrophobicColourScheme;
+import jalview.schemes.JalviewColourScheme;
 import jalview.schemes.NucleotideColourScheme;
 import jalview.schemes.PIDColourScheme;
 import jalview.schemes.PurinePyrimidineColourScheme;
@@ -79,33 +81,37 @@ public class APopupMenu extends java.awt.PopupMenu implements
 
   MenuItem editGroupName = new MenuItem();
 
-  protected MenuItem clustalColour = new MenuItem();
+  CheckboxMenuItem noColour = new CheckboxMenuItem();
 
-  protected MenuItem zappoColour = new MenuItem();
+  protected CheckboxMenuItem clustalColour = new CheckboxMenuItem();
 
-  protected MenuItem taylorColour = new MenuItem();
+  protected CheckboxMenuItem zappoColour = new CheckboxMenuItem();
 
-  protected MenuItem hydrophobicityColour = new MenuItem();
+  protected CheckboxMenuItem taylorColour = new CheckboxMenuItem();
 
-  protected MenuItem helixColour = new MenuItem();
+  protected CheckboxMenuItem hydrophobicityColour = new CheckboxMenuItem();
 
-  protected MenuItem strandColour = new MenuItem();
+  protected CheckboxMenuItem helixColour = new CheckboxMenuItem();
 
-  protected MenuItem turnColour = new MenuItem();
+  protected CheckboxMenuItem strandColour = new CheckboxMenuItem();
 
-  protected MenuItem buriedColour = new MenuItem();
+  protected CheckboxMenuItem turnColour = new CheckboxMenuItem();
 
-  protected CheckboxMenuItem abovePIDColour = new CheckboxMenuItem();
+  protected CheckboxMenuItem buriedColour = new CheckboxMenuItem();
 
-  protected MenuItem userDefinedColour = new MenuItem();
+  protected CheckboxMenuItem PIDColour = new CheckboxMenuItem();
 
-  protected MenuItem PIDColour = new MenuItem();
+  protected CheckboxMenuItem BLOSUM62Colour = new CheckboxMenuItem();
 
-  protected MenuItem BLOSUM62Colour = new MenuItem();
+  CheckboxMenuItem nucleotideColour = new CheckboxMenuItem();
 
-  MenuItem noColourmenuItem = new MenuItem();
+  CheckboxMenuItem purinePyrimidineColour = new CheckboxMenuItem();
 
-  protected CheckboxMenuItem conservationMenuItem = new CheckboxMenuItem();
+  protected MenuItem userDefinedColour = new MenuItem();
+
+  protected CheckboxMenuItem abovePIDColour = new CheckboxMenuItem();
+
+  protected CheckboxMenuItem conservationColour = new CheckboxMenuItem();
 
   final AlignmentPanel ap;
 
@@ -113,10 +119,6 @@ public class APopupMenu extends java.awt.PopupMenu implements
 
   MenuItem createGroupMenuItem = new MenuItem();
 
-  MenuItem nucleotideMenuItem = new MenuItem();
-
-  MenuItem purinePyrimidineMenuItem = new MenuItem();
-
   Menu colourMenu = new Menu();
 
   CheckboxMenuItem showBoxes = new CheckboxMenuItem();
@@ -249,8 +251,13 @@ public class APopupMenu extends java.awt.PopupMenu implements
       {
         menu1.setLabel(MessageManager.getString("action.edit_group"));
         groupMenu.remove(createGroupMenuItem);
+        if (sg.cs != null)
+        {
+          abovePIDColour.setState(sg.cs.getThreshold() > 0);
+          conservationColour.setState(sg.cs.conservationApplied());
+        }
       }
-
+      setSelectedColour(sg.cs);
     }
     else
     {
@@ -308,6 +315,36 @@ public class APopupMenu extends java.awt.PopupMenu implements
   }
 
   /**
+   * Select the menu item (if any) matching the current colour scheme. This
+   * works by matching the menu item name (not display text) to the canonical
+   * name of the colour scheme.
+   * 
+   * @param cs
+   */
+  protected void setSelectedColour(CollectionColourSchemeI cs)
+  {
+    if (cs == null || cs.getColourScheme() == null)
+    {
+      noColour.setState(true);
+    }
+    else
+    {
+      String name = cs.getColourScheme().getSchemeName();
+      for (int i = 0; i < colourMenu.getItemCount(); i++)
+      {
+        MenuItem item = colourMenu.getItem(i);
+        if (item instanceof CheckboxMenuItem)
+        {
+          if (name.equals(item.getName()))
+          {
+            ((CheckboxMenuItem) item).setState(true);
+          }
+        }
+      }
+    }
+  }
+
+  /**
    * Adds a 'Link' menu item with a sub-menu item for each hyperlink provided.
    * 
    * @param seq
@@ -502,38 +539,28 @@ public class APopupMenu extends java.awt.PopupMenu implements
     linkMenu.add(item);
   }
 
+  /**
+   * Actions on selecting / unselecting a checkbox menu item
+   */
   @Override
   public void itemStateChanged(ItemEvent evt)
   {
-    if (evt.getSource() == abovePIDColour)
-    {
-      abovePIDColour_itemStateChanged();
-    }
-    else if (evt.getSource() == showColourText)
-    {
-      showColourText_itemStateChanged();
-    }
-    else if (evt.getSource() == showText)
+    Object source = evt.getSource();
+    if (source == noColour)
     {
-      showText_itemStateChanged();
+      noColourmenuItem_actionPerformed();
     }
-    else if (evt.getSource() == showBoxes)
+    else if (source == clustalColour)
     {
-      showBoxes_itemStateChanged();
+      clustalColour_actionPerformed();
     }
-    else if (evt.getSource() == displayNonconserved)
+    else if (source == BLOSUM62Colour)
     {
-      this.showNonconserved_itemStateChanged();
+      BLOSUM62Colour_actionPerformed();
     }
-  }
-
-  @Override
-  public void actionPerformed(ActionEvent evt)
-  {
-    Object source = evt.getSource();
-    if (source == clustalColour)
+    else if (evt.getSource() == PIDColour)
     {
-      clustalColour_actionPerformed();
+      PIDColour_actionPerformed();
     }
     else if (source == zappoColour)
     {
@@ -563,34 +590,50 @@ public class APopupMenu extends java.awt.PopupMenu implements
     {
       buriedColour_actionPerformed();
     }
-    else if (source == nucleotideMenuItem)
+    else if (source == nucleotideColour)
     {
       nucleotideMenuItem_actionPerformed();
     }
-    else if (source == purinePyrimidineMenuItem)
+    else if (source == purinePyrimidineColour)
     {
       purinePyrimidineColour_actionPerformed();
     }
-
-    else if (source == userDefinedColour)
+    else if (source == abovePIDColour)
     {
-      userDefinedColour_actionPerformed();
+      abovePIDColour_itemStateChanged();
     }
-    else if (source == PIDColour)
+    else if (source == conservationColour)
     {
-      PIDColour_actionPerformed();
+      conservationMenuItem_itemStateChanged();
     }
-    else if (source == BLOSUM62Colour)
+    else if (source == showColourText)
     {
-      BLOSUM62Colour_actionPerformed();
+      showColourText_itemStateChanged();
     }
-    else if (source == noColourmenuItem)
+    else if (source == showText)
     {
-      noColourmenuItem_actionPerformed();
+      showText_itemStateChanged();
     }
-    else if (source == conservationMenuItem)
+    else if (source == showBoxes)
     {
-      conservationMenuItem_itemStateChanged();
+      showBoxes_itemStateChanged();
+    }
+    else if (source == displayNonconserved)
+    {
+      this.showNonconserved_itemStateChanged();
+    }
+  }
+
+  /**
+   * Actions on clicking a menu item
+   */
+  @Override
+  public void actionPerformed(ActionEvent evt)
+  {
+    Object source = evt.getSource();
+    if (source == userDefinedColour)
+    {
+      userDefinedColour_actionPerformed();
     }
     else if (source == unGroupMenuItem)
     {
@@ -939,7 +982,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
     groupMenu.add(unGroupMenuItem);
     groupMenu.add(menu1);
 
-    colourMenu.add(noColourmenuItem);
+    colourMenu.add(noColour);
     colourMenu.add(clustalColour);
     colourMenu.add(BLOSUM62Colour);
     colourMenu.add(PIDColour);
@@ -950,62 +993,80 @@ public class APopupMenu extends java.awt.PopupMenu implements
     colourMenu.add(strandColour);
     colourMenu.add(turnColour);
     colourMenu.add(buriedColour);
-    colourMenu.add(nucleotideMenuItem);
-    colourMenu.add(purinePyrimidineMenuItem);
+    colourMenu.add(nucleotideColour);
+    colourMenu.add(purinePyrimidineColour);
     colourMenu.add(userDefinedColour);
     colourMenu.addSeparator();
     colourMenu.add(abovePIDColour);
-    colourMenu.add(conservationMenuItem);
+    colourMenu.add(conservationColour);
 
-    noColourmenuItem.setLabel(MessageManager.getString("label.none"));
-    noColourmenuItem.addActionListener(this);
+    noColour.setLabel(MessageManager.getString("label.none"));
+    noColour.addItemListener(this);
 
+    /*
+     * setName allows setSelectedColour to do its thing
+     */
     clustalColour.setLabel(MessageManager
             .getString("label.colourScheme_clustal"));
-    clustalColour.addActionListener(this);
+    clustalColour.setName(JalviewColourScheme.Clustal.toString());
+    clustalColour.addItemListener(this);
+    BLOSUM62Colour.setLabel(MessageManager
+            .getString("label.colourScheme_blosum62"));
+    BLOSUM62Colour.setName(JalviewColourScheme.Blosum62.toString());
+    BLOSUM62Colour.addItemListener(this);
+    PIDColour.setLabel(MessageManager
+            .getString("label.colourScheme_%_identity"));
+    PIDColour.setName(JalviewColourScheme.PID.toString());
+    PIDColour.addItemListener(this);
     zappoColour.setLabel(MessageManager
             .getString("label.colourScheme_zappo"));
-    zappoColour.addActionListener(this);
+    zappoColour.setName(JalviewColourScheme.Zappo.toString());
+    zappoColour.addItemListener(this);
     taylorColour.setLabel(MessageManager
             .getString("label.colourScheme_taylor"));
-    taylorColour.addActionListener(this);
+    taylorColour.setName(JalviewColourScheme.Taylor.toString());
+    taylorColour.addItemListener(this);
     hydrophobicityColour.setLabel(MessageManager
             .getString("label.colourScheme_hydrophobic"));
-    hydrophobicityColour.addActionListener(this);
+    hydrophobicityColour
+            .setName(JalviewColourScheme.Hydrophobic.toString());
+    hydrophobicityColour.addItemListener(this);
     helixColour.setLabel(MessageManager
             .getString("label.colourScheme_helix_propensity"));
-    helixColour.addActionListener(this);
+    helixColour.setName(JalviewColourScheme.Helix.toString());
+    helixColour.addItemListener(this);
     strandColour.setLabel(MessageManager
             .getString("label.colourScheme_strand_propensity"));
-    strandColour.addActionListener(this);
+    strandColour.setName(JalviewColourScheme.Strand.toString());
+    strandColour.addItemListener(this);
     turnColour.setLabel(MessageManager
             .getString("label.colourScheme_turn_propensity"));
-    turnColour.addActionListener(this);
+    turnColour.setName(JalviewColourScheme.Turn.toString());
+    turnColour.addItemListener(this);
     buriedColour.setLabel(MessageManager
             .getString("label.colourScheme_buried_index"));
-    buriedColour.addActionListener(this);
-    abovePIDColour.setLabel(MessageManager
-            .getString("label.above_identity_threshold"));
+    buriedColour.setName(JalviewColourScheme.Buried.toString());
+    buriedColour.addItemListener(this);
+    nucleotideColour.setLabel(MessageManager
+            .getString("label.colourScheme_nucleotide"));
+    nucleotideColour.setName(JalviewColourScheme.Nucleotide.toString());
+    nucleotideColour.addItemListener(this);
+    purinePyrimidineColour.setLabel(MessageManager
+            .getString("label.colourScheme_purine/pyrimidine"));
+    purinePyrimidineColour.setName(JalviewColourScheme.PurinePyrimidine
+            .toString());
+    purinePyrimidineColour.addItemListener(this);
 
     userDefinedColour.setLabel(MessageManager
             .getString("action.user_defined"));
     userDefinedColour.addActionListener(this);
-    PIDColour.setLabel(MessageManager
-            .getString("label.colourScheme_%_identity"));
-    PIDColour.addActionListener(this);
-    BLOSUM62Colour.setLabel(MessageManager
-            .getString("label.colourScheme_blosum62"));
-    BLOSUM62Colour.addActionListener(this);
-    conservationMenuItem.setLabel(MessageManager
-            .getString("label.conservation"));
-    nucleotideMenuItem.setLabel(MessageManager
-            .getString("label.colourScheme_nucleotide"));
-    nucleotideMenuItem.addActionListener(this);
-    purinePyrimidineMenuItem.setLabel(MessageManager
-            .getString("label.colourScheme_purine/pyrimidine"));
-    purinePyrimidineMenuItem.addActionListener(this);
-    conservationMenuItem.addItemListener(this);
+
+    abovePIDColour.setLabel(MessageManager
+            .getString("label.above_identity_threshold"));
     abovePIDColour.addItemListener(this);
+    conservationColour.setLabel(MessageManager
+            .getString("label.conservation"));
+    conservationColour.addItemListener(this);
 
     editMenu.add(copy);
     copy.addActionListener(this);
@@ -1185,9 +1246,10 @@ public class APopupMenu extends java.awt.PopupMenu implements
       return;
     }
 
-    if (conservationMenuItem.getState())
+    if (conservationColour.getState())
     {
-      Conservation conservation = Conservation.calculateConservation("Group", sg
+      Conservation conservation = Conservation.calculateConservation(
+              "Group", sg
               .getSequences(ap.av.getHiddenRepSequences()), 0, ap.av
               .getAlignment().getWidth(), false, ap.av.getConsPercGaps(),
               false);
index dcb23c2..3d961b1 100644 (file)
@@ -1482,10 +1482,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       url.append(appendProtocol(viewport.applet.getParameter("annotations")));
     }
 
-    if (viewport.applet.getParameter("jnetfile") != null)
+    if (viewport.applet.getParameter("jnetfile") != null
+            || viewport.applet.getParameter("jpredfile") != null)
     {
       url.append("&annotations=");
-      url.append(appendProtocol(viewport.applet.getParameter("jnetfile")));
+      url.append(appendProtocol(viewport.applet.getParameter("jnetfile") != null ? viewport.applet
+              .getParameter("jnetfile") : viewport.applet
+              .getParameter("jpredfile")));
     }
 
     if (viewport.applet.getParameter("defaultColour") != null)
index 3ecf22b..e01ab57 100644 (file)
@@ -2256,6 +2256,11 @@ public class JalviewLite extends Applet implements
     {
       boolean result = false;
       String param = applet.getParameter("jnetfile");
+      if (param == null)
+      {
+        // jnet became jpred around 2016
+        param = applet.getParameter("jpredfile");
+      }
       if (param != null)
       {
         try
index 50da272..fdac7f8 100644 (file)
@@ -424,9 +424,16 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
 
       ColourMenuHelper.setColourSelected(colourMenu, sg.getColourScheme());
 
-      if (sg.cs != null && sg.cs.conservationApplied())
+      if (sg.cs != null)
       {
-        conservationMenuItem.setSelected(true);
+        if (sg.cs.conservationApplied())
+        {
+          conservationMenuItem.setSelected(true);
+        }
+        if (sg.cs.getThreshold() > 0)
+        {
+          abovePIDColour.setSelected(true);
+        }
       }
       displayNonconserved.setSelected(sg.getShowNonconserved());
       showText.setSelected(sg.getDisplayText());
index 7258f51..ba4054e 100644 (file)
@@ -222,7 +222,7 @@ public class Discoverer implements Runnable
                             + "\nNucleic Acids Research, Web Server issue (first published 15th April 2015)"
                             + "\ndoi://10.1093/nar/gkv332",
                     "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred",
-                    "JNet Secondary Structure Prediction") };
+                    "JPred Secondary Structure Prediction") };
         services = new Hashtable();
         serviceList = new Vector();
         buildServiceLists(defServices, serviceList, services);
index 2c05386..65847e6 100644 (file)
@@ -238,7 +238,7 @@ public class JPredClient extends WS1Client
 
     SequenceI seq = msf[0];
 
-    String altitle = "JNet prediction on " + seq.getName()
+    String altitle = "JPred prediction on " + seq.getName()
             + " using alignment from " + title;
 
     wsInfo.setProgressText("Job details for MSA based prediction (" + title
@@ -275,7 +275,7 @@ public class JPredClient extends WS1Client
     wsInfo.setProgressText("Job details for prediction on sequence :\n>"
             + seq.getName() + "\n"
             + AlignSeq.extractGaps("-. ", seq.getSequenceAsString()) + "\n");
-    String altitle = "JNet prediction for sequence " + seq.getName()
+    String altitle = "JPred prediction for sequence " + seq.getName()
             + " from " + title;
 
     Hashtable SequenceInfo = jalview.analysis.SeqsetUtils
index c11302c..8bae5ba 100644 (file)
@@ -281,6 +281,7 @@ public class SiftsClient implements SiftsClientI
       siftsDownloadDir.mkdirs();
     }
     // System.out.println(">> Download ftp url : " + siftsFileFTPURL);
+    // long now = System.currentTimeMillis();
     URL url = new URL(siftsFileFTPURL);
     URLConnection conn = url.openConnection();
     InputStream inputStream = conn.getInputStream();
@@ -294,7 +295,8 @@ public class SiftsClient implements SiftsClientI
     }
     outputStream.close();
     inputStream.close();
-    // System.out.println(">>> File downloaded : " + downloadedSiftsFile);
+//    System.out.println(">>> File downloaded : " + downloadedSiftsFile
+//            + " took " + (System.currentTimeMillis() - now) + "ms");
     return new File(downloadedSiftsFile);
   }
 
index 45c5412..d805e47 100644 (file)
@@ -20,6 +20,9 @@
  */
 package jalview.ws.sifts;
 
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
 import jalview.api.DBRefEntryI;
 import jalview.bin.Cache;
 import jalview.datamodel.DBRefEntry;
@@ -178,7 +181,7 @@ public class SiftsClientTest
   }
 
   @BeforeTest(alwaysRun = true)
-  public void setUpSiftsClient() throws SiftsException
+  public void setUpSiftsClient() throws SiftsException, IOException
   {
     // read test props before manipulating config
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
@@ -191,15 +194,9 @@ public class SiftsClientTest
     SiftsSettings.setCacheThresholdInDays("2");
     SiftsSettings.setFailSafePIDThreshold("70");
     PDBfile pdbFile;
-    try
-    {
-      pdbFile = new PDBfile(false, false, false, "test/jalview/io/"
-              + testPDBId + ".pdb", DataSourceType.FILE);
-      siftsClient = new SiftsClient(pdbFile);
-    } catch (Exception e)
-    {
-      e.printStackTrace();
-    }
+    pdbFile = new PDBfile(false, false, false, "test/jalview/io/"
+            + testPDBId + ".pdb", DataSourceType.FILE);
+    siftsClient = new SiftsClient(pdbFile);
   }
 
   @AfterTest(alwaysRun = true)
@@ -208,44 +205,56 @@ public class SiftsClientTest
     siftsClient = null;
   }
 
-  @Test(groups = { "Functional" })
-  public void getSIFTsFileTest() throws SiftsException
+  @Test(groups = { "Network" })
+  public void getSIFTsFileTest() throws SiftsException, IOException
   {
     File siftsFile;
-    try
-    {
-      siftsFile = SiftsClient.downloadSiftsFile(testPDBId);
-      FileAssert.assertFile(siftsFile);
-      // test for SIFTs file caching
-      SiftsSettings.setCacheThresholdInDays("0");
-      siftsFile = SiftsClient.getSiftsFile(testPDBId);
-      FileAssert.assertFile(siftsFile);
-      SiftsSettings.setCacheThresholdInDays("2");
-    } catch (IOException e)
+    siftsFile = SiftsClient.downloadSiftsFile(testPDBId);
+    FileAssert.assertFile(siftsFile);
+    long t1 = siftsFile.lastModified();
+
+    // re-read file should be returned from cache
+    siftsFile = SiftsClient.downloadSiftsFile(testPDBId);
+    FileAssert.assertFile(siftsFile);
+    long t2 = siftsFile.lastModified();
+    assertEquals(t1, t2);
+
+    /*
+     * force fetch by having 0 expiry of cache
+     * also wait one second, because file timestamp does not
+     * give millisecond resolution :-(
+     */
+    synchronized (this)
     {
-      e.printStackTrace();
+      try
+      {
+        wait(1000);
+      } catch (InterruptedException e)
+      {
+      }
     }
+    SiftsSettings.setCacheThresholdInDays("0");
+    siftsFile = SiftsClient.getSiftsFile(testPDBId);
+    FileAssert.assertFile(siftsFile);
+    long t3 = siftsFile.lastModified();
+    assertTrue(t3 > t2, "file timestamp unchanged at " + t3);
+
+    SiftsSettings.setCacheThresholdInDays("2");
   }
 
-  @Test(groups = { "Functional" })
-  public void downloadSiftsFileTest() throws SiftsException
+  @Test(groups = { "Network" })
+  public void downloadSiftsFileTest() throws SiftsException, IOException
   {
     // Assert that file isn't yet downloaded - if already downloaded, assert it
     // is deleted
     Assert.assertTrue(SiftsClient.deleteSiftsFileByPDBId(testPDBId));
     File siftsFile;
-    try
-    {
-      siftsFile = SiftsClient.downloadSiftsFile(testPDBId);
-      FileAssert.assertFile(siftsFile);
-      SiftsClient.downloadSiftsFile(testPDBId);
-    } catch (IOException e)
-    {
-      e.printStackTrace();
-    }
+    siftsFile = SiftsClient.downloadSiftsFile(testPDBId);
+    FileAssert.assertFile(siftsFile);
+    SiftsClient.downloadSiftsFile(testPDBId);
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void getAllMappingAccessionTest()
   {
     Assert.assertNotNull(siftsClient);
@@ -253,7 +262,7 @@ public class SiftsClientTest
     Assert.assertTrue(siftsClient.getAllMappingAccession().size() > 1);
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void getGreedyMappingTest()
   {
     Assert.assertNotNull(siftsClient);
@@ -279,7 +288,7 @@ public class SiftsClientTest
     }
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   private void getAtomIndexTest()
   {
     ArrayList<Atom> atoms = new ArrayList<Atom>();
@@ -294,21 +303,21 @@ public class SiftsClientTest
   }
 
   @Test(
-    groups = { "Functional" },
+    groups = { "Network" },
     expectedExceptions = IllegalArgumentException.class)
   private void getAtomIndexNullTest()
   {
     siftsClient.getAtomIndex(1, null);
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   private void padWithGapsTest()
   {
 
   }
 
   @Test(
-    groups = { "Functional" },
+groups = { "Network" },
     expectedExceptions = SiftsException.class)
   private void populateAtomPositionsNullTest1()
           throws IllegalArgumentException, SiftsException
@@ -317,7 +326,7 @@ public class SiftsClientTest
   }
 
   @Test(
-    groups = { "Functional" },
+groups = { "Network" },
     expectedExceptions = SiftsException.class)
   private void populateAtomPositionsNullTest2()
           throws IllegalArgumentException, SiftsException
@@ -325,40 +334,29 @@ public class SiftsClientTest
     siftsClient.populateAtomPositions("A", null);
   }
 
-  @Test(groups = { "Functional" })
-  public void getValidSourceDBRefTest()
+  @Test(groups = { "Network" })
+  public void getValidSourceDBRefTest() throws SiftsException
   {
-    try
-    {
-      DBRefEntryI actualValidSrcDBRef = siftsClient
-              .getValidSourceDBRef(testSeq);
-      DBRefEntryI expectedDBRef = new DBRefEntry();
-      expectedDBRef.setSource(DBRefSource.UNIPROT);
-      expectedDBRef.setAccessionId("P00221");
-      expectedDBRef.setVersion("");
-      Assert.assertEquals(actualValidSrcDBRef, expectedDBRef);
-    } catch (Exception e)
-    {
-    }
+    DBRefEntryI actualValidSrcDBRef = siftsClient
+            .getValidSourceDBRef(testSeq);
+    DBRefEntryI expectedDBRef = new DBRefEntry();
+    expectedDBRef.setSource(DBRefSource.UNIPROT);
+    expectedDBRef.setAccessionId("P00221");
+    expectedDBRef.setVersion("");
+    Assert.assertEquals(actualValidSrcDBRef, expectedDBRef);
   }
 
   @Test(
-    groups = { "Functional" },
+groups = { "Network" },
     expectedExceptions = SiftsException.class)
   public void getValidSourceDBRefExceptionTest() throws SiftsException
   {
     SequenceI invalidTestSeq = new Sequence("testSeq", "ABCDEFGH");
-    try
-    {
-      siftsClient.getValidSourceDBRef(invalidTestSeq);
-    } catch (SiftsException e)
-    {
-      throw new SiftsException(e.getMessage());
-    }
+    siftsClient.getValidSourceDBRef(invalidTestSeq);
   }
 
   @Test(
-    groups = { "Functional" },
+groups = { "Network" },
     expectedExceptions = SiftsException.class)
   public void getValidSourceDBRefExceptionXTest() throws SiftsException
   {
@@ -366,17 +364,10 @@ public class SiftsClientTest
     DBRefEntry invalidDBRef = new DBRefEntry();
     invalidDBRef.setAccessionId("BLAR");
     invalidTestSeq.addDBRef(invalidDBRef);
-    try
-    {
-      siftsClient.getValidSourceDBRef(invalidTestSeq);
-    } catch (SiftsException e)
-    {
-      throw new SiftsException(e.getMessage());
-    }
-
+    siftsClient.getValidSourceDBRef(invalidTestSeq);
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void isValidDBRefEntryTest()
   {
     DBRefEntryI validDBRef = new DBRefEntry();
@@ -386,38 +377,32 @@ public class SiftsClientTest
     Assert.assertTrue(siftsClient.isValidDBRefEntry(validDBRef));
   }
 
-  @Test(groups = { "Functional" })
-  public void getSiftsStructureMappingTest()
+  @Test(groups = { "Network" })
+  public void getSiftsStructureMappingTest() throws SiftsException
   {
-    try
-    {
-      Assert.assertTrue(SiftsSettings.isMapWithSifts());
-      StructureMapping strucMapping = siftsClient.getSiftsStructureMapping(
-              testSeq, testPDBId, "A");
-      String expectedMappingOutput = "\nSequence ⟷ Structure mapping details\n"
-              + "Method: SIFTS\n\n"
-              + "P00221 :  51 - 147 Maps to \n"
-              + "1A70|A :  1 - 97\n\n"
-              + "P00221 AAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLD\n"
-              + "       |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n"
-              + "1A70|A AAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLD\n\n"
-
-              + "P00221 DDQIDEGWVLTCAAYPVSDVTIETHKEEELTA\n"
-              + "       |||||||||||||||||||||||||| |||||\n"
-              + "1A70|A DDQIDEGWVLTCAAYPVSDVTIETHKKEELTA\n\n" +
-
-              "Length of alignment = 97\n" + "Percentage ID = 98.97\n";
-
-      Assert.assertEquals(strucMapping.getMappingDetailsOutput(),
-              expectedMappingOutput);
-      Assert.assertEquals(strucMapping.getMapping(), expectedMapping);
-    } catch (SiftsException e)
-    {
-      e.printStackTrace();
-    }
+    Assert.assertTrue(SiftsSettings.isMapWithSifts());
+    StructureMapping strucMapping = siftsClient.getSiftsStructureMapping(
+            testSeq, testPDBId, "A");
+    String expectedMappingOutput = "\nSequence ⟷ Structure mapping details\n"
+            + "Method: SIFTS\n\n"
+            + "P00221 :  51 - 147 Maps to \n"
+            + "1A70|A :  1 - 97\n\n"
+            + "P00221 AAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLD\n"
+            + "       |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||\n"
+            + "1A70|A AAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLD\n\n"
+
+            + "P00221 DDQIDEGWVLTCAAYPVSDVTIETHKEEELTA\n"
+            + "       |||||||||||||||||||||||||| |||||\n"
+            + "1A70|A DDQIDEGWVLTCAAYPVSDVTIETHKKEELTA\n\n" +
+
+            "Length of alignment = 97\n" + "Percentage ID = 98.97\n";
+
+    Assert.assertEquals(strucMapping.getMappingDetailsOutput(),
+            expectedMappingOutput);
+    Assert.assertEquals(strucMapping.getMapping(), expectedMapping);
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void getEntityCountTest()
   {
     int actualEntityCount = siftsClient.getEntityCount();
@@ -425,7 +410,7 @@ public class SiftsClientTest
     Assert.assertEquals(actualEntityCount, 1);
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void getDbAccessionIdTest()
   {
     String actualDbAccId = siftsClient.getDbAccessionId();
@@ -433,7 +418,7 @@ public class SiftsClientTest
     Assert.assertEquals(actualDbAccId, "1a70");
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void getDbCoordSysTest()
   {
     String actualDbCoordSys = siftsClient.getDbCoordSys();
@@ -441,7 +426,7 @@ public class SiftsClientTest
     Assert.assertEquals(actualDbCoordSys, "PDBe");
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void getDbSourceTest()
   {
     String actualDbSource = siftsClient.getDbSource();
@@ -449,7 +434,7 @@ public class SiftsClientTest
     Assert.assertEquals(actualDbSource, "PDBe");
   }
 
-  @Test(groups = { "Functional" })
+  @Test(groups = { "Network" })
   public void getDbVersionTest()
   {
     String actualDbVersion = siftsClient.getDbVersion();
@@ -457,20 +442,15 @@ public class SiftsClientTest
     Assert.assertEquals(actualDbVersion, "2.0");
   }
 
-  @Test(groups = { "Functional" })
-  public void getEntityByMostOptimalMatchedIdTest1()
+  @Test(groups = { "Network" })
+  public void getEntityByMostOptimalMatchedIdTest1() throws IOException,
+          SiftsException
   {
     SiftsClient siftsClientX = null;
     PDBfile pdbFile;
-    try
-    {
-      pdbFile = new PDBfile(false, false, false, "test/jalview/io/2nq2"
-              + ".pdb", DataSourceType.FILE);
-      siftsClientX = new SiftsClient(pdbFile);
-    } catch (Exception e)
-    {
-      e.printStackTrace();
-    }
+    pdbFile = new PDBfile(false, false, false, "test/jalview/io/2nq2"
+            + ".pdb", DataSourceType.FILE);
+    siftsClientX = new SiftsClient(pdbFile);
     Entity entityA = siftsClientX.getEntityByMostOptimalMatchedId("A");
     Assert.assertEquals(entityA.getEntityId(), "A");
     Entity entityB = siftsClientX.getEntityByMostOptimalMatchedId("B");
@@ -482,23 +462,18 @@ public class SiftsClientTest
 
   }
 
-  @Test(groups = { "Functional" })
-  public void getEntityByMostOptimalMatchedIdTest2()
+  @Test(groups = { "Network" })
+  public void getEntityByMostOptimalMatchedIdTest2() throws IOException,
+          SiftsException
   {
     // This test is for a SIFTS file in which entity A should map to chain P for
     // the given PDB Id. All the other chains shouldn't be mapped as there are
     // no SIFTS entity records for them.
     SiftsClient siftsClientX = null;
     PDBfile pdbFile;
-    try
-    {
-      pdbFile = new PDBfile(false, false, false,
-              "test/jalview/io/3ucu.cif", DataSourceType.FILE);
-      siftsClientX = new SiftsClient(pdbFile);
-    } catch (Exception e)
-    {
-      e.printStackTrace();
-    }
+    pdbFile = new PDBfile(false, false, false, "test/jalview/io/3ucu.cif",
+            DataSourceType.FILE);
+    siftsClientX = new SiftsClient(pdbFile);
     Entity entityA = siftsClientX.getEntityByMostOptimalMatchedId("P");
     Entity entityP = siftsClientX.getEntityByMostOptimalMatchedId("A");
     Entity entityR = siftsClientX.getEntityByMostOptimalMatchedId("R");