Merge branch 'develop' of https://source.jalview.org/git/jalview into develop
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 23 Sep 2016 15:22:13 +0000 (16:22 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Fri, 23 Sep 2016 15:22:13 +0000 (16:22 +0100)
59 files changed:
examples/groovy/featureCounter.groovy
help/help.jhm
help/helpTOC.xml
help/html/calculations/referenceseq.html
help/html/calculations/structureconsensus.html
help/html/features/annotation.html
help/html/features/ensemblsequencefetcher.html [new file with mode: 0644]
help/html/features/featuresettings.html
help/html/features/groovy.html
help/html/features/selectfetchdb.gif
help/html/features/seqfetch.html
help/html/features/structurechooser.html
help/html/groovy/featureCounter.html [new file with mode: 0644]
help/html/menus/alwannotation.html
help/html/menus/alwannotationpanel.html
help/html/menus/index.html
help/html/menus/popupMenu.html
help/html/releases.html
help/html/whatsNew.html
src/jalview/analysis/Conservation.java
src/jalview/analysis/Rna.java
src/jalview/analysis/StructureFrequency.java
src/jalview/api/AlignViewportI.java
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/AlignmentPanel.java
src/jalview/appletgui/TreeCanvas.java
src/jalview/bin/JalviewLite.java
src/jalview/datamodel/Alignment.java
src/jalview/datamodel/ColumnSelection.java
src/jalview/datamodel/SequenceGroup.java
src/jalview/ext/ensembl/EnsemblGene.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/Desktop.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/TreeCanvas.java
src/jalview/gui/VamsasApplication.java
src/jalview/io/AnnotationFile.java
src/jalview/io/vamsas/DatastoreRegistry.java
src/jalview/javascript/JSFunctionExec.java
src/jalview/javascript/MouseOverStructureListener.java
src/jalview/renderer/AnnotationRenderer.java
src/jalview/schemes/ResidueProperties.java
src/jalview/viewmodel/AlignmentViewport.java
src/jalview/workers/ConservationThread.java
test/jalview/analysis/RnaTest.java
test/jalview/datamodel/ColumnSelectionTest.java
test/jalview/gui/AlignViewportTest.java
test/jalview/gui/AnnotationChooserTest.java
test/jalview/gui/JAL1353bugdemo.java
test/jalview/io/StockholmFileTest.java
test/jalview/schemes/DnaCodonTests.java
test/jalview/ws/PDBSequenceFetcherTest.java

index a16d8bb..9059dd0 100644 (file)
@@ -1,3 +1,24 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 import jalview.workers.FeatureCounterI;
 import jalview.workers.AlignmentAnnotationFactory;
 
index ce98085..1760d43 100755 (executable)
    
    <mapID target="memory" url="html/memory.html" />
    <mapID target="groovy" url="html/features/groovy.html" />
+   <mapID target="groovy.featurecounter" url="html/groovy/featureCounter.html" />
    <mapID target="privacy" url="html/privacy.html" />
    <mapID target="vamsas" url="html/vamsas/index.html"/>
    <mapID target="aminoAcids" url="html/misc/aminoAcids.html" />
    <mapID target="selectcolbyannot" url="html/features/columnFilterByAnnotation.html" />
    <mapID target="biojsmsa" url="html/features/biojsmsa.html" />
    
+   <mapID target="ensemblfetch" url="html/features/ensemblsequencefetcher.html" />
+   
+   <mapID target="uniprotfetcher" url="html/features/uniprotsequencefetcher.html" />
+   
    <mapID target="backIcon" url="icons/back.png" />
    <mapID target="forwardIcon" url="icons/forward.png" />
    <mapID target="homeIcon" url="icons/Home.png" />
index a6145c1..ed95a61 100755 (executable)
 <!-- DO NOT WRAP THESE LINES - help2Website relies on each item being on one line! -->
        <tocitem text="Jalview Documentation" target="home" expand="true">
                        <tocitem text="What's new" target="new" expand="true">
-                               <tocitem text="Split Frame View" target="splitframe" />
-                               <tocitem text="PDB Sequence Fetcher" target="pdbfetcher" />
-                               <tocitem text="PDB Structure Chooser" target="pdbchooser" />
-                               <tocitem text="Chimera Viewer" target="chimera" />
-                               <tocitem text="Select Columns by Annotation" target="selectcolbyannot" />
+                               <tocitem text="Retrieval from ENSEMBL" target="ensemblfetch" />
+                               <tocitem text="UniProt Free Text Search" target="uniprotfetcher" />
+                               
                                <tocitem text="Latest Release Notes" target="release"/>
                </tocitem>
                
                </tocitem>
                <tocitem text="Preferences" target="preferences" />
                <tocitem text="Memory Settings" target="memory" expand="false"/>
+               <tocitem text="Scripting with Groovy" target="groovy">
+                       <tocitem text="Groovy Feature Counter example" target="groovy.featurecounter"/>
+               </tocitem>
                <tocitem text="Command Line" target="commandline" expand="false">
                        <tocitem text="Command Line Arguments" target="clarguments" />
-                       <tocitem text="Groovy Shell" target="groovy" />
                </tocitem>
                <tocitem text="Privacy" target="privacy" />
        </tocitem>
index 03d24a5..912be55 100644 (file)
   <p>
     <strong>Reference Sequence Alignment Views</strong>
   </p>
+  <p>Many alignment analysis tasks concern a query, or reference
+    sequence. For instance, when searching for sequences from other
+    organisms that are similar to a newly sequenced gene, or when
+    searching for structurally similar sequences for use in homology
+    modelling.</p>
+<p>
+    <strong>What happens when a reference sequence is defined ?</strong>
+  </p>
   <p>
     The reference sequence for an alignment is indicated by its ID being
-    shown in bold. When a reference sequence has been defined, the <strong>Format&#8594;Show
-      unconserved</strong> option highlights mutations with respect to the
-    reference sequence, rather than the alignment's consensus sequence.
-  </p>
+    shown in bold. In addition:</p>
+  <ul>
+    <li><strong>Reference sequence numbering</strong>. Instead of
+      column numbers, the alignment ruler shows the reference sequence
+      positions at each column. At each tick mark, either the reference
+      sequence symbol and position is given, or the column number when a
+      gap is present at that position in the reference sequence.</li>
+    <li><strong>Format&#8594;Show unconserved</strong> highlights
+      mutations with respect to the reference sequence, rather than the
+      alignment's consensus sequence.</li>
+  </ul>
   <p>
+    <strong>Defining the reference sequence</strong>
+  </p>
+  <p>Each alignment view can have its own reference sequence.</p>
   <ul>
-    <li>Jalview automatically assigns a reference sequence when <a
-      href="../webServices/jnet.html"
-    >JPred4</a> predictions are imported.
-    </li>
-    <li><strong>Assigning a reference sequence</strong><br /> A
-      sequence can be marked as the reference sequence by right-clicking
-      on it's ID to open the popup menu, and selecting the "<strong>(Sequence
-        ID)&#8594;Mark as Reference</strong>" entry."</li>
+    <li><strong>Manually assigning a reference sequence</strong><br />
+      A sequence can be marked as the reference sequence by
+      right-clicking on its ID to open the popup menu, and selecting the
+      "<strong>(Sequence ID)&#8594;Mark as Reference</strong>" entry.</li>
+    <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
+      sequence can also be assigned via the <a
+      href="../features/annotationsFormat.html#refsandviews">SET_REF</a> command in
+      an alignment annotation file.</li>
   </ul>
   <p>
     <em>Reference sequence based alignment visualisation was
-      introduced in Jalview 2.9.</em>
+      introduced in Jalview 2.9, and support for storage and retrieval
+      of reference sequence views in 2.10.</em>
   </p>
 </html>
index 7325439..756e6e9 100755 (executable)
     <strong>Alignment RNA Structure Consensus Annotation</strong>
   </p>
 
-  <p>
-    The RNA structure consensus displayed below the alignment is the
-    percentage of valid base pairs per column. It is calculated in
-    relation to a secondary structure and just paired columns are
-    calculated. The canonical Watson-Crick base pairings (A-T/U, G-C)
-    and the wobble base pair (G-T/U) are regarded as valid pairings.<br>
-    The amount of valid base pairs is indicated by the profile in the
-    Alignment Annotation row.<br> By default this calculation
-    includes gaps in columns. You can choose to ignore gaps in the
-    calculation by right clicking on the label &quot;StrConsensus&quot;
-    to the left of the structure consensus bar chart.<br>
+  <p>The RNA structure consensus displayed below the alignment gives
+    the percentage of valid base pairs per column for the first
+    secondary structure annotation shown on the annotation panel. The
+    symbol below each histogram indicates whether the majority of base
+    pairs are:
+  <ul>
+    <li>'(' - Watson-Crick (A:C, G:T)</li>
+    <li>'[' - Canonical Pairs (A:C, G:U, A:U)</li>
+    <li>'{' - Invalid Pairs (the rest)</li>
+  </ul>
+  <p>Mousing over the column gives the fraction of pairs classified as Watson-Crick, Canonical or Invalid.</p>
+  
+<p>By default
+    this calculation includes gaps in columns. You can choose to ignore
+    gaps in the calculation by right clicking on the label
+    &quot;StrConsensus&quot; to the left of the structure consensus bar
+    chart.<br>
   <p>
     <strong>Structure logo</strong>
   </p>
-  By clicking on the label you can also activate the structure logo. It
-  is very similar to a sequence logo but counts the numbers of base
-  pairs. There are two residues per column, the actual column and the
-  interacting base. The opening bracket is always the one on the left
-  side.
-  <br> Like sequence logos the relative amount of a specific base
-  pair can be estimated by its size in the logo. The tool tip of a
-  column gives the exact numbers for all occurring valid base pairs.
+  Right-clicking on the label allows you to enable the structure logo.
+  It is very similar to a sequence logo but instead shows the
+  distribution of base pairs. There are two residues per column, the
+  actual column and the interacting base. The opening bracket is always
+  the one on the left side.
+  <br> Like sequence logos the relative amount of a specific base pair
+  can be estimated by its size in the logo. When the logo is displayed,
+  the tool tip of a column gives the exact numbers for all occurring
+  valid base pairs.
   </p>
 </body>
 </html>
index 7e52c46..d13afe4 100755 (executable)
  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  -->
-<head><title>Alignment Annotation</title></head>
+<head>
+<title>Alignment Annotation</title>
+</head>
 <body>
-<p><strong>Alignment Annotation</strong></p>
+  <p>
+    <strong>Alignment Annotation</strong>
+  </p>
 
-<p>In addition to the definition of groups and sequence features,
-  Jalview can display symbols and graphs under the columns of an
-  alignment, and allow you to mark particular columns of an alignment and add symbols and text 
-  in the annotation area shown below the alignment (which may be hidden if <strong>View&#8594;Show 
-  Annotation</strong> is not ticked). Any displayed annotation row can be hidden (using the pop-up 
-  menu obtained by right-clicking the label), or re-ordered by dragging the label to a new 
-  position with the left mouse button.</p>
-<p>
-Web services can also add annotation to an alignment (see the <a
-href="../webServices/jnet.html">JNet</a> and <a
-href="../webServices/proteinDisorder.html">Disorder</a> protein
-structure prediction services), and as of Jalview 2.08 quantitative
-and symbolic annotations can be added to an alignment via an <a
-href="annotationsFormat.html">Annotations File</a> dragged into the
-alignment window or loaded from the alignment's file menu.
-</p>
-<p><a name="seqannots"/><strong>Sequence Reference Annotation</strong>
-</p>
-<p>
-               Sequence reference annotation is created from 3D structure
-               data, and from the results of sequence based prediction of
-               <a href="../webServices/jnet.html">secondary structure</a> and <a
-                       href="../webServices/proteinDisorder.html">disordered region</a>
-               prediction methods. 
-</p>
-<p><strong>Sequence Group Annotation</strong>
-</p>
-<p>
-       If sequence groups are defined, <a href="../calculations/conservation.html">Conservation</a>
-        and <a href="../calculations/consensus.html">Consensus</a> annotation can be enabled
-       for each group from the <a href="../menus/alwannotation.html">Annotations menu</a>, or can
-       be imported from a Jalview <a href="annotationsFormat.html">Annotations file</a>.
-</p>
-<p><strong>Sequence Selection from Annotation</strong>
-</p>
-<p>
-    Sequences associated with sequence (or sequence group) annotations can be selected by
-    double-clicking the annotation label with these key combinations:
-    <ul>
-    <li>double-click - Select associated sequences (replaces current selection)</li>
-    <li>shift double-click - add  sequences to selection</li>
-    <li>Ctrl (Mac CMD) double-click - toggles inclusion of associated sequences in the current selection</li>
-    </ul>
-    Note this also works in combination with manual sequence selection in the alignment.
-<p><strong>Interactive Alignment Annotation</strong></p>
-<p>
-Annotation rows are added using the <strong>Annotation Label</strong>
-menu, which is obtained by clicking anywhere on the annotation row labels
-area (below the sequence ID area).
-</p>
-<ul>
-  <li><strong>Add New Row</strong><br>
-    <em>Adds a new, named annotation row (a dialog box will pop up for you to 
-    enter the label for the new row). </em> </li>
-  <li><strong>Edit Label/Description</strong><br>
-    <em>This opens a dialog where you can change the name (displayed label), or the description
-    (as shown on the label tooltip) of the clicked annotation. </em> </li>
-  <li><strong>Hide This Row</strong><br>
-    <em>Hides the annotation row whose label was clicked in order to bring up 
-    the menu.</em> </li>
-  <li><strong>Hide All <em>&lt;label&gt;</em></strong><br>
-    <em>Hides all annotation rows whose label matches the one clicked. 
-    (This option is only shown for annotations that relate to individual sequences, 
-    not for whole alignment annotations. Since Jalview 2.8.2.)</em> </li>
-  <li><strong>Delete This Row</strong><br>
-    <em>Deletes the annotation row whose label was clicked in order to bring up 
-    the menu.</em> </li>
-  <li><strong>Show All Hidden Rows</strong><br>
-    <em>Shows all hidden annotation rows.</em> </li>
-          <li><strong>Export Annotation</strong> <em>(Application only)</em><br>
-       <em>Annotations can be saved to file or output to a text window in either the 
-        Jalview annotations format or as a spreadsheet style set of comma separated values (CSV). </em> </li>
-      <li><strong>Show Values in Text Box</strong> <em>(applet only)</em><br>
-        <em>Opens a text box with a list of comma-separated values corresponding 
-        to the annotation (numerical or otherwise) at each position in the row. 
-        This is useful to export alignment quality measurements for further analysis.</em> 
-      </li>
-      <li><strong>Scale Label To Column</strong><em>(introduced in 2.5)</em><br>
-      <em>Selecting this toggles whether column labels will be shrunk to fit within each column, or displayed using the view's standard font size.</em></li>
-</ul>
-<p>
-<strong>Editing Label and secondary structure Annotation</strong></p>
-<p>
-Use the <strong>left mouse button</strong> to select a position along the row that are to
-be annotated - these regions will be coloured red. <strong>Control</strong> and <strong>shift</strong> in combination
-with the left-click will select more than one position, or a range of
-positions on the alignment.
-</p>
-<p>Once the desired position has been selected, use the <strong>right mouse
-button</strong> to open the <strong>annotation menu</strong>:</p>
-<ul>
-<li>Helix<br><em>Mark selected positions with a helix glyph (a red
-oval), and optional text label (see below). A
-dialog box will open for you to enter the text. Consecutive ovals
-will be rendered as an unbroken red line.</em>
-</li>
-<li>Sheet<br><em>Mark selected positions with a sheet glyph (a green
-arrow oriented from left to right), and optional text label (see
-below). A dialog box will open for you to enter the text. Consecutive
-arrows will be joined together to form a single green arrow.</em>
-</li>
-<li><a name="rna">RNA Helix</a> (only shown when working with nucleotide sequences)<br>
-<em>Mark selected positions as participating in a base pair
-either upstream or downstream. When the dialog box opens, enter a
-'(' to indicate these bases pair with columns upstream (to right),
-and ')' to indicate this region pairs with bases to the left of the
-highlighted columns.<br />If any brackets do not match up, then an
-orange square will highlight the first position where a bracket was
-found not to match.
-</em>
-</li>
-<li>Label<br><em>Set the text label at the selected positions. A
-dialog box will open for you to enter the text.  If
-more than one consecutive position is marked with the same label, only
-the first position's label will be rendered.</em>
-</li>
-<li>Colour<br><em>Changes the colour of the annotation text label.</em>
-</li>
-<li>Remove Annotation<br><em>Blanks any annotation at the selected positions on
-the row. Note: <strong>This cannot be undone</strong></em>
-</li>
-</ul>
-<p>
-User defined annotation is stored and retrieved using <a
-href="../features/jalarchive.html">Jalview Archives</a>.
-</p>
-<p><em>Current Limitations</em></p>
-<p>As of version 2.5, the Jalview user interface does not support the 
-creation and editing of quantitative annotation (histograms and line graphs), or 
-to create annotation associated with a specific sequence. It is also incapable of
-annotation grouping or changing the style of existing annotation (to change between line or bar charts, or to make multiple line graphs). These annotation capabilities are only possible by the import of an 
-<a href="annotationsFormat.html">Annotation file</a>.<br>
-</p>
+  <p>
+    In addition to the definition of groups and sequence features,
+    Jalview can display symbols and graphs under the columns of an
+    alignment. These annotation tracks are displayed in the annotation
+    area below the alignment. The annotation area's visibility is
+    controlled with the <strong>View&#8594;Show Annotation</strong>
+    option.
+  </p>
+  <p>
+    <strong>Types of annotation</strong>
+  <ul>
+    <li><a name="seqannots"><strong>Sequence
+          associated annotation.</strong></a><br/>Data displayed on sequence annotation
+      rows are associated with the positions of a sequence. Often this
+      is 'Reference annotation' such as secondary structure information
+      derived from 3D structure data, or from the results of sequence
+      based prediction of <a href="../webServices/jnet.html">secondary
+        structure</a> and <a href="../webServices/proteinDisorder.html">disorder</a>.
+      If reference annotation is available for a the currently selected
+      sequences, it can be shown by selecting the <strong>Add
+        Reference Annotation</strong> option in the sequence or selection popup
+      menu.</li>
+    <li><strong>Group associated annotation.</strong><br/>Data can be associated with
+      groups defined on the alignment.     If sequence groups are defined, <a
+      href="../calculations/conservation.html">Conservation</a> and <a
+      href="../calculations/consensus.html">Consensus</a> annotation can
+    be enabled for each group from the <a
+      href="../menus/alwannotation.html">Annotations menu</a>, or can be
+    imported from a Jalview <a href="annotationsFormat.html">Annotations
+      file</a>.</li>
+    <li><strong>Alignment associated annotation.</strong><br />Annotation rows
+      associated with columns on the alignment are simply 'alignment
+      annotation'. Controls allow you to <a href="#iaannot">interactively create
+        alignment annotation</a> to add labels and symbols to alignment columns.
+      Jalview's consensus, conservation and quality calculations also
+      create histogram and sequence logo annotations on the alignment.
+    </li>
+  </ul>
+  <p>
+    <strong>Importing and exporting annotation</strong><br />
+    Annotations on an alignment view are saved in Jalview project files.
+    You can also load <a href="annotationsFormat.html">Annotations
+      Files</a> in order to add any kind of quantitative and symbolic
+    annotations to an alignment. To see an example, use the <strong>Export
+      Features/Annotation</strong> option from an alignment window's File menu.
+  </p>
+  <p>
+    <strong>Layout and display controls</strong><br /> Individual and
+    groups of annotation rows can be shown or hidden using the pop-up
+    menu obtained by right-clicking the label. You can also reorder them
+    by dragging the label to a new position with the left mouse button.
+    The
+    <strong>Annotations</strong> menu provides settings controlling the
+    ordering and display of sequence, group and alignment associated
+    annotation. The
+    <strong>Colour by annotation</strong> option in the colour menu
+    allows annotation to be used to
+    <a href="../colourSchemes/annotationColouring.html">shade the
+      alignment</a>. Annotations can also be used to
+    <a href="../features/columnFilterByAnnotation.html">select or
+      hide columns</a> via the dialog opened from the
+    <strong>Selection</strong> menu.
+  </p>
+  <p>
+    <strong>Sequence Highlighting and Selection from Annotation</strong>
+  </p>
+  <p>
+    A <strong>single click</strong> on the label of an annotation row
+    associated with sequences and sequence groups will cause the
+    associated sequences to be highlighted in the alignment view. <strong>Double
+      clicking</strong> the label will select the associated sequences, replacing
+    any existing selection. Like with other kinds of selection, <strong>shift
+      double-click</strong> will add associated sequences, and <strong>Ctrl
+      (Mac CMD) double-click</strong> will toggle inclusion of associated
+    sequences in the selection.
+  <p>
+    <strong>Interactive Alignment Annotation</strong>
+  </p>
+  <p>
+    <a name="iaannot"> Annotation rows</a> are added using the <strong>Annotation
+      Label</strong> menu, which is obtained by clicking anywhere on the
+    annotation row labels area (below the sequence ID area).
+  </p>
+  <ul>
+    <li><strong>Add New Row</strong><br> <em>Adds a new,
+        named annotation row (a dialog box will pop up for you to enter
+        the label for the new row). </em></li>
+    <li><strong>Edit Label/Description</strong><br> <em>This
+        opens a dialog where you can change the name (displayed label),
+        or the description (as shown on the label tooltip) of the
+        clicked annotation. </em></li>
+    <li><strong>Hide This Row</strong><br> <em>Hides the
+        annotation row whose label was clicked in order to bring up the
+        menu.</em></li>
+    <li><strong>Hide All <em>&lt;label&gt;</em></strong><br> <em>Hides
+        all annotation rows whose label matches the one clicked. (This
+        option is only shown for annotations that relate to individual
+        sequences, not for whole alignment annotations. Since Jalview
+        2.8.2.)</em></li>
+    <li><strong>Delete This Row</strong><br> <em>Deletes
+        the annotation row whose label was clicked in order to bring up
+        the menu.</em></li>
+    <li><strong>Show All Hidden Rows</strong><br> <em>Shows
+        all hidden annotation rows.</em></li>
+    <li><strong>Export Annotation</strong> <em>(Application
+        only)</em><br> <em>Annotations can be saved to file or
+        output to a text window in either the Jalview annotations format
+        or as a spreadsheet style set of comma separated values (CSV). </em>
+    </li>
+    <li><strong>Show Values in Text Box</strong> <em>(applet
+        only)</em><br> <em>Opens a text box with a list of
+        comma-separated values corresponding to the annotation
+        (numerical or otherwise) at each position in the row. This is
+        useful to export alignment quality measurements for further
+        analysis.</em></li>
+    <li><strong>Scale Label To Column</strong><em>(introduced
+        in 2.5)</em><br> <em>Selecting this toggles whether column
+        labels will be shrunk to fit within each column, or displayed
+        using the view's standard font size.</em></li>
+  </ul>
+  <p>
+    <strong>Editing labels and secondary structure annotation rows</strong>
+  </p>
+  <p>
+    Use the <strong>left mouse button</strong> to select a position
+    along the row that are to be annotated - these regions will be
+    coloured red. Press <strong>Control</strong> or <strong>shift</strong> in
+    combination with the left-click to either select an additional position,
+    or a range of positions on the alignment.
+  </p>
+  <p>
+    Once positions have been selected, use the <strong>right
+      mouse button</strong> and select one of the following from the <strong>annotation menu</strong>:
+  </p>
+  <ul>
+    <li>Helix<br>
+    <em>Marks selected positions with a helix glyph (a red oval),
+        and optional text label (see below). A dialog box will open for
+        you to enter the text. Consecutive ovals will be rendered as an
+        unbroken red line.</em>
+    </li>
+    <li>Sheet<br>
+    <em>Marks selected positions with a sheet glyph (a green arrow
+        oriented from left to right), and optional text label (see
+        below). A dialog box will open for you to enter the text.
+        Consecutive arrows will be joined together to form a single
+        green arrow.</em>
+    </li>
+    <li><a name="rna">RNA Helix</a> (only shown when working with
+      nucleotide sequences)<br> <em>Marks selected positions
+        as participating in a base pair either upstream or downstream.
+        When the dialog box opens, enter a '(' to indicate these bases
+        pair with columns upstream (to right), and ')' to indicate this
+        region pairs with bases to the left of the highlighted columns.
+        Other kinds of base-pair annotation are also supported (e.g. 'A'
+        and 'a', or '&lt;' and '&gt;'), and Jalview will suggest an
+        appropriate symbol based on the closest unmatched
+        parenthesis to the left.<br />If any brackets do not match up, then an
+        orange square will highlight the first position where a bracket
+        was found not to match.
+    </em></li>
+    <li>Label<br>
+    <em>Set the text label at the selected positions. A dialog box
+        will open for you to enter the text. If more than one
+        consecutive position is marked with the same label, only the
+        first position's label will be rendered.</em>
+    </li>
+    <li>Colour<br>
+    <em>Changes the colour of the annotation text label.</em>
+    </li>
+    <li>Remove Annotation<br>
+    <em>Blanks any annotation at the selected positions on the row.
+        Note: <strong>This cannot be undone</strong>
+    </em>
+    </li>
+  </ul>
+  <p>
+    User defined annotation is stored and retrieved using <a
+      href="../features/jalarchive.html">Jalview Archives</a>.
+  </p>
+  <p>
+    <em>Current Limitations</em>
+  </p>
+  <p>
+    The Jalview user interface does not support interactive
+    creation and editing of quantitative annotation (histograms and line
+    graphs), or to create annotation associated with a specific
+    sequence or group. It is also incapable of annotation grouping or changing
+    the style of existing annotation (e.g. to change between line or bar
+    charts, or to make multiple line graphs). These annotation
+    capabilities are only possible by the import of an <a
+      href="annotationsFormat.html">Annotation file</a>.<br>
+  </p>
 </body>
 </html>
diff --git a/help/html/features/ensemblsequencefetcher.html b/help/html/features/ensemblsequencefetcher.html
new file mode 100644 (file)
index 0000000..2a62caa
--- /dev/null
@@ -0,0 +1,56 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<head>
+<title>Fetching ENSEMBL Data in Jalview</title>
+</head>
+<body>
+
+  <strong>Fetching ENSEMBL Data in Jalview</strong>
+  <br /> Jalview Version 2.10 (September 2016) introduced support to
+  retrieve annotated transcripts, peptides and genomic contigs from
+  <a href="http://www.ensembl.org">ENSEMBL</a>.
+  <br />
+  <img src="selectfetchdb.gif" align="left" width="480" height="204"
+    alt="Database selection dialog for fetching sequences (introduced in Jalview 2.8)">
+
+  <p>Two types of ENSEMBL source are provided. ENSEMBL queries the
+    main ENSEMBL site, which only serves data for higher eukaryotes, and
+    EnsemblGenomes, which provides access to Ensembl Pathogens, and
+    other warehouses.</p>
+    <p><strong>General Use</strong><br/> If you have a set of Ensembl
+    peptide or transcript IDs, then you can retrieve them
+    <em>via</em> the sequence fetcher dialog opened after selecting the
+    most appropriate source (either 'ENSEMBL', or Ensembl Genomes).
+    However, Jalview's Ensembl client has a couple of additional
+    capabilities: </p><p><strong>Retrieving aligned transcripts for a genomic ID</strong>
+  </p>
+  <p>If a single genomic identifier is entered in the
+    Ensembl fetcher, Jalview will return all transcripts and products
+    for the locus, and display them in a split view - complete with
+    sequence variant annotation.</p>
+  <p><strong>Retrieving orthologs for a gene ID</strong></p>
+  <p>If a gene ID is entered (e.g. fox1), Jalview will resolve
+    Ensembl genomic identifiers for a predefined set of taxa (Mouse,
+    Rat, Human, Yeast in Jalview 2.10).
+    </p>
+</body>
+</html>
\ No newline at end of file
index 200fc8f..b7738cd 100755 (executable)
   </p>
   <p>
     <strong><em>Feature settings pop-up menu</em></strong><br> <strong>Right-click</strong>
-    on a feature to open a pop-up menu that allows you to sort the
-    alignment or current selection using that feature type (see below),
-    or toggle the type of colouring used for the feature. Features may
-    be highlighted with either a single colour or a <a
-      href="featureschemes.html"
-    >feature colourscheme</a> based on either the scores associated with
-    that feature or from the feature's description (e.g. to distinguish
+    on a feature to open a pop-up menu that allows you to<ul><li>Hide, show and
+    select columns containing that feature</li><li>Sort the alignment or
+    current selection using that feature type (see below)</li><li>Toggle the
+    type of colouring used for the feature</li></ul><p>Features may be highlighted
+    with either a single colour or a <a href="featureschemes.html">feature
+      colourscheme</a> based on either the scores associated with that
+    feature or from the feature's description (e.g. to distinguish
     different names associated with a DOMAIN feature).
   </p>
   <p>
index a2bc627..079cf9e 100644 (file)
     <strong>The Groovy Shell</strong>
   </p>
   <p>
-    <a href="http://www.groovy-lang.org/">Groovy</a> is an &quot;<em>agile
-      and dynamic language for the Java platform</em>&quot;. The groovy
-    scripting language makes it extremely easy to programmatically
-    interact with Java programs, in much the same way that Javascript is
-    used to generate and interact with applets and other objects on the
-    page.
+    Groovy (<a href="http://www.groovy-lang.org/">www.groovy-lang.org</a>)
+    is an &quot;<em>agile and dynamic language for the Java
+      platform</em>&quot;. The groovy scripting language makes it extremely
+    easy to programmatically interact with Java programs, in much the
+    same way that Javascript is used to generate and interact with
+    applets and other objects on the page.
   </p>
   <p>
-    <strong><em>Getting Groovy...</em> </strong><br> Jalview comes with
-    an embedded installation of Groovy. All you need is to select <strong>Tools&#8594;Groovy
-      Console...</strong> menu option from the Jalview Desktop's
-    drop-down menu. After a short pause, you should then see the <a
-      href="http://groovy-lang.org/groovyconsole.html"
-    >Groovy Console</a> appear. This allows you to interactively execute Groovy
-    scripts within the Jalview run-time environment.
+    <em>Getting Groovy...</em><br> Jalview comes with an embedded
+    installation of Groovy. Just select <strong>Tools&#8594;Groovy
+      Console...</strong> from the Jalview Desktop's drop-down menu. After a
+    short pause, you should then see the <a
+      href="http://groovy-lang.org/groovyconsole.html">Groovy
+      Console</a> appear. This allows you to interactively execute Groovy
+    scripts whilst Jalview is running. We've also provided a <strong>Calculations&#8594;Execute
+      Groovy Script</strong> button so you can execute the currently loaded
+    groovy script whilst viewing an alignment.
   </p>
   <p>
     <strong>Executing groovy scripts on Jalview startup</strong><br>
     </em>
   </p>
   <p>
-    <strong>Executing a groovy script on a particular alignment</strong><br/>
-    
-  <p>
     <strong>Access to Jalview's functions from Groovy Scripts</strong><br>
-    There is as yet no properly defined scripting interface to Jalview,
-    but all the public methods of the jalview class hierarchy can be
-    called from Groovy scripts. The access point for this is the <strong>Jalview</strong>
-    object defined in the groovy environment which corresponds to the
-  <pre>jalview.gui.Desktop</pre>
-  object which manages all the Jalview windows. Here's an example to get
-  you started:
-  <br>
+    The scripting interface to Jalview is still a work in progress, so
+    we recommend you also take a look at Jalview's source, since all the
+    public methods of the jalview class hierarchy can be called from
+    Groovy scripts. In addition, the following objects are also defined:
+
+  
+  <ul>
+    <li><strong>Jalview</strong> - this is bound to <code>jalview.bin.Jalview</code>.<br />Useful
+      methods include:
+      <ul>
+        <li>Jalview.getAlignFrames() - returns a list of
+          jalview.gui.AlignFrame objects</li>
+        <li>Jalview.getCurrentAlignFrame() - returns the alignment
+          window which is currently being looked at by the user</li>
+      </ul></li>
+    <li><strong>currentAlFrame</strong> - this is only defined when
+      running a Groovy script via the -groovy command line argument. It
+      returns the first alignment window created after acting on the
+      other arguments passed on the command line.</li>
+  </ul>
+  <p>
+    <em>A simple script</em><br />
   <ul>
     <li>Getting the title, alignment and first sequence from the
       current alignFrame<br> <pre>
@@ -77,13 +90,26 @@ def alignment = alf[0].viewport.alignment;
 def seq = alignment.getSequenceAt(0);
 </pre>
     </li>
-    <li>When running a groovy script from the command line, the
-      alignment that was just loaded can be referred to like so:<br>
-    <pre>
+    <li>If you wanted to do the same thing from the command line, you can refer to
+      alignment that was just loaded with currentAlFrame:<br>
+      <pre>
 print currentAlFrame.getTitle();</pre>
   </ul>
-  If you have downloaded the InstallAnywhere version of Jalview, you can
-  find additional groovy scripts in the examples/groovy subfolder of the
-  installation directory.
+  <p>
+    <em>Example scripts</em><br />If you have downloaded the
+    InstallAnywhere version of Jalview, you can find additional groovy
+    scripts in the examples/groovy subfolder of the installation
+    directory. The examples are also available at <a
+      href="http://www.jalview.org/examples/groovy">http://www.jalview.org/examples/groovy</a>.
+  </p>
+  <p>
+    <em>Using Groovy to add new Alignment Calculations</em><br />We've
+    simplified the alignment analysis programming interface in Jalview
+    2.10 to make it easy for you to add your own dynamic annotation
+    tracks with Groovy. Have a look at the <a
+      href="../groovy/featureCounter.html">featureCounter.groovy</a>
+    example for more information.
+  </p>
+
 </body>
 </html>
index 6e1ce10..de0a7e6 100644 (file)
Binary files a/help/html/features/selectfetchdb.gif and b/help/html/features/selectfetchdb.gif differ
index ff5c1b0..04d3c1d 100755 (executable)
     Institute, or, since Jalview 2.4, DAS servers capable of the <em>sequence</em>
     command (configured in <a href="dassettings.html">DAS settings</a>).
   </p>
-  <img src="seqfetcher.gif" align="center"
-    alt="The Jalview Sequence Fetcher Dialog Box"
-  >
-  <p>The Sequence Fetcher dialog box can be opened via the
+  <p>The Sequence Fetcher can be opened via the
     &quot;File&quot; menu on the main desktop in order to retrieve
     sequences as a new alignment, or opened via the &quot;File&quot;
     menu of an existing alignment to import additional sequences. There
     whilst Jalview compiles the list of available sequence datasources
     from the currently defined DAS server registry.</p>
   <p>
-    First, <strong>select the database you want to retrieve
-      sequences from</strong> by clicking the button labeled 'Select database
-    retrieval source'. If a database source is already selected, then
-    the button's label will change to show the currently selected
-    database.
+    Every time a new fetcher is opened, you will need to <strong>select the database you want to retrieve
+      sequences</strong> from the database chooser.
   </p>
-  <img src="selectfetchdb.gif" align="left"
+  <img src="selectfetchdb.gif" align="left" width="480" height="204"
     alt="Database selection dialog for fetching sequences (introduced in Jalview 2.8)"
   >
-  <p>Since Jalview 2.8, the available databases are shown as a tree
-    in a popup dialog box. The databases are ordered alphabetically, and
-    if there are many sources for the same type of sequence identifier,
-    they will be grouped together in a sub-branch branch labeled with
-    the identifier.</p>
-  <p>
-    Once you have selected the sequence database using the popup dialog
-    box, <strong>enter one or more accession ids</strong> (as a
-    semi-colon separated list), or press the &quot;Example&quot; button
-    to paste the example accession for the currently selected database
-    into the retrieval box. Finally, press &quot;OK&quot; to initiate
-    the retrieval.
-  </p>
-  <p>
-    <strong>Fetching from The PDB with the EMBL-EBI PDBe Search
-      Interface</strong>
-  </p>
-  <p>
-    Since Jalview 2.9, selecting PDB as the sequence database will open
-    the <a href="pdbsequencefetcher.html">PDB Sequence Fetcher</a> for
-    discovering and retrieving structures.
-  </p>
+  <p>The databases are shown as a tree, and ordered alphabetically;
+    tooltips are shown if you mouse over some sources, explaining what
+    the database will retrieve. You can select one by using the up/down
+    arrow keys and hitting return, or by double clicking with the mouse.
+    <br/><em>If you have DAS sources enabled, then you may have several sources
+    for the same type of sequence identifier, and these will be grouped
+    together in a sub-branch branch labeled with the identifier.</em></p>
+  <p>Once you have selected a sequence database, its fetcher dialog
+    will open. Jalview provides two types of dialog:</p>
+    <ol><li><strong>The Free-text Search Interface</strong>
+  
+  <br/>Free-text search clients are provided for PDB (Since 2.9), and
+    UniProt (Since 2.10). They provide access to each database's own
+    query system, enabling you to retrieve data by accession, free text
+    description, or any other type of supported field. For full details,
+    see each client's help page:
+  <ul>
+    <li><a href="pdbsequencefetcher.html">PDB Sequence Fetcher</a></li>
+    <li><a href="uniprotsequencefetcher.html">UniProt Sequence
+        Fetcher</a></li>
+  </ul>
+  </li>
+  <li><strong>Accession based sequence retrieval</strong>
+  <br/>
+
+  <img src="seqfetcher.gif" align="center"
+    alt="The Jalview Sequence Fetcher Dialog Box"><br/>
+  To retrieve sequences, simply <strong>enter one or more accession ids</strong> (as a semi-colon
+  separated list), or press the &quot;Example&quot; button to paste the
+  example accession for the currently selected database into the
+  retrieval box. Finally, press &quot;OK&quot; to initiate the
+  retrieval.
+  </li>
+  </ol>
   <p>
     <strong>Only retrieving part of a sequence</strong>
   </p>
   <p>
-    DAS sources (indicated by a &quot;<em>(DAS)</em>&quot;) allow a
-    range to be specified in addition to a sequence ID. To retrieve 50
-    residues starting at position 35 in UNIPROT sequence P73137 using
-    the UNIPROT DAS server, you would enter &quot;'P73137:35,84'.<br />
-    <em>Full support for DAS range queries was introduced in
-      Jalview 2.8</em>
+    When using DAS sources (indicated by a &quot;<em>(DAS)</em>&quot;),
+    you can append a range in addition to a sequence ID. For example, to
+    retrieve 50 residues starting at position 35 in UNIPROT sequence
+    P73137 using the UNIPROT DAS server, you would enter
+    &quot;'P73137:35,84'.<br /> <em>Full support for DAS range
+      queries was introduced in Jalview 2.8</em>
   </p>
 
   <p>If you use the WSDBFetch sequence fetcher services (EMBL,
index f5f5916..c9600bb 100644 (file)
     <strong>Structure Chooser</strong>
   </p>
 
-  The Structure Chooser interface provides a smart technique for
-  selecting PDB structures to view in Jalview by querying readily
-  available meta-data of structures. The Interface can be invoked by
-  selecting the
-  <strong>"3D Structure Data.."</strong> option from a sequence's
-  <a href="../menus/popupMenu.html">pop-up menu</a>. Some of the main
-  features it provides are listed below:
+  <p>
+    The Structure Chooser interface allows you to interactively select
+    which PDB structures to view for the currently selected set of
+    sequences. It's opened by selecting the <strong>"3D
+      Structure Data.."</strong> option from the Sequence ID panel's <a
+      href="../menus/popupMenu.html">pop-up menu</a>. The dialog
+    provides:
+  </p>
   <ul>
     <li>Automatic discovery, retrieval and association of PDB
-      entries for an alignment's sequences</li>
-    <li>Visualisation of discovered structures' meta-data</li>
-    <li>Ability to configure the meta-data entries to visualise</li>
-    <li>Auto-selection of the best structure via filtering by the
-      available metric parameters in the meta-data (i.e. resolution,
-      quality etc).</li>
-    <li>Selection of multiple structures in a single operation</li>
+      entries for sequences</li>
+    <li>Exploration of meta-data for available 3D structures</li>
+    <li>Automatic selection of the 'best structure' to display for
+      each sequence</li>
+    <li>Manual association of PDB entries by entering a PDB Id</li>
+    <li>Association of structure data from a local file (in mmCIF
+      or PDB format)</li>
   </ul>
-  Additionally, the Structure Chooser retains the following contemporary
-  features of Jalview:
-  <ul>
-    <li>Manual association of PDB entries via entering the PDB Id
-      or From File</li>
-    <li>Ability to view cached PDB entries</li>
-  </ul>
-
 
-  <strong>Associating PDB files with Sequences</strong>
-  <br> Discovery/Association of PDB entries to a sequence now
-  happens automatically during the initialisation of the Structure
-  Chooser Interface. Jalview uses the sequence's ID to query the PDB
-  Rest API provided by the EBI to discover PDB Ids associated with the
-  sequence.
-
-  <br>
-  <br>
-  <strong>Configuring displayed meta-data for Structures</strong>
-  <br> To configure the visible meta-data displayed for the
-  discovered structures, click the 'Configure Displayed Columns' tab,
-  then tick the options which you intend to make visible.
-
-  <br>
-  <br>
-  <strong>Auto-selection of best Structures</strong>
-  <br> Jalview can automatically filter and select the best
-  structures using various metric categories avaialble from the
-  meta-data of the structures. To perform this simply select any of the
-  following options from the drop-down menu in the Structure Chooser
-  interface: Best UniProt coverage, Higest Resolution, Best Quality,
-  Highest Protein Chain etc. When the 'Invert' option is selected,
-  Jalview returns an inverse result for the current selected option in
-  the drop-down menu.
+  <p>
+    <strong>Automated discovery of structure data</strong>
+  </p>
+  <p>After selecting "3D Structure Data ..", Jalview queries the PDB
+    via the PDBe SOLR Rest API provided by EMBL-EBI to discover PDB ids
+    associated with the sequence. It does this based on the sequence's
+    ID string, and any other associated database IDs.</p>
+  <p>
+    <strong>Exploration of meta-data for available structures</strong>
+  </p>
+  <p>Information on each structure available is displayed in columns
+    in the dialog box. By default, only the title, resolution and PDB
+    identifier are shown, but many more are provided by the PDBe. To
+    configure which ones are displayed, select the 'Configure Displayed
+    Columns' tab and tick the columns which you want to see.</p>
+  <p>
+    <strong>Selection of the best structure for each sequence</strong>
+  </p>
+  <p>Jalview can automatically select the best structures according
+    to meta-data provided by the PDB. By default, the 'Best Quality'
+    structure for each sequence will be selected, but clicking on the
+    drop down menu allows other criteria to be chosen, including
+    Resolution (only defined for X-Ray structures), Highest Protein
+    Chain etc. When 'Invert' is selected, structures are selected in
+    reverse order for the current criteria (e.g. worst quality rather
+    than best).</p>
   <p>
 
     <img src="schooser_main.png" style="width: 464px; height: 369px;">
     sample alignment. Note however that if no structures were
     auto-discovered, a different interface for manual association will
     be invoked as seen in the screenshot below.
+  
   <p>
     <img src="schooser_enter-id.png"
-      style="width: 464px; height: 369px;"
-    >
+      style="width: 464px; height: 369px;">
+  
   <p>
     <strong>Manual selection/association of PDB files with
       Sequences</strong>
   </p>
-  <p>To manually associate PDB files with a sequence, select any of
-    the follwing options listed below from the drop-down menu in the
-    interface:
+  <p>To manually associate PDB files with a sequence, select 'From
+    File', or 'Enter PDB Id' from the drop-down menu:
+  
   <ul>
-    <li><strong>From File</strong> - You can load a PDB file from
-      the local machine or network and associate it with the selected
-      sequence. PDB files associated in this way will also be saved in
-      the <a href="jalarchive.html">Jalview Archive file</a>.<br></li>
-    <li><strong>Enter PDB Id</strong> - Jalview will use the PDB
-      Rest API, provided by the EBI, to fetch the PDB file with the
-      entered Id.<br></li>
-    <li><strong>Cached PDB Entries</strong> - You can view PDB
-      structures which have previously been downloaded/viewed using this
-      option. Jalview caches previously downloaded PDB entries in the
-      computer memory. However, if the project is saved before exiting
-      Jalview, Jalview will serialize the cached entries to the file
-      system.</li>
+    <li><strong>From File</strong> - allows you to load a PDB file
+      from the local machine or network and associate it with the
+      selected sequence. PDB files associated in this way will also be
+      saved in the <a href="jalarchive.html">Jalview Archive file</a>.<br></li>
+    <li><strong>Enter PDB Id</strong> - allows you specify a PDB ID
+      for your sequence. The PDB Rest API, provided by EMBL-EBI, is used
+      to validate and fetch structure data.<br></li>
   </ul>
+  <p>
+    <strong>Viewing existing structures for your sequences</strong>
+  </p>
+  <p>
+    If you have previously associated structure data on the alignment,
+    selecting <strong>Cached PDB Entries</strong> from the drop down
+    menu allows you to select these structures for display.
+  </p>
 
   <p>
     <em>The Structure Chooser interface was introduced in Jalview
diff --git a/help/html/groovy/featureCounter.html b/help/html/groovy/featureCounter.html
new file mode 100644 (file)
index 0000000..fe848a9
--- /dev/null
@@ -0,0 +1,262 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<head>
+<title>Extending Jalview with Groovy - Feature Counter Example</title>
+</head>
+<body>
+  <p>
+    <strong>Extending Jalview with Groovy - A customisable
+      feature counter</strong><br /> 
+    <br />The groovy script below shows how to add a new calculation
+    track to a Jalview alignment window.</p><p>As currently written, it will
+    add two tracks to a protein alignment view which count Pfam features
+    in each column, and ones where a charge residue also occur.</p><p>To try
+    it for yourself:</p><ol><li>Copy and paste it into the groovy script
+    console</li><li>Load the example Feredoxin project (the one that opens
+    by default when you first launched Jalview)</li><li>Select <strong>Calculations&#8594;Execute
+      Groovy Script</strong> from the alignment window's menu bar to run the script on
+    the current view.</li></ol>
+  <em><a
+      href="http://www.jalview.org/examples/groovy/featureCounter.groovy">http://www.jalview.org/examples/groovy/featureCounter.groovy</a> - rendered with <a href="http://hilite.me">hilite.me</a></em>
+  <!-- HTML generated using hilite.me -->
+  <div
+    style="background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;">
+    <pre style="margin: 0; line-height: 125%">
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * Jalview - A Sequence Alignment Editor and Viewer (Version 2.10)</span>
+<span style="color: #888888"> * Copyright (C) 2016 The Jalview Authors</span>
+<span style="color: #888888"> * </span>
+<span style="color: #888888"> * This file is part of Jalview.</span>
+<span style="color: #888888"> * </span>
+<span style="color: #888888"> * Jalview is free software: you can redistribute it and/or</span>
+<span style="color: #888888"> * modify it under the terms of the GNU General Public License </span>
+<span style="color: #888888"> * as published by the Free Software Foundation, either version 3</span>
+<span style="color: #888888"> * of the License, or (at your option) any later version.</span>
+<span style="color: #888888"> *  </span>
+<span style="color: #888888"> * Jalview is distributed in the hope that it will be useful, but </span>
+<span style="color: #888888"> * WITHOUT ANY WARRANTY; without even the implied warranty </span>
+<span style="color: #888888"> * of MERCHANTABILITY or FITNESS FOR A PARTICULAR </span>
+<span style="color: #888888"> * PURPOSE.  See the GNU General Public License for more details.</span>
+<span style="color: #888888"> * </span>
+<span style="color: #888888"> * You should have received a copy of the GNU General Public License</span>
+<span style="color: #888888"> * along with Jalview.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
+<span style="color: #888888"> * The Jalview Authors are detailed in the &#39;AUTHORS&#39; file.</span>
+<span style="color: #888888"> */</span>
+<span style="color: #008800; font-weight: bold">import</span> <span
+        style="color: #0e84b5; font-weight: bold">jalview.workers.FeatureCounterI</span><span
+        style="color: #333333">;</span>
+<span style="color: #008800; font-weight: bold">import</span> <span
+        style="color: #0e84b5; font-weight: bold">jalview.workers.AlignmentAnnotationFactory</span><span
+        style="color: #333333">;</span>
+
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * Example script that registers two alignment annotation calculators</span>
+<span style="color: #888888"> * - one that counts residues in a column with Pfam annotation</span>
+<span style="color: #888888"> * - one that counts only charged residues with Pfam annotation</span>
+<span style="color: #888888"> *</span>
+<span style="color: #888888"> * To try:</span>
+<span style="color: #888888"> * 1. load uniref50.fa from the examples folder</span>
+<span style="color: #888888"> * 2. load features onto it from from examples/exampleFeatures.txt</span>
+<span style="color: #888888"> * 3. Open this script in the Groovy console.</span>
+<span style="color: #888888"> * 4. Either execute this script from the console, or via Calculate-&gt;Run Groovy Script</span>
+<span style="color: #888888"> </span>
+<span style="color: #888888"> * To explore further, try changing this script to count other kinds of occurrences of </span>
+<span style="color: #888888"> * residue and sequence features at columns in an alignment.</span>
+<span style="color: #888888"> */</span>
+
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * A closure that returns true for any Charged residue</span>
+<span style="color: #888888"> */</span>
+<span style="color: #333399; font-weight: bold">def</span> isCharged <span
+        style="color: #333333">=</span> <span style="color: #333333">{</span> residue <span
+        style="color: #333333">-&gt;</span>
+    <span style="color: #008800; font-weight: bold">switch</span><span
+        style="color: #333333">(</span>residue<span
+        style="color: #333333">)</span> <span style="color: #333333">{</span>
+        <span style="color: #008800; font-weight: bold">case</span> <span
+        style="color: #333333">[</span><span
+        style="background-color: #fff0f0">&#39;D&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;d&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;E&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;e&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;H&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;h&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;K&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;k&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;R&#39;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&#39;r&#39;</span><span
+        style="color: #333333">]:</span>
+            <span style="color: #008800; font-weight: bold">return</span> <span
+        style="color: #008800; font-weight: bold">true</span>
+    <span style="color: #333333">}</span>
+    <span style="color: #008800; font-weight: bold">false</span>
+<span style="color: #333333">}</span> 
+
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * A closure that returns 1 if sequence features include type &#39;Pfam&#39;, else 0</span>
+<span style="color: #888888"> * Argument should be a list of SequenceFeature </span>
+<span style="color: #888888"> */</span>
+<span style="color: #333399; font-weight: bold">def</span> hasPfam <span
+        style="color: #333333">=</span> <span style="color: #333333">{</span> features <span
+        style="color: #333333">-&gt;</span> 
+    <span style="color: #008800; font-weight: bold">for</span> <span
+        style="color: #333333">(</span>sf <span
+        style="color: #008800; font-weight: bold">in</span> features<span
+        style="color: #333333">)</span>
+    <span style="color: #333333">{</span>
+        <span style="color: #888888">/*</span>
+<span style="color: #888888">         * Here we inspect the type of the sequence feature.</span>
+<span style="color: #888888">         * You can also test sf.description, sf.score, sf.featureGroup,</span>
+<span style="color: #888888">         * sf.strand, sf.phase, sf.begin, sf.end</span>
+<span style="color: #888888">         * or sf.getValue(attributeName) for GFF &#39;column 9&#39; properties</span>
+<span style="color: #888888">         */</span>
+        <span style="color: #008800; font-weight: bold">if</span> <span
+        style="color: #333333">(</span><span
+        style="background-color: #fff0f0">&quot;Pfam&quot;</span><span
+        style="color: #333333">.</span><span style="color: #0000CC">equals</span><span
+        style="color: #333333">(</span>sf<span style="color: #333333">.</span><span
+        style="color: #0000CC">type</span><span style="color: #333333">))</span>
+        <span style="color: #333333">{</span>
+            <span style="color: #008800; font-weight: bold">return</span> <span
+        style="color: #008800; font-weight: bold">true</span>
+        <span style="color: #333333">}</span>
+    <span style="color: #333333">}</span>
+    <span style="color: #008800; font-weight: bold">false</span>
+<span style="color: #333333">}</span>
+
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * Closure that computes an annotation based on </span>
+<span style="color: #888888"> * presence of particular residues and features</span>
+<span style="color: #888888"> * Parameters are</span>
+<span style="color: #888888"> * - the name (label) for the alignment annotation</span>
+<span style="color: #888888"> * - the description (tooltip) for the annotation</span>
+<span style="color: #888888"> * - a closure (groovy function) that tests whether to include a residue</span>
+<span style="color: #888888"> * - a closure that tests whether to increment count based on sequence features  </span>
+<span style="color: #888888"> */</span>
+<span style="color: #333399; font-weight: bold">def</span> getColumnCounter <span
+        style="color: #333333">=</span> <span style="color: #333333">{</span> name<span
+        style="color: #333333">,</span> desc<span style="color: #333333">,</span> acceptResidue<span
+        style="color: #333333">,</span> acceptFeatures <span
+        style="color: #333333">-&gt;</span>
+    <span style="color: #333333">[</span>
+     <span style="color: #997700; font-weight: bold">getName:</span> <span
+        style="color: #333333">{</span> name <span
+        style="color: #333333">},</span> 
+     <span style="color: #997700; font-weight: bold">getDescription:</span> <span
+        style="color: #333333">{</span> desc <span
+        style="color: #333333">},</span>
+     <span style="color: #997700; font-weight: bold">getMinColour:</span> <span
+        style="color: #333333">{</span> <span style="color: #333333">[</span><span
+        style="color: #0000DD; font-weight: bold">0</span><span
+        style="color: #333333">,</span> <span
+        style="color: #0000DD; font-weight: bold">255</span><span
+        style="color: #333333">,</span> <span
+        style="color: #0000DD; font-weight: bold">255</span><span
+        style="color: #333333">]</span> <span style="color: #333333">},</span> <span
+        style="color: #888888">// cyan</span>
+     <span style="color: #997700; font-weight: bold">getMaxColour:</span> <span
+        style="color: #333333">{</span> <span style="color: #333333">[</span><span
+        style="color: #0000DD; font-weight: bold">0</span><span
+        style="color: #333333">,</span> <span
+        style="color: #0000DD; font-weight: bold">0</span><span
+        style="color: #333333">,</span> <span
+        style="color: #0000DD; font-weight: bold">255</span><span
+        style="color: #333333">]</span> <span style="color: #333333">},</span> <span
+        style="color: #888888">// blue</span>
+     <span style="color: #997700; font-weight: bold">count:</span> 
+         <span style="color: #333333">{</span> res<span
+        style="color: #333333">,</span> feats <span
+        style="color: #333333">-&gt;</span> 
+            <span style="color: #333399; font-weight: bold">def</span> c <span
+        style="color: #333333">=</span> <span
+        style="color: #0000DD; font-weight: bold">0</span>
+            <span style="color: #008800; font-weight: bold">if</span> <span
+        style="color: #333333">(</span>acceptResidue<span
+        style="color: #333333">.</span><span style="color: #0000CC">call</span><span
+        style="color: #333333">(</span>res<span style="color: #333333">))</span>
+            <span style="color: #333333">{</span>
+                <span style="color: #008800; font-weight: bold">if</span> <span
+        style="color: #333333">(</span>acceptFeatures<span
+        style="color: #333333">.</span><span style="color: #0000CC">call</span><span
+        style="color: #333333">(</span>feats<span style="color: #333333">))</span>
+                <span style="color: #333333">{</span>
+                    c<span style="color: #333333">++</span>
+                <span style="color: #333333">}</span>
+            <span style="color: #333333">}</span>
+            c
+         <span style="color: #333333">}</span>
+     <span style="color: #333333">]</span> <span
+        style="color: #008800; font-weight: bold">as</span> FeatureCounterI
+<span style="color: #333333">}</span>
+
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * Define an annotation row that counts any residue with Pfam domain annotation</span>
+<span style="color: #888888"> */</span>
+<span style="color: #333399; font-weight: bold">def</span> pfamAnnotation <span
+        style="color: #333333">=</span> getColumnCounter<span
+        style="color: #333333">(</span><span
+        style="background-color: #fff0f0">&quot;Pfam&quot;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&quot;Count of residues with Pfam domain annotation&quot;</span><span
+        style="color: #333333">,</span> <span style="color: #333333">{</span><span
+        style="color: #008800; font-weight: bold">true</span><span
+        style="color: #333333">},</span> hasPfam<span
+        style="color: #333333">)</span>
+
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * Define an annotation row that counts charged residues with Pfam domain annotation</span>
+<span style="color: #888888"> */</span>
+<span style="color: #333399; font-weight: bold">def</span> chargedPfamAnnotation <span
+        style="color: #333333">=</span> getColumnCounter<span
+        style="color: #333333">(</span><span
+        style="background-color: #fff0f0">&quot;Pfam charged&quot;</span><span
+        style="color: #333333">,</span> <span
+        style="background-color: #fff0f0">&quot;Count of charged residues with Pfam domain annotation&quot;</span><span
+        style="color: #333333">,</span> isCharged<span
+        style="color: #333333">,</span> hasPfam<span
+        style="color: #333333">)</span>
+
+<span style="color: #888888">/*</span>
+<span style="color: #888888"> * Register the annotations</span>
+<span style="color: #888888"> */</span>
+AlignmentAnnotationFactory<span style="color: #333333">.</span><span
+        style="color: #0000CC">newCalculator</span><span
+        style="color: #333333">(</span>pfamAnnotation<span
+        style="color: #333333">)</span> 
+AlignmentAnnotationFactory<span style="color: #333333">.</span><span
+        style="color: #0000CC">newCalculator</span><span
+        style="color: #333333">(</span>chargedPfamAnnotation<span
+        style="color: #333333">)</span>
+</pre>
+  </div>
+</body>
+</html>
index f8f4889..6f91d2f 100755 (executable)
@@ -25,8 +25,8 @@
 
 <body>
   <p>
-    <strong>Alignment Window Annotations Menu</strong> (Since Jalview
-    2.8.2)
+    <strong>Alignment Window Annotations Menu</strong> <em>Since Jalview
+    2.8.2</em>
   </p>
   <ul>
     <li><strong>Show Alignment Related</strong><em><br>
index ad9596a..7d07595 100755 (executable)
     <li><strong>Annotation Label Popup Menu</strong><br> <em>This
         menu is opened by clicking anywhere on the annotation row labels
         area (below the sequence ID area).</em>
+        <br/><em><strong>Mac Users:</strong> pressing CTRL whilst clicking
+      the mouse/track pad is the same as a right-click. See your
+      system's settings to configure your track-pad's corners to
+      generate right-clicks.</em>
       <ul>
         <li><strong>Add New Row</strong><br> <em>Adds a
             new, named annotation row (a dialog box will pop up for you
index cbc4217..fcfcdae 100755 (executable)
   <p>
     The <a href="popupMenu.html">Popup Menus</a> are opened by clicking
     with the right mouse button in the alignment display area or on a
-    sequence label in the alignment window.
+    sequence label in the alignment window.<br />
+    <em><strong>Mac Users:</strong> pressing CTRL whilst clicking
+      the mouse/track pad is the same as a right-click. See your
+      system's settings to configure your track-pad's corners to
+      generate right-clicks.</em>
   </p>
   <p>
     The <a href="alwannotationpanel.html">Annotations Menu</a> is opened
index 353fb41..79e7ada 100755 (executable)
 
 <body>
   <p>
-    <strong>Popup Menu</strong><br> <em>This menu is visible
-      when right clicking either within a selected region on the
-      alignment or on a selected sequence name. It may not be accessible
-      when in 'Cursor Mode' (toggled with the F2 key).</em>
+    <strong>Popup Menu</strong><br> <em>This menu is visible when
+      right clicking either within a selected region on the alignment or
+      on a selected sequence name. It may not be accessible when in
+      'Cursor Mode' (toggled with the F2 key).</em><br /> <em><strong>Mac Users:</strong> pressing CTRL whilst clicking
+        the mouse/track pad is the same as a right-click. See your
+        system's settings to configure your track-pad's corners to
+        generate right-clicks.</em>
   </p>
   <ul>
     <li><strong>Selection</strong>
       </ul></li>
     <li><strong>3D Structure Data...</strong> </strong><em>This menu is
         visible when you right-click on a sequence name. When this
-        option is clicked, Jalview will open a <a
-        href="../features/structurechooser.html"
-      >'Structure Chooser' </a> dialogue with options to select the
-        structure which will eventually be opened in a 3D interactive
-        view.<br> These entries will only be present if the
-        sequence has <a href="../features/viewingpdbs.html">associated
-          PDB structures</a>.
+        option is clicked, Jalview will open the <a
+        href="../features/structurechooser.html">'Structure
+          Chooser' </a>, which allows you to discover and view 3D structures
+        for the current selection. For more info, see <a
+        href="../features/viewingpdbs.html">viewing PDB structures</a>.
     </em></li>
     <li><strong>VARNA 2D Structure</strong><br />
     <em> If the sequence or alignment has RNA structure, then <strong>VARNA
index c4a8bab..74be08e 100755 (executable)
     <tr>
       <td width="60" nowrap>
         <div align="center">
-          <strong><a name="Jalview.2.10.0">2.10.0</a><br /> <em>13/9/2016</em></strong>
+          <strong><a name="Jalview.2.10.0">2.10.0</a><br /> <em>27/9/2016</em></strong>
         </div>
       </td>
       <td><em>General</em>
         <ul>
-            <li><!-- JAL---></li>
+            <li><!-- JAL-2164,JAL-1919,-->Jmol now primary parser for importing structure data to Jalview. Enables mmCIF and better PDB parsing.</li>
             <li><!-- JAL-192 --->Alignment ruler shows positions relative to reference sequence</li>
+            <li><!-- JAL-2202 -->Position/residue shown in status bar when mousing over sequence associated annotation</li>
+            <li><!-- JAL-2171 -->Default RNA SS symbol to 'matching bracket' for manual entry</li>
+            <li><!-- JAL-2214 -->RNA Structure consensus indicates wc-only '()', canonical '[]' and invalid '{}' base pair populations for each column</li>
+            <li><!-- JAL-2092 -->Feature settings popup menu options for showing or hiding columns containing a feature</li>
+            <li><!-- JAL-1557 -->Edit selected group by double clicking on group and sequence associated annotation labels</li>
         </ul> <em>Application</em>
         <ul>
             <li><!-- JAL---></li>
             <li><!-- JAL---></li>
             <li><!-- JAL---></li>
             <li><!-- JAL---></li>
-            <li><!-- JAL---></li>
-            <li><!-- JAL---></li>
+            <li><!-- JAL-1479 JAL-1491 -->UniProt - PDB protein structure mappings with the EMBL-EBI PDBe SIFTS database</li>
+            <li><!-- JAL-2079 -->Updated download sites used for Rfam and Pfam sources to xfam.org</li>
+            <li><!-- JAL-2084 -->Disabled Rfam(Full) in the sequence fetcher</li>
             <li><!-- JAL-2123 -->Show residue labels in Chimera when mousing over sequences in Jalview</li>
             <li><!-- JAL-2027-->Support for reverse-complement coding regions in ENA and EMBL</li>
             <li><!-- JAL-1855, JAL-2113, JAL-2114-->Upgrade to EMBL XML 1.2 for ENA record retrieval</li>
-            <li><!--  JAL 1812 -->New 'execute Groovy script' option in an alignment window's Calculate menu</li>
-            <li><!--  JAL 1812 -->Allow groovy scripts that call Jalview.getAlignFrames() to run in headless mode</li>
+            <li><!-- JAL-2027 -->Support for ENA CDS records with reverse complement operator</li>
+            <li><!--  JAL-1812 -->New 'execute Groovy script' option in an alignment window's Calculate menu</li>
+            <li><!--  JAL-1812 -->Allow groovy scripts that call Jalview.getAlignFrames() to run in headless mode</li>
+            <li><!--  JAL-2068 -->Support for creating new alignment calculation workers from groovy scripts</li>
             <li><!-- JAL-1369 --->Store/restore reference sequence in Jalview projects</li>
+            <li><!-- JAL-1803 -->Chain codes for a sequence's PDB associations are now saved/restored from project</li>
+            <li><!-- JAL-2183 -->Double click on an entry in Jalview's database chooser opens a sequence fetcher</li>
+            <li><!-- JAL-1563 -->Free-text search client for UniProt using the UniProt REST API</li>
+            <li><!-- JAL-2168 -->-nonews command line parameter to prevent the news reader opening</li>
+                    
              
         </ul> <em>Applet</em>
         <ul>
             <li><!-- JAL-2077 -->reinstate CTRL-click for opening pop-up menu on OSX</li>
             <li><!-- JAL-2018-->Export features in Jalview format (again) includes graduated colourschemes</li>
             <li><!-- JAL-1722, JAL-2001-->More responsive when working with big alignments and lots of hidden columns</li>
-            <li><!-- JAL-2053-->hidden column markers not always rendered at right of alignment window</li>
+            <li><!-- JAL-2053-->Hidden column markers not always rendered at right of alignment window</li>
             <li><!-- JAL-2067, JAL-  -->Tidied up links in help file table of contents</li>
             <li><!-- JAL-2072  -->Feature based tree calculation not shown for DNA alignments</li>
             <li><!-- JAL-2075  -->Hidden columns ignored during feature based tree calculation</li>
             <li><!-- JAL-2065  -->Alignment view stops updating when show unconserved enabled for group on alignment</li>
             <li><!--  JAL-2086  -->Cannot insert gaps into sequence when set as reference</li>
+            <li><!-- JAL-2146 -->Alignment column in status incorrectly shown as &quot;Sequence position&quot; when mousing over annotation</li>
+            <li><!--  JAL-2099 -->Incorrect column numbers in ruler when hidden columns present</li>
+            <li><!--  JAL-1577 -->Colour by RNA Helices not enabled when user created annotation added to alignment</li>
+            <li><!-- JAL-1841 -->RNA Structure consensus only computed for '()' base pair annotation</li>
+            <li><!-- JAL-2215, JAL-1841 -->Enabling 'Ignore Gaps' results in zero scores for all base pairs in RNA Structure Consensus</li>
+            <li><!-- JAL-2174-->Extend selection with columns containing feature not working</li>
+            <li><!-- JAL-2275 -->Pfam format writer puts extra space at beginning of sequence</li>            
+            <li><!-- JAL-1827 -->Incomplete sequence extracted from pdb entry 3a6s </li>
             
           </ul>
           <em>Application</em>
             <li><!--  JAL-1011  -->Columns are suddenly selected in other alignments and views when revealing hidden columns</li>
             <li><!--  JAL-1989  -->Hide columns not mirrored in complement view in a cDNA/Protein splitframe</li>
             <li><!--  JAL-1369 -->Cannot save/restore representative sequence from project when only one sequence is represented</li>
+            <li><!-- JAL-2002 -->Disabled 'Best Uniprot Coverage' option in Structure Chooser</li>
+            <li><!-- JAL-2215 -->Modifying 'Ignore Gaps' on consensus or structure consensus didn't refresh annotation panel</li>
+                        
             <!--  may exclude, this is an external service stability issue  JAL-1941 /> RNA 3D structure not added via DSSR service</li> -->
           </ul>
           <em>Applet</em>
           <ul>
-            <li><!--  --></li>
+            <li><!-- JAL-2151 -->Incorrect columns are selected when hidden columns present before start of sequence</li>
           </ul>
         </div>
       </td>
index 407eca3..ac48313 100755 (executable)
   <p>
     <strong>Highlights in Jalview 2.10</strong>
   <ul>
-    <li><strong>Ensembl sequence fetcher.</strong> Annotated Genes, transcripts and
-      proteins can be retrieved via Jalview's new Ensembl REST client.</li>
-    <li><strong>Improved sequence/structure mappings.</strong>
-      Jalview now utilises the PDBe's SIFTS database (at EMBL-EBI) to
-      match PDB data positions in UniProt sequences.</li>
+    <li><strong>Ensembl sequence fetcher.</strong> Annotated Genes,
+      transcripts and proteins can be retrieved via Jalview's new <a
+      href="features/ensemblsequencefetcher.html">Ensembl REST
+        client</a>. Support for import of Ensembl data also allows:
+      <ul>
+        <li><strong>Sequence variant data.</strong> Jalview
+          propagates variant annotation imported via Ensembl onto
+          protein products, complete with associated metadata such as
+          clinical significance.</li>
+        <li><strong>Aligned locus view.</strong> Transcripts
+          retrieved for a gene identifier via the Ensembl or
+          EnsemblGenomes sequence databases are automatically aligned to
+          their reference genome.</li>
+      </ul></li>
+    <li><strong>Working with structures.</strong>
+      <ul>
+        <li><strong>More accurate structure mappings.</strong>
+          Jalview now utilises the PDBe's SIFTS database (at EMBL-EBI)
+          to match structures to UniProt sequences, even for structures
+          containing multiple copies of a sequence.</li>
+        <li><strong>Import structures as mmCIF</strong>. Jalview
+          now downloads data from the EMBL-EBI's PDBe site as mmCIF.
+          mmCIF files allow Jalview to handle very large structures,
+          such as the HIV virus capsid assembly.</li>
+      </ul></li>
+    <li><strong>UniProt Free Text Search</strong>. The new search
+      dialog for UniProt allows you to browse and retrieve sequences
+      from UniProt with free-text search and more structured queries</li>
+    <li><strong>Reference sequence based alignment
+        visualisation.</strong>. When a reference sequence is defined for the
+      alignment, the alignment column ruler is now numbered according to
+      the reference sequence. The reference sequence for alignment views
+      can also be saved and restored from Jalview projects.</li>
+    <li></li>
   </ul>
 
 </body>
index 21d990c..711710b 100755 (executable)
@@ -24,11 +24,12 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
+import jalview.schemes.ResidueProperties;
 
 import java.awt.Color;
-import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.Map;
 import java.util.Vector;
 
 /**
@@ -45,13 +46,14 @@ public class Conservation
 
   int end;
 
-  Vector seqNums; // vector of int vectors where first is sequence checksum
+  Vector<int[]> seqNums; // vector of int vectors where first is sequence
+                         // checksum
 
   int maxLength = 0; // used by quality calcs
 
   boolean seqNumsChanged = false; // updated after any change via calcSeqNum;
 
-  Hashtable[] total;
+  Map<String, Integer>[] total;
 
   boolean canonicaliseAa = true; // if true then conservation calculation will
 
@@ -60,22 +62,18 @@ public class Conservation
   // symbol
 
   /** Stores calculated quality values */
-  public Vector quality;
+  private Vector<Double> quality;
 
   /** Stores maximum and minimum values of quality values */
-  public Double[] qualityRange = new Double[2];
+  private double[] qualityRange = new double[2];
 
-  String consString = "";
+  private Sequence consSequence;
 
-  Sequence consSequence;
+  private int threshold;
 
-  Hashtable propHash;
+  private String name = "";
 
-  int threshold;
-
-  String name = "";
-
-  int[][] cons2;
+  private int[][] cons2;
 
   private String[] consSymbs;
 
@@ -84,8 +82,6 @@ public class Conservation
    * 
    * @param name
    *          Name of conservation
-   * @param propHash
-   *          hash of properties for each symbol
    * @param threshold
    *          to count the residues in residueHash(). commonly used value is 3
    * @param sequences
@@ -95,11 +91,10 @@ public class Conservation
    * @param end
    *          end residue position
    */
-  public Conservation(String name, Hashtable propHash, int threshold,
+  public Conservation(String name, int threshold,
           List<SequenceI> sequences, int start, int end)
   {
     this.name = name;
-    this.propHash = propHash;
     this.threshold = threshold;
     this.start = start;
     this.end = end;
@@ -151,7 +146,7 @@ public class Conservation
         seqNums.addElement(new int[sq.length() + 1]);
       }
 
-      if (sq.hashCode() != ((int[]) seqNums.elementAt(i))[0])
+      if (sq.hashCode() != seqNums.elementAt(i)[0])
       {
         int j;
         int len;
@@ -193,12 +188,9 @@ public class Conservation
    */
   public void calculate()
   {
-    Hashtable resultHash, ht;
     int thresh, j, jSize = sequences.length;
     int[] values; // Replaces residueHash
-    String type, res = null;
     char c;
-    Enumeration enumeration2;
 
     total = new Hashtable[maxLength];
 
@@ -214,8 +206,7 @@ public class Conservation
 
           if (canonicaliseAa)
           { // lookup the base aa code symbol
-            c = (char) jalview.schemes.ResidueProperties.aaIndex[sequences[j]
-                    .getCharAt(i)];
+            c = (char) ResidueProperties.aaIndex[sequences[j].getCharAt(i)];
             if (c > 20)
             {
               c = '-';
@@ -223,7 +214,7 @@ public class Conservation
             else
             {
               // recover canonical aa symbol
-              c = jalview.schemes.ResidueProperties.aa[c].charAt(0);
+              c = ResidueProperties.aa[c].charAt(0);
             }
           }
           else
@@ -249,21 +240,18 @@ public class Conservation
       thresh = (threshold * (jSize)) / 100;
 
       // loop over all the found residues
-      resultHash = new Hashtable();
+      Hashtable<String, Integer> resultHash = new Hashtable<String, Integer>();
       for (char v = '-'; v < 'Z'; v++)
       {
 
         if (values[v] > thresh)
         {
-          res = String.valueOf(v);
+          String res = String.valueOf(v);
 
           // Now loop over the properties
-          enumeration2 = propHash.keys();
-
-          while (enumeration2.hasMoreElements())
+          for (String type : ResidueProperties.propHash.keySet())
           {
-            type = (String) enumeration2.nextElement();
-            ht = (Hashtable) propHash.get(type);
+            Map<String, Integer> ht = ResidueProperties.propHash.get(type);
 
             // Have we ticked this before?
             if (!resultHash.containsKey(type))
@@ -277,7 +265,7 @@ public class Conservation
                 resultHash.put(type, ht.get("-"));
               }
             }
-            else if (((Integer) resultHash.get(type)).equals(ht.get(res)) == false)
+            else if (!resultHash.get(type).equals(ht.get(res)))
             {
               resultHash.put(type, new Integer(-1));
             }
@@ -364,7 +352,7 @@ public class Conservation
    * Calculates the conservation sequence
    * 
    * @param consflag
-   *          if true, poitiveve conservation; false calculates negative
+   *          if true, positive conservation; false calculates negative
    *          conservation
    * @param percentageGaps
    *          commonly used value is 25
@@ -372,13 +360,6 @@ public class Conservation
   public void verdict(boolean consflag, float percentageGaps)
   {
     StringBuffer consString = new StringBuffer();
-    String type;
-    Integer result;
-    int[] gapcons;
-    int totGaps, count;
-    float pgaps;
-    Hashtable resultHash;
-    Enumeration enumeration;
 
     // NOTE THIS SHOULD CHECK IF THE CONSEQUENCE ALREADY
     // EXISTS AND NOT OVERWRITE WITH '-', BUT THIS CASE
@@ -390,26 +371,23 @@ public class Conservation
     consSymbs = new String[end - start + 1];
     for (int i = start; i <= end; i++)
     {
-      gapcons = countConsNGaps(i);
-      totGaps = gapcons[1];
-      pgaps = ((float) totGaps * 100) / sequences.length;
+      int[] gapcons = countConsNGaps(i);
+      int totGaps = gapcons[1];
+      float pgaps = ((float) totGaps * 100) / sequences.length;
       consSymbs[i - start] = new String();
 
       if (percentageGaps > pgaps)
       {
-        resultHash = total[i - start];
+        Map<String, Integer> resultHash = total[i - start];
         // Now find the verdict
-        count = 0;
-        enumeration = resultHash.keys();
-
-        while (enumeration.hasMoreElements())
+        int count = 0;
+        for (String type : resultHash.keySet())
         {
-          type = (String) enumeration.nextElement();
-          result = (Integer) resultHash.get(type);
+          int result = resultHash.get(type).intValue();
           // Do we want to count +ve conservation or +ve and -ve cons.?
           if (consflag)
           {
-            if (result.intValue() == 1)
+            if (result == 1)
             {
               consSymbs[i - start] = type + " " + consSymbs[i - start];
               count++;
@@ -417,19 +395,16 @@ public class Conservation
           }
           else
           {
-            if (result.intValue() != -1)
+            if (result != -1)
             {
+              if (result == 0)
               {
-                if (result.intValue() == 0)
-                {
-                  consSymbs[i - start] = consSymbs[i - start] + " !" + type;
-                }
-                else
-                {
-                  consSymbs[i - start] = type + " " + consSymbs[i - start];
-                }
+                consSymbs[i - start] = consSymbs[i - start] + " !" + type;
+              }
+              else
+              {
+                consSymbs[i - start] = type + " " + consSymbs[i - start];
               }
-
               count++;
             }
           }
@@ -474,7 +449,7 @@ public class Conservation
    */
   private void percentIdentity2()
   {
-    seqNums = new Vector();
+    seqNums = new Vector<int[]>();
     // calcSeqNum(s);
     int i = 0, iSize = sequences.length;
     // Do we need to calculate this again?
@@ -501,7 +476,7 @@ public class Conservation
 
       while (j < sequences.length)
       {
-        sqnum = (int[]) seqNums.elementAt(j);
+        sqnum = seqNums.elementAt(j);
 
         for (i = 1; i < sqnum.length; i++)
         {
@@ -531,17 +506,17 @@ public class Conservation
   /**
    * Calculates the quality of the set of sequences
    * 
-   * @param start
+   * @param startRes
    *          Start residue
-   * @param end
+   * @param endRes
    *          End residue
    */
-  public void findQuality(int start, int end)
+  public void findQuality(int startRes, int endRes)
   {
-    quality = new Vector();
+    quality = new Vector<Double>();
 
     double max = -10000;
-    int[][] BLOSUM62 = jalview.schemes.ResidueProperties.getBLOSUM62();
+    int[][] BLOSUM62 = ResidueProperties.getBLOSUM62();
 
     // Loop over columns // JBPNote Profiling info
     // long ts = System.currentTimeMillis();
@@ -556,10 +531,10 @@ public class Conservation
 
     for (l = 0; l < size; l++)
     {
-      lengths[l] = ((int[]) seqNums.elementAt(l)).length - 1;
+      lengths[l] = seqNums.elementAt(l).length - 1;
     }
 
-    for (j = start; j <= end; j++)
+    for (j = startRes; j <= endRes; j++)
     {
       bigtot = 0;
 
@@ -583,7 +558,7 @@ public class Conservation
       {
         tot = 0;
         xx = new double[24];
-        seqNum = (j < lengths[k]) ? ((int[]) seqNums.elementAt(k))[j + 1]
+        seqNum = (j < lengths[k]) ? seqNums.elementAt(k)[j + 1]
                 : 23; // Sequence, or gap at the end
 
         // This is a loop over r
@@ -617,9 +592,9 @@ public class Conservation
 
     double newmax = -10000;
 
-    for (j = start; j <= end; j++)
+    for (j = startRes; j <= endRes; j++)
     {
-      tmp = ((Double) quality.elementAt(j)).doubleValue();
+      tmp = quality.elementAt(j).doubleValue();
       tmp = ((max - tmp) * (size - cons2[j][23])) / size;
 
       // System.out.println(tmp+ " " + j);
@@ -632,12 +607,12 @@ public class Conservation
     }
 
     // System.out.println("Quality " + s);
-    qualityRange[0] = new Double(0);
-    qualityRange[1] = new Double(newmax);
+    qualityRange[0] = 0D;
+    qualityRange[1] = newmax;
   }
 
   /**
-   * complete the given consensus and quuality annotation rows. Note: currently
+   * Complete the given consensus and quuality annotation rows. Note: currently
    * this method will enlarge the given annotation row if it is too small,
    * otherwise will leave its length unchanged.
    * 
@@ -675,7 +650,7 @@ public class Conservation
 
     char c;
 
-    if (conservation.annotations != null
+    if (conservation != null && conservation.annotations != null
             && conservation.annotations.length < alWidth)
     {
       conservation.annotations = new Annotation[alWidth];
@@ -683,14 +658,14 @@ public class Conservation
 
     if (quality2 != null)
     {
-      quality2.graphMax = qualityRange[1].floatValue();
+      quality2.graphMax = (float) qualityRange[1];
       if (quality2.annotations != null
               && quality2.annotations.length < alWidth)
       {
         quality2.annotations = new Annotation[alWidth];
       }
-      qmin = qualityRange[0].floatValue();
-      qmax = qualityRange[1].floatValue();
+      qmin = (float) qualityRange[0];
+      qmax = (float) qualityRange[1];
     }
 
     for (int i = istart; i < alWidth; i++)
@@ -712,20 +687,23 @@ public class Conservation
         value = 10;
       }
 
-      float vprop = value - min;
-      vprop /= max;
-      int consp = i - start;
-      String conssym = (value > 0 && consp > -1 && consp < consSymbs.length) ? consSymbs[consp]
-              : "";
-      conservation.annotations[i] = new Annotation(String.valueOf(c),
-              conssym, ' ', value, new Color(minR + (maxR * vprop), minG
-                      + (maxG * vprop), minB + (maxB * vprop)));
+      if (conservation != null)
+      {
+        float vprop = value - min;
+        vprop /= max;
+        int consp = i - start;
+        String conssym = (value > 0 && consp > -1 && consp < consSymbs.length) ? consSymbs[consp]
+                : "";
+        conservation.annotations[i] = new Annotation(String.valueOf(c),
+                conssym, ' ', value, new Color(minR + (maxR * vprop), minG
+                        + (maxG * vprop), minB + (maxB * vprop)));
+      }
 
       // Quality calc
       if (quality2 != null)
       {
-        value = ((Double) quality.elementAt(i)).floatValue();
-        vprop = value - qmin;
+        value = quality.elementAt(i).floatValue();
+        float vprop = value - qmin;
         vprop /= qmax;
         quality2.annotations[i] = new Annotation(" ",
                 String.valueOf(value), ' ', value, new Color(minR
@@ -740,9 +718,6 @@ public class Conservation
    * 
    * @param name
    *          - name of conservation
-   * @param consHash
-   *          - hash table of properties for each amino acid (normally
-   *          ResidueProperties.propHash)
    * @param threshold
    *          - minimum number of conserved residues needed to indicate
    *          conservation (typically 3)
@@ -760,35 +735,18 @@ public class Conservation
    * @return Conservation object ready for use in visualization
    */
   public static Conservation calculateConservation(String name,
-          Hashtable consHash, int threshold, List<SequenceI> seqs,
-          int start, int end, boolean posOrNeg, int consPercGaps,
-          boolean calcQuality)
-  {
-    Conservation cons = new Conservation(name, consHash, threshold, seqs,
-            start, end);
-    return calculateConservation(cons, posOrNeg, consPercGaps, calcQuality);
-  }
-
-  /**
-   * @param b
-   *          positive (true) or negative (false) conservation
-   * @param consPercGaps
-   *          percentage of gaps tolerated in column
-   * @param calcQuality
-   *          flag indicating if alignment quality should be calculated
-   * @return Conservation object ready for use in visualization
-   */
-  public static Conservation calculateConservation(Conservation cons,
-          boolean b, int consPercGaps, boolean calcQuality)
+          int threshold, List<SequenceI> seqs, int start, int end,
+          boolean posOrNeg, int consPercGaps, boolean calcQuality)
   {
+    Conservation cons = new Conservation(name, threshold, seqs, start, end);
     cons.calculate();
-    cons.verdict(b, consPercGaps);
-
+    cons.verdict(posOrNeg, consPercGaps);
+    
     if (calcQuality)
     {
       cons.findQuality();
     }
-
+    
     return cons;
   }
 }
index e3d999a..b453c28 100644 (file)
@@ -417,6 +417,62 @@ public class Rna
   }
 
   /**
+   * Answers true if the base-pair is A-T/U or C-G (either way round), else
+   * false
+   * 
+   * @param first
+   * @param second
+   * @return
+   */
+  public static boolean isCanonicalPair(char first, char second)
+  {
+
+    if (first > 'Z')
+    {
+      first -= 32;
+    }
+    if (second > 'Z')
+    {
+      second -= 32;
+    }
+
+    switch (first)
+    {
+    case 'A':
+      switch (second)
+      {
+      case 'T':
+      case 'U':
+        return true;
+      }
+      break;
+    case 'G':
+      switch (second)
+      {
+      case 'C':
+        return true;
+      }
+      break;
+    case 'C':
+      switch (second)
+      {
+      case 'G':
+        return true;
+      }
+      break;
+    case 'T':
+    case 'U':
+      switch (second)
+      {
+      case 'A':
+        return true;
+      }
+      break;
+    }
+    return false;
+  }
+
+  /**
    * Returns the matching close pair symbol for the given opening symbol.
    * Currently returns a-z for A-Z, or )]}> for ([{<, or the input symbol if it
    * is not a valid opening symbol.
index 479c856..ad3f8d9 100644 (file)
@@ -112,8 +112,9 @@ public class StructureFrequency
 
     for (int i = start; i < end; i++) // foreach column
     {
-      int canonicalOrWobblePairCount = 0;
+      int canonicalOrWobblePairCount = 0, canonical = 0;
       int otherPairCount = 0;
+      int nongap = 0;
       maxResidue = "-";
       values = new int[255];
       pairs = new int[255][255];
@@ -161,7 +162,7 @@ public class StructureFrequency
               values['-']++;
               continue;
             }
-
+            nongap++;
             /*
              * ensure upper-case for counting purposes
              */
@@ -175,20 +176,19 @@ public class StructureFrequency
             }
             if (Rna.isCanonicalOrWobblePair(c, cEnd))
             {
-              values['(']++;
-              maxResidue = "(";
               canonicalOrWobblePairCount++;
+              if (Rna.isCanonicalPair(c, cEnd))
+              {
+                canonical++;
+              }
             }
             else
             {
-              values['[']++;
-              maxResidue = "[";
               otherPairCount++;
             }
             pairs[c][cEnd]++;
           }
         }
-        // nonGap++;
       }
 
       residueHash = new Hashtable();
@@ -200,7 +200,9 @@ public class StructureFrequency
 
         residueHash.put(PAIRPROFILE, pairs);
       }
-
+      values['('] = canonicalOrWobblePairCount;
+      values['['] = canonical;
+      values['{'] = otherPairCount;
       /*
        * the count is the number of valid pairs (as a percentage, determines
        * the relative size of the profile logo)
@@ -208,13 +210,20 @@ public class StructureFrequency
       int count = canonicalOrWobblePairCount;
 
       /*
-       * currently displaying as '(' if most pairs are valid, or as
-       * '[' if there are more invalid than valid pairs 
+       * display '(' if most pairs are canonical, or as
+       * '[' if there are more wobble pairs. 
        */
-      if (!maxResidue.equals("-"))
+      if (canonicalOrWobblePairCount > 0 || otherPairCount > 0)
       {
-        maxResidue = canonicalOrWobblePairCount >= otherPairCount ? "("
+        if (canonicalOrWobblePairCount >= otherPairCount)
+        {
+          maxResidue = (canonicalOrWobblePairCount - canonical) < canonical ? "("
                 : "[";
+        }
+        else
+        {
+          maxResidue = "{";
+        }
       }
       residueHash.put(MAXCOUNT, new Integer(count));
       residueHash.put(MAXRESIDUE, maxResidue);
@@ -222,8 +231,9 @@ public class StructureFrequency
       percentage = ((float) count * 100) / jSize;
       residueHash.put(PID_GAPS, new Float(percentage));
 
-      // percentage = ((float) count * 100) / (float) nongap;
-      // residueHash.put(PID_NOGAPS, new Float(percentage));
+      percentage = ((float) count * 100) / nongap;
+      residueHash.put(PID_NOGAPS, new Float(percentage));
+
       if (result[i] == null)
       {
         result[i] = residueHash;
@@ -232,9 +242,12 @@ public class StructureFrequency
       {
         values[')'] = values['('];
         values[']'] = values['['];
+        values['}'] = values['{'];
         values['('] = 0;
         values['['] = 0;
-        maxResidue = maxResidue.equals("(") ? ")" : "]";
+        values['{'] = 0;
+        maxResidue = maxResidue.equals("(") ? ")"
+                : maxResidue.equals("[") ? "]" : "}";
 
         residueHash = new Hashtable();
         if (profile)
@@ -251,6 +264,9 @@ public class StructureFrequency
         percentage = ((float) count * 100) / jSize;
         residueHash.put(PID_GAPS, new Float(percentage));
 
+        percentage = ((float) count * 100) / nongap;
+        residueHash.put(PID_NOGAPS, new Float(percentage));
+
         result[bpEnd] = residueHash;
       }
     }
index df57cc0..0840520 100644 (file)
@@ -53,6 +53,18 @@ public interface AlignViewportI extends ViewStyleI
    */
   public int calcPanelHeight();
 
+  /**
+   * Answers true if the viewport has at least one column selected
+   * 
+   * @return
+   */
+  boolean hasSelectedColumns();
+
+  /**
+   * Answers true if the viewport has at least one hidden column
+   * 
+   * @return
+   */
   boolean hasHiddenColumns();
 
   boolean isValidCharWidth();
@@ -110,6 +122,11 @@ public interface AlignViewportI extends ViewStyleI
   boolean isClosed();
 
   /**
+   * Dispose of all references or resources held by the viewport
+   */
+  void dispose();
+
+  /**
    * get the associated calculation thread manager for the view
    * 
    * @return
index ec7cd25..c30fdad 100644 (file)
@@ -43,7 +43,6 @@ import jalview.schemes.HelixColourScheme;
 import jalview.schemes.HydrophobicColourScheme;
 import jalview.schemes.NucleotideColourScheme;
 import jalview.schemes.PIDColourScheme;
-import jalview.schemes.ResidueProperties;
 import jalview.schemes.StrandColourScheme;
 import jalview.schemes.TaylorColourScheme;
 import jalview.schemes.TurnColourScheme;
@@ -1208,10 +1207,10 @@ public class APopupMenu extends java.awt.PopupMenu implements
     if (conservationMenuItem.getState())
     {
 
-      sg.cs.setConservation(Conservation.calculateConservation("Group",
-              ResidueProperties.propHash, 3, sg.getSequences(ap.av
-                      .getHiddenRepSequences()), 0, ap.av.getAlignment()
-                      .getWidth(), false, ap.av.getConsPercGaps(), false));
+      sg.cs.setConservation(Conservation.calculateConservation("Group", 3,
+              sg.getSequences(ap.av.getHiddenRepSequences()), 0, ap.av
+                      .getAlignment().getWidth(), false, ap.av
+                      .getConsPercGaps(), false));
       SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
       SliderPanel.showConservationSlider();
     }
index 0312015..e36944f 100644 (file)
@@ -703,9 +703,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       // Hide everything by the current selection - this is a hack - we do the
       // invert and then hide
       // first check that there will be visible columns after the invert.
-      if ((viewport.getColumnSelection() != null
-              && viewport.getColumnSelection().getSelected() != null && viewport
-              .getColumnSelection().getSelected().size() > 0)
+      if (viewport.hasSelectedColumns()
               || (sg != null && sg.getSize() > 0 && sg.getStartRes() <= sg
                       .getEndRes()))
       {
@@ -733,8 +731,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         hide = true;
         viewport.hideAllSelectedSeqs();
       }
-      else if (!(toggleCols && viewport.getColumnSelection().getSelected()
-              .size() > 0))
+      else if (!(toggleCols && viewport.hasSelectedColumns()))
       {
         viewport.showAllHiddenSeqs();
       }
@@ -742,7 +739,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
     if (toggleCols)
     {
-      if (viewport.getColumnSelection().getSelected().size() > 0)
+      if (viewport.hasSelectedColumns())
       {
         viewport.hideSelectedColumns();
         if (!toggleSeqs)
index 34e0cc0..813ab84 100644 (file)
@@ -68,7 +68,8 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
   // this value is set false when selection area being dragged
   boolean fastPaint = true;
 
-  public void finalize()
+  @Override
+  public void finalize() throws Throwable
   {
     alignFrame = null;
     av = null;
@@ -80,6 +81,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
     annotationPanel = null;
     annotationPanelHolder = null;
     annotationSpaceFillerHolder = null;
+    super.finalize();
   }
 
   public AlignmentPanel(AlignFrame af, final AlignViewport av)
@@ -121,6 +123,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
 
     addComponentListener(new ComponentAdapter()
     {
+      @Override
       public void componentResized(ComponentEvent evt)
       {
         setScrollValues(av.getStartRes(), av.getStartSeq());
@@ -146,6 +149,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
     final AlignmentPanel ap = this;
     av.addPropertyChangeListener(new java.beans.PropertyChangeListener()
     {
+      @Override
       public void propertyChange(java.beans.PropertyChangeEvent evt)
       {
         if (evt.getPropertyName().equals("alignment"))
@@ -538,6 +542,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
    * automatically adjust annotation panel height for new annotation whilst
    * ensuring the alignment is still visible.
    */
+  @Override
   public void adjustAnnotationHeight()
   {
     // TODO: display vertical annotation scrollbar if necessary
@@ -770,6 +775,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
 
   }
 
+  @Override
   public void adjustmentValueChanged(AdjustmentEvent evt)
   {
     int oldX = av.getStartRes();
@@ -947,6 +953,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
   /**
    * Repaint the alignment and annotations, and, optionally, any overview window
    */
+  @Override
   public void paintAlignment(boolean updateOverview)
   {
     final AnnotationSorter sorter = new AnnotationSorter(getAlignment(),
@@ -969,11 +976,13 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
     }
   }
 
+  @Override
   public void update(Graphics g)
   {
     paint(g);
   }
 
+  @Override
   public void paint(Graphics g)
   {
     invalidate();
index c8f526c..47c2d28 100755 (executable)
@@ -29,7 +29,6 @@ import jalview.datamodel.SequenceI;
 import jalview.datamodel.SequenceNode;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeProperty;
-import jalview.schemes.ResidueProperties;
 import jalview.schemes.UserColourScheme;
 import jalview.util.Format;
 import jalview.util.MappingUtils;
@@ -627,9 +626,9 @@ public class TreeCanvas extends Panel implements MouseListener,
 
       Color col = new Color((int) (Math.random() * 255),
               (int) (Math.random() * 255), (int) (Math.random() * 255));
-      setColor((SequenceNode) tree.getGroups().elementAt(i), col.brighter());
+      setColor(tree.getGroups().elementAt(i), col.brighter());
 
-      Vector<SequenceNode> l = tree.findLeaves((SequenceNode) tree
+      Vector<SequenceNode> l = tree.findLeaves(tree
               .getGroups().elementAt(i));
 
       Vector<SequenceI> sequences = new Vector<SequenceI>();
@@ -679,9 +678,8 @@ public class TreeCanvas extends Panel implements MouseListener,
       if (av.getGlobalColourScheme() != null
               && av.getGlobalColourScheme().conservationApplied())
       {
-        Conservation c = new Conservation("Group",
-                ResidueProperties.propHash, 3, sg.getSequences(null),
-                sg.getStartRes(), sg.getEndRes());
+        Conservation c = new Conservation("Group", 3,
+                sg.getSequences(null), sg.getStartRes(), sg.getEndRes());
 
         c.calculate();
         c.verdict(false, av.getConsPercGaps());
index 210a07a..b30ad41 100644 (file)
@@ -466,7 +466,7 @@ public class JalviewLite extends Applet implements
         SequenceI rs = sel.getSequenceAt(0);
         start = rs.findIndex(start);
         end = rs.findIndex(end);
-        List<Integer> cs = csel.getSelected();
+        List<Integer> cs = new ArrayList<Integer>(csel.getSelected());
         csel.clear();
         for (Integer selectedCol : cs)
         {
index 2f64759..35ee8c4 100755 (executable)
@@ -290,13 +290,23 @@ public class Alignment implements AlignmentI
   }
 
   @Override
-  public void finalize()
+  public void finalize() throws Throwable
   {
     if (getDataset() != null)
     {
       getDataset().removeAlignmentRef();
     }
 
+    nullReferences();
+    super.finalize();
+  }
+
+  /**
+   * Defensively nulls out references in case this object is not garbage
+   * collected
+   */
+  void nullReferences()
+  {
     dataset = null;
     sequences = null;
     groups = null;
@@ -305,14 +315,16 @@ public class Alignment implements AlignmentI
   }
 
   /**
-   * decrement the alignmentRefs counter by one and call finalize if it goes to
-   * zero.
+   * decrement the alignmentRefs counter by one and null references if it goes
+   * to zero.
+   * 
+   * @throws Throwable
    */
-  private void removeAlignmentRef()
+  private void removeAlignmentRef() throws Throwable
   {
     if (--alignmentRefs == 0)
     {
-      finalize();
+      nullReferences();
     }
   }
 
index 7ef2a68..8bc8f54 100644 (file)
@@ -45,19 +45,52 @@ public class ColumnSelection
     /*
      * list of selected columns (ordered by selection order, not column order)
      */
-    private List<Integer> order = new ArrayList<Integer>();
+    private List<Integer> order;
+
+    /*
+     * an unmodifiable view of the selected columns list
+     */
+    private List<Integer> _uorder;
 
     /**
      * bitfield for column selection - allows quick lookup
      */
-    private BitSet selected = new BitSet();
+    private BitSet selected;
+
+    /**
+     * Constructor
+     */
+    IntList()
+    {
+      order = new ArrayList<Integer>();
+      _uorder = Collections.unmodifiableList(order);
+      selected = new BitSet();
+    }
+
+    /**
+     * Copy constructor
+     * 
+     * @param other
+     */
+    IntList(IntList other)
+    {
+      this();
+      if (other != null)
+      {
+        int j = other.size();
+        for (int i = 0; i < j; i++)
+        {
+          add(other.elementAt(i));
+        }
+      }
+    }
 
     /**
      * adds a new column i to the selection - only if i is not already selected
      * 
      * @param i
      */
-    public void add(int i)
+    void add(int i)
     {
       if (!selected.get(i))
       {
@@ -66,13 +99,13 @@ public class ColumnSelection
       }
     }
 
-    public void clear()
+    void clear()
     {
       order.clear();
       selected.clear();
     }
 
-    public void remove(int col)
+    void remove(int col)
     {
 
       Integer colInt = new Integer(col);
@@ -87,22 +120,27 @@ public class ColumnSelection
       }
     }
 
-    public boolean contains(Integer colInt)
+    boolean contains(Integer colInt)
     {
       return selected.get(colInt);
     }
 
-    public boolean isEmpty()
+    boolean isEmpty()
     {
       return order.isEmpty();
     }
 
-    public List<Integer> getList()
+    /**
+     * Returns a read-only view of the selected columns list
+     * 
+     * @return
+     */
+    List<Integer> getList()
     {
-      return order;
+      return _uorder;
     }
 
-    public int size()
+    int size()
     {
       return order.size();
     }
@@ -113,7 +151,7 @@ public class ColumnSelection
      * @param i
      * @return
      */
-    public int elementAt(int i)
+    int elementAt(int i)
     {
       return order.get(i);
     }
@@ -156,7 +194,7 @@ public class ColumnSelection
      * @param change
      *          - delta for shift
      */
-    public void compensateForEdits(int start, int change)
+    void compensateForEdits(int start, int change)
     {
       BitSet mask = new BitSet();
       for (int i = 0; i < order.size(); i++)
@@ -175,17 +213,17 @@ public class ColumnSelection
       selected.or(mask);
     }
 
-    public boolean isSelected(int column)
+    boolean isSelected(int column)
     {
       return selected.get(column);
     }
 
-    public int getMaxColumn()
+    int getMaxColumn()
     {
       return selected.length() - 1;
     }
 
-    public int getMinColumn()
+    int getMinColumn()
     {
       return selected.get(0) ? 0 : selected.nextSetBit(0);
     }
@@ -193,7 +231,7 @@ public class ColumnSelection
     /**
      * @return a series of selection intervals along the range
      */
-    public List<int[]> getRanges()
+    List<int[]> getRanges()
     {
       List<int[]> rlist = new ArrayList<int[]>();
       if (selected.isEmpty())
@@ -288,14 +326,18 @@ public class ColumnSelection
   }
 
   /**
-   * Returns a list of selected columns. The list contains no duplicates but is
-   * not necessarily ordered. It also may include columns hidden from the
-   * current view. This returns a copy of the actual list, and changes to the
-   * copy will not affect the selection.
+   * Returns a read-only view of the (possibly empty) list of selected columns
+   * <p>
+   * The list contains no duplicates but is not necessarily ordered. It also may
+   * include columns hidden from the current view. To modify (for example sort)
+   * the list, you should first make a copy.
+   * <p>
+   * The list is not thread-safe: iterating over it could result in
+   * ConcurrentModificationException if it is modified by another thread.
    */
   public List<Integer> getSelected()
   {
-    return new ArrayList<Integer>(selection.getList());
+    return selection.getList();
   }
 
   /**
@@ -949,14 +991,7 @@ public class ColumnSelection
   {
     if (copy != null)
     {
-      if (copy.selection != null)
-      {
-        selection = new IntList();
-        for (int i = 0, j = copy.selection.size(); i < j; i++)
-        {
-          selection.add(copy.selection.elementAt(i));
-        }
-      }
+      selection = new IntList(copy.selection);
       if (copy.hiddenColumns != null)
       {
         hiddenColumns = new Vector<int[]>(copy.hiddenColumns.size());
index 046f1e6..9a408e3 100755 (executable)
@@ -23,7 +23,6 @@ package jalview.datamodel;
 import jalview.analysis.AAFrequency;
 import jalview.analysis.Conservation;
 import jalview.schemes.ColourSchemeI;
-import jalview.schemes.ResidueProperties;
 
 import java.awt.Color;
 import java.util.ArrayList;
@@ -548,9 +547,8 @@ public class SequenceGroup implements AnnotatedCollectionI
       if ((conservation != null)
               || (cs != null && cs.conservationApplied()))
       {
-        Conservation c = new Conservation(groupName,
-                ResidueProperties.propHash, 3, sequences, startRes,
-                endRes + 1);
+        Conservation c = new Conservation(groupName, 3, sequences,
+                startRes, endRes + 1);
         c.calculate();
         c.verdict(false, consPercGaps);
         if (conservation != null)
index 50e1032..0c20e12 100644 (file)
@@ -118,7 +118,10 @@ public class EnsemblGene extends EnsemblSeqProxy
        * fetch the gene sequence(s) with features and xrefs
        */
       AlignmentI geneAlignment = super.getSequenceRecords(geneId);
-
+      if (geneAlignment == null)
+      {
+        continue;
+      }
       if (geneAlignment.getHeight() == 1)
       {
         getTranscripts(geneAlignment, geneId);
index 1848595..49bd138 100644 (file)
@@ -2977,9 +2977,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       // Hide everything by the current selection - this is a hack - we do the
       // invert and then hide
       // first check that there will be visible columns after the invert.
-      if ((viewport.getColumnSelection() != null
-              && viewport.getColumnSelection().getSelected() != null && viewport
-              .getColumnSelection().getSelected().size() > 0)
+      if (viewport.hasSelectedColumns()
               || (sg != null && sg.getSize() > 0 && sg.getStartRes() <= sg
                       .getEndRes()))
       {
@@ -3007,8 +3005,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         hideSelSequences_actionPerformed(null);
         hide = true;
       }
-      else if (!(toggleCols && viewport.getColumnSelection().getSelected()
-              .size() > 0))
+      else if (!(toggleCols && viewport.hasSelectedColumns()))
       {
         showAllSeqs_actionPerformed(null);
       }
@@ -3016,7 +3013,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (toggleCols)
     {
-      if (viewport.getColumnSelection().getSelected().size() > 0)
+      if (viewport.hasSelectedColumns())
       {
         hideSelColumns_actionPerformed(null);
         if (!toggleSeqs)
index 62e05d0..f755b25 100644 (file)
@@ -419,10 +419,11 @@ public class AlignViewport extends AlignmentViewport implements
    * @param align
    *          DOCUMENT ME!
    */
+  @Override
   public void setAlignment(AlignmentI align)
   {
     replaceMappings(align);
-    this.alignment = align;
+    super.setAlignment(align);
   }
 
   /**
index 87d5933..424d52f 100644 (file)
@@ -101,6 +101,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
    */
   private boolean dontScrollComplement;
 
+  private PropertyChangeListener propertyChangeListener;
+
   /**
    * Creates a new AlignmentPanel object.
    * 
@@ -135,7 +137,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     vscroll.addAdjustmentListener(this);
 
     final AlignmentPanel ap = this;
-    av.addPropertyChangeListener(new PropertyChangeListener()
+    propertyChangeListener = new PropertyChangeListener()
     {
       @Override
       public void propertyChange(PropertyChangeEvent evt)
@@ -146,7 +148,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
           alignmentChanged();
         }
       }
-    });
+    };
+    av.addPropertyChangeListener(propertyChangeListener);
     fontChanged();
     adjustAnnotationHeight();
     updateLayout();
@@ -1595,8 +1598,18 @@ public class AlignmentPanel extends GAlignmentPanel implements
     PaintRefresher.RemoveComponent(getSeqPanel().seqCanvas);
     PaintRefresher.RemoveComponent(getIdPanel().getIdCanvas());
     PaintRefresher.RemoveComponent(this);
+
+    /*
+     * try to ensure references are nulled
+     */
+    if (annotationPanel != null)
+    {
+      annotationPanel.dispose();
+    }
+
     if (av != null)
     {
+      av.removePropertyChangeListener(propertyChangeListener);
       jalview.structure.StructureSelectionManager ssm = av
               .getStructureSelectionManager();
       ssm.removeStructureViewerListener(getSeqPanel(), null);
@@ -1604,7 +1617,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       ssm.removeCommandListener(av);
       ssm.removeStructureViewerListener(getSeqPanel(), null);
       ssm.removeSelectionListener(getSeqPanel());
-      av.setAlignment(null);
+      av.dispose();
       av = null;
     }
     else
index 92c6dc6..1a9541c 100755 (executable)
@@ -219,6 +219,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     AlignmentAnnotation[] aa = ap.av.getAlignment()
             .getAlignmentAnnotation();
 
+    boolean fullRepaint = false;
     if (evt.getActionCommand().equals(ADDNEW))
     {
       AlignmentAnnotation newAnnotation = new AlignmentAnnotation(null,
@@ -231,11 +232,16 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 
       ap.av.getAlignment().addAnnotation(newAnnotation);
       ap.av.getAlignment().setAnnotationIndex(newAnnotation, 0);
+      fullRepaint = true;
     }
     else if (evt.getActionCommand().equals(EDITNAME))
     {
+      String name = aa[selectedRow].label;
       editLabelDescription(aa[selectedRow]);
-      repaint();
+      if (!name.equalsIgnoreCase(aa[selectedRow].label))
+      {
+        fullRepaint = true;
+      }
     }
     else if (evt.getActionCommand().equals(HIDE))
     {
@@ -245,6 +251,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     {
       ap.av.getAlignment().deleteAnnotation(aa[selectedRow]);
       ap.av.getCalcManager().removeWorkerForAnnotation(aa[selectedRow]);
+      fullRepaint = true;
     }
     else if (evt.getActionCommand().equals(SHOWALL))
     {
@@ -255,6 +262,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
           aa[i].visible = true;
         }
       }
+      fullRepaint = true;
     }
     else if (evt.getActionCommand().equals(OUTPUT_TEXT))
     {
@@ -283,18 +291,30 @@ public class AnnotationLabels extends JPanel implements MouseListener,
       aa[selectedRow].scaleColLabel = !aa[selectedRow].scaleColLabel;
     }
 
-    refresh();
+    refresh(fullRepaint);
 
   }
 
   /**
    * Redraw sensibly.
+   * 
+   * @adjustHeight if true, try to recalculate panel height for visible
+   *               annotations
    */
-  protected void refresh()
+  protected void refresh(boolean adjustHeight)
   {
-    ap.validateAnnotationDimensions(false);
+    ap.validateAnnotationDimensions(adjustHeight);
     ap.addNotify();
-    ap.repaint();
+    if (adjustHeight)
+    {
+      // sort, repaint, update overview
+      ap.paintAlignment(true);
+    }
+    else
+    {
+      // lightweight repaint
+      ap.repaint();
+    }
   }
 
   /**
@@ -305,6 +325,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
    */
   boolean editLabelDescription(AlignmentAnnotation annotation)
   {
+    // TODO i18n
     EditNameDialog dialog = new EditNameDialog(annotation.label,
             annotation.description, "       Annotation Name ",
             "Annotation Description ", "Edit Annotation Name/Description",
@@ -398,7 +419,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
             // ann.visible = false;
             // }
             // }
-            refresh();
+            refresh(true);
           }
         });
         pop.add(hideType);
@@ -460,6 +481,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
             {
               ap.av.setIgnoreGapsConsensus(cbmi.getState(), ap);
             }
+            ap.alignmentChanged();
           }
         });
         pop.add(cbmi);
index bd903b3..0b2f6cc 100755 (executable)
@@ -49,6 +49,7 @@ import java.awt.event.MouseMotionListener;
 import java.awt.event.MouseWheelEvent;
 import java.awt.event.MouseWheelListener;
 import java.awt.image.BufferedImage;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
@@ -122,8 +123,6 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
 
   boolean mouseDragging = false;
 
-  boolean MAC = false;
-
   // for editing cursor
   int cursorX = 0;
 
@@ -141,9 +140,6 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
    */
   public AnnotationPanel(AlignmentPanel ap)
   {
-
-    MAC = jalview.util.Platform.isAMac();
-
     ToolTipManager.sharedInstance().registerComponent(this);
     ToolTipManager.sharedInstance().setInitialDelay(0);
     ToolTipManager.sharedInstance().setDismissDelay(10000);
@@ -445,8 +441,12 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     StringBuilder collatedInput = new StringBuilder(64);
     String last = "";
     ColumnSelection viscols = av.getColumnSelection();
-    // TODO: refactor and save av.getColumnSelection for efficiency
-    List<Integer> selected = viscols.getSelected();
+
+    /*
+     * the selection list (read-only view) is in selection order, not
+     * column order; make a copy so we can sort it
+     */
+    List<Integer> selected = new ArrayList<Integer>(viscols.getSelected());
     Collections.sort(selected);
     for (int index : selected)
     {
@@ -1134,4 +1134,25 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       return null;
     }
   }
+
+  /**
+   * Try to ensure any references held are nulled
+   */
+  public void dispose()
+  {
+    av = null;
+    ap = null;
+    image = null;
+    fadedImage = null;
+    gg = null;
+    _mwl = null;
+
+    /*
+     * I created the renderer so I will dispose of it
+     */
+    if (renderer != null)
+    {
+      renderer.dispose();
+    }
+  }
 }
index 387a2a9..00b359a 100644 (file)
@@ -64,12 +64,10 @@ import java.awt.event.FocusListener;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.beans.PropertyVetoException;
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -102,6 +100,8 @@ import javax.swing.KeyStroke;
 import javax.swing.SwingUtilities;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkEvent.EventType;
+import javax.swing.event.InternalFrameAdapter;
+import javax.swing.event.InternalFrameEvent;
 import javax.swing.event.MenuEvent;
 import javax.swing.event.MenuListener;
 
@@ -814,24 +814,25 @@ public class Desktop extends jalview.jbgui.GDesktop implements
               * ((openFrameCount - 1) % 10) + yOffset);
     }
 
+    /*
+     * add an entry for the new frame in the Window menu 
+     * (and remove it when the frame is closed)
+     */
     final JMenuItem menuItem = new JMenuItem(title);
-    frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+    frame.addInternalFrameListener(new InternalFrameAdapter()
     {
       @Override
-      public void internalFrameActivated(
-              javax.swing.event.InternalFrameEvent evt)
+      public void internalFrameActivated(InternalFrameEvent evt)
       {
         JInternalFrame itf = desktop.getSelectedFrame();
         if (itf != null)
         {
           itf.requestFocus();
         }
-
       }
 
       @Override
-      public void internalFrameClosed(
-              javax.swing.event.InternalFrameEvent evt)
+      public void internalFrameClosed(InternalFrameEvent evt)
       {
         PaintRefresher.RemoveComponent(frame);
 
@@ -843,11 +844,23 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         {
           openFrameCount--;
         }
+
+        /*
+         * ensure no reference to alignFrame retained by menu item listener
+         */
+        if (menuItem.getActionListeners().length > 0)
+        {
+          menuItem.removeActionListener(menuItem.getActionListeners()[0]);
+        }
         windowMenu.remove(menuItem);
         JInternalFrame itf = desktop.getSelectedFrame();
         if (itf != null)
         {
           itf.requestFocus();
+          if (itf instanceof AlignFrame)
+          {
+            Jalview.setCurrentAlignFrame((AlignFrame) itf);
+          }
         }
         System.gc();
       };
@@ -868,47 +881,6 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         }
       }
     });
-    menuItem.addMouseListener(new MouseListener()
-    {
-
-      @Override
-      public void mouseReleased(MouseEvent e)
-      {
-      }
-
-      @Override
-      public void mousePressed(MouseEvent e)
-      {
-      }
-
-      @Override
-      public void mouseExited(MouseEvent e)
-      {
-        try
-        {
-          frame.setSelected(false);
-        } catch (PropertyVetoException e1)
-        {
-        }
-      }
-
-      @Override
-      public void mouseEntered(MouseEvent e)
-      {
-        try
-        {
-          frame.setSelected(true);
-        } catch (PropertyVetoException e1)
-        {
-        }
-      }
-
-      @Override
-      public void mouseClicked(MouseEvent e)
-      {
-
-      }
-    });
 
     windowMenu.add(menuItem);
 
@@ -1328,6 +1300,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   @Override
   public void closeAll_actionPerformed(ActionEvent e)
   {
+    // TODO show a progress bar while closing?
     JInternalFrame[] frames = desktop.getAllFrames();
     for (int i = 0; i < frames.length; i++)
     {
@@ -1338,6 +1311,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
       {
       }
     }
+    Jalview.setCurrentAlignFrame(null);
     System.out.println("ALL CLOSED");
     if (v_client != null)
     {
@@ -1354,6 +1328,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     {
       ssm.resetAll();
     }
+    System.gc();
   }
 
   @Override
index 7093a9a..47a8faf 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.gui;
 
+import jalview.analysis.Conservation;
 import jalview.api.FeatureColourI;
 import jalview.api.ViewStyleI;
 import jalview.api.structures.JalviewStructureDisplayI;
@@ -3389,8 +3390,7 @@ public class Jalview2XML
         }
         if (jGroup.getConsThreshold() != 0)
         {
-          jalview.analysis.Conservation c = new jalview.analysis.Conservation(
-                  "All", ResidueProperties.propHash, 3,
+          Conservation c = new Conservation("All", 3,
                   sg.getSequences(null), 0, sg.getWidth() - 1);
           c.calculate();
           c.verdict(false, 25);
index 61e20fa..f8a296f 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.gui;
 
+import jalview.analysis.Conservation;
 import jalview.binding.Annotation;
 import jalview.binding.AnnotationElement;
 import jalview.binding.Features;
@@ -37,7 +38,6 @@ import jalview.binding.Viewport;
 import jalview.datamodel.PDBEntry;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeProperty;
-import jalview.schemes.ResidueProperties;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
 import jalview.util.jarInputStreamProvider;
@@ -359,8 +359,7 @@ public class Jalview2XML_V1
 
         if (groups[i].getConsThreshold() != 0)
         {
-          jalview.analysis.Conservation c = new jalview.analysis.Conservation(
-                  "All", ResidueProperties.propHash, 3,
+          Conservation c = new Conservation("All", 3,
                   sg.getSequences(null), 0, sg.getWidth() - 1);
           c.calculate();
           c.verdict(false, 25);
index d28dc60..939c087 100644 (file)
@@ -49,7 +49,6 @@ import jalview.schemes.HydrophobicColourScheme;
 import jalview.schemes.NucleotideColourScheme;
 import jalview.schemes.PIDColourScheme;
 import jalview.schemes.PurinePyrimidineColourScheme;
-import jalview.schemes.ResidueProperties;
 import jalview.schemes.StrandColourScheme;
 import jalview.schemes.TaylorColourScheme;
 import jalview.schemes.TurnColourScheme;
@@ -2039,9 +2038,8 @@ public class PopupMenu extends JPopupMenu
     if (conservationMenuItem.isSelected())
     {
       // JBPNote: Conservation name shouldn't be i18n translated
-      Conservation c = new Conservation("Group",
-              ResidueProperties.propHash, 3, sg.getSequences(ap.av
-                      .getHiddenRepSequences()), sg.getStartRes(),
+      Conservation c = new Conservation("Group", 3, sg.getSequences(ap.av
+              .getHiddenRepSequences()), sg.getStartRes(),
               sg.getEndRes() + 1);
 
       c.calculate();
index 6bfea9e..ef65b92 100755 (executable)
@@ -29,7 +29,6 @@ import jalview.datamodel.SequenceI;
 import jalview.datamodel.SequenceNode;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeProperty;
-import jalview.schemes.ResidueProperties;
 import jalview.schemes.UserColourScheme;
 import jalview.structure.SelectionSource;
 import jalview.util.Format;
@@ -1020,10 +1019,8 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable,
         if (aps[a].av.getGlobalColourScheme() != null
                 && aps[a].av.getGlobalColourScheme().conservationApplied())
         {
-          Conservation c = new Conservation("Group",
-                  ResidueProperties.propHash, 3, sg.getSequences(null),
-                  sg.getStartRes(), sg.getEndRes());
-
+          Conservation c = new Conservation("Group", 3,
+                  sg.getSequences(null), sg.getStartRes(), sg.getEndRes());
           c.calculate();
           c.verdict(false, aps[a].av.getConsPercGaps());
           sg.cs.setConservation(c);
index 7588e07..afb6df4 100644 (file)
@@ -321,6 +321,7 @@ public class VamsasApplication implements SelectionSource, VamsasSource
     Thread udthread = new Thread(new Runnable()
     {
 
+      @Override
       public void run()
       {
         Cache.log.info("Jalview updating to the Vamsas Session.");
@@ -639,6 +640,7 @@ public class VamsasApplication implements SelectionSource, VamsasSource
     final VamsasApplication client = this;
     vclient.addDocumentUpdateHandler(new PropertyChangeListener()
     {
+      @Override
       public void propertyChange(PropertyChangeEvent evt)
       {
         Cache.log.debug("Dealing with document update event.");
@@ -656,6 +658,7 @@ public class VamsasApplication implements SelectionSource, VamsasSource
             uk.ac.vamsas.client.Events.DOCUMENT_REQUESTTOCLOSE,
             new PropertyChangeListener()
             {
+              @Override
               public void propertyChange(PropertyChangeEvent evt)
               {
                 if (client.promptUser)
@@ -774,6 +777,7 @@ public class VamsasApplication implements SelectionSource, VamsasSource
         {
           String last = null;
 
+          @Override
           public void handleMessage(Message message)
           {
             if (vobj2jv == null)
@@ -998,6 +1002,7 @@ public class VamsasApplication implements SelectionSource, VamsasSource
         selecter = new SelectionListener()
         {
 
+          @Override
           public void selection(SequenceGroup seqsel,
                   ColumnSelection colsel, SelectionSource source)
           {
@@ -1065,11 +1070,10 @@ public class VamsasApplication implements SelectionSource, VamsasSource
                   {
                     // gather selected columns outwith the sequence positions
                     // too
-                    for (Object obj : colsel.getSelected())
+                    for (Integer ival : colsel.getSelected())
                     {
-                      int ival = ((Integer) obj).intValue();
                       Pos p = new Pos();
-                      p.setI(ival + 1);
+                      p.setI(ival.intValue() + 1);
                       range.addPos(p);
                     }
                   }
index d738882..34fdabe 100755 (executable)
@@ -32,7 +32,6 @@ import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeProperty;
-import jalview.schemes.ResidueProperties;
 import jalview.schemes.UserColourScheme;
 
 import java.io.BufferedReader;
@@ -1638,9 +1637,9 @@ public class AnnotationFile
         else if (key.equalsIgnoreCase("consThreshold"))
         {
           sg.cs.setConservationInc(Integer.parseInt(value));
-          Conservation c = new Conservation("Group",
-                  ResidueProperties.propHash, 3, sg.getSequences(null),
-                  sg.getStartRes(), sg.getEndRes() + 1);
+          Conservation c = new Conservation("Group", 3,
+                  sg.getSequences(null), sg.getStartRes(),
+                  sg.getEndRes() + 1);
 
           c.calculate();
           c.verdict(false, 25); // TODO: refer to conservation percent threshold
index 2879889..ff7a764 100644 (file)
@@ -152,7 +152,8 @@ public class DatastoreRegistry
     return dsregitem;
   }
 
-  protected void finalize()
+  @Override
+  protected void finalize() throws Throwable
   {
     if (dsObjReg != null)
     {
@@ -171,5 +172,6 @@ public class DatastoreRegistry
     {
       dsItemReg.clear();
     }
+    super.finalize();
   }
 }
index 4d7c0d4..6daf275 100644 (file)
@@ -39,7 +39,8 @@ public class JSFunctionExec implements Runnable
     jvlite.setExecutor(this);
   }
 
-  public void finalize()
+  @Override
+  protected void finalize() throws Throwable
   {
     jvlite = null;
     executor = null;
@@ -48,6 +49,7 @@ public class JSFunctionExec implements Runnable
       jsExecQueue.clear();
     }
     jsExecQueue = null;
+    super.finalize();
   }
 
   private Vector jsExecQueue;
@@ -82,6 +84,7 @@ public class JSFunctionExec implements Runnable
     executor = null;
   }
 
+  @Override
   public void run()
   {
     while (jsExecQueue != null)
@@ -164,6 +167,7 @@ public class JSFunctionExec implements Runnable
     final Exception[] jsex = new Exception[1];
     Runnable exec = new Runnable()
     {
+      @Override
       public void run()
       {
         try
@@ -196,7 +200,7 @@ public class JSFunctionExec implements Runnable
             if (jex instanceof netscape.javascript.JSException
                     && jvlite.jsfallbackEnabled)
             {
-              jsex[0] = (netscape.javascript.JSException) jex;
+              jsex[0] = jex;
               if (jvlite.debug)
               {
                 System.err.println("Falling back to javascript: url call");
index 35c7860..4f833bc 100644 (file)
@@ -298,7 +298,7 @@ public class MouseOverStructureListener extends JSFunctionExec implements
     return _listenerfn;
   }
 
-  public void finalise()
+  public void finalize() throws Throwable
   {
     jvlite = null;
     super.finalize();
index 82f6ffb..e58ba02 100644 (file)
@@ -30,6 +30,7 @@ import jalview.datamodel.Annotation;
 import jalview.datamodel.ColumnSelection;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ResidueProperties;
+import jalview.util.Platform;
 
 import java.awt.BasicStroke;
 import java.awt.Color;
@@ -57,6 +58,70 @@ public class AnnotationRenderer
    */
   private final boolean debugRedraw;
 
+  private int charWidth, endRes, charHeight;
+
+  private boolean validCharWidth, hasHiddenColumns;
+
+  private FontMetrics fm;
+
+  private final boolean MAC = Platform.isAMac();
+
+  boolean av_renderHistogram = true, av_renderProfile = true,
+          av_normaliseProfile = false;
+
+  ColourSchemeI profcolour = null;
+
+  private ColumnSelection columnSelection;
+
+  private Hashtable[] hconsensus;
+
+  private Hashtable[] complementConsensus;
+
+  private Hashtable[] hStrucConsensus;
+
+  private boolean av_ignoreGapsConsensus;
+
+  /**
+   * attributes set from AwtRenderPanelI
+   */
+  /**
+   * old image used when data is currently being calculated and cannot be
+   * rendered
+   */
+  private Image fadedImage;
+
+  /**
+   * panel being rendered into
+   */
+  private ImageObserver annotationPanel;
+
+  /**
+   * width of image to render in panel
+   */
+  private int imgWidth;
+
+  /**
+   * offset to beginning of visible area
+   */
+  private int sOffset;
+
+  /**
+   * offset to end of visible area
+   */
+  private int visHeight;
+
+  /**
+   * indicate if the renderer should only render the visible portion of the
+   * annotation given the current view settings
+   */
+  private boolean useClip = true;
+
+  /**
+   * master flag indicating if renderer should ever try to clip. not enabled for
+   * jalview 2.8.1
+   */
+  private boolean canClip = false;
+
   public AnnotationRenderer()
   {
     this(false);
@@ -74,6 +139,18 @@ public class AnnotationRenderer
     this.debugRedraw = debugRedraw;
   }
 
+  /**
+   * Remove any references and resources when this object is no longer required
+   */
+  public void dispose()
+  {
+    hconsensus = null;
+    complementConsensus = null;
+    hStrucConsensus = null;
+    fadedImage = null;
+    annotationPanel = null;
+  }
+
   void drawStemAnnot(Graphics g, Annotation[] row_annotations,
           int lastSSX, int x, int y, int iconOffset, int startRes,
           int column, boolean validRes, boolean validEnd)
@@ -134,70 +211,6 @@ public class AnnotationRenderer
     g.fillRect(x1, y + 4 + iconOffset, x2 - x1, 7);
   }
 
-  private int charWidth, endRes, charHeight;
-
-  private boolean validCharWidth, hasHiddenColumns;
-
-  private FontMetrics fm;
-
-  private final boolean MAC = jalview.util.Platform.isAMac();
-
-  boolean av_renderHistogram = true, av_renderProfile = true,
-          av_normaliseProfile = false;
-
-  ColourSchemeI profcolour = null;
-
-  private ColumnSelection columnSelection;
-
-  private Hashtable[] hconsensus;
-
-  private Hashtable[] complementConsensus;
-
-  private Hashtable[] hStrucConsensus;
-
-  private boolean av_ignoreGapsConsensus;
-
-  /**
-   * attributes set from AwtRenderPanelI
-   */
-  /**
-   * old image used when data is currently being calculated and cannot be
-   * rendered
-   */
-  private Image fadedImage;
-
-  /**
-   * panel being rendered into
-   */
-  private ImageObserver annotationPanel;
-
-  /**
-   * width of image to render in panel
-   */
-  private int imgWidth;
-
-  /**
-   * offset to beginning of visible area
-   */
-  private int sOffset;
-
-  /**
-   * offset to end of visible area
-   */
-  private int visHeight;
-
-  /**
-   * indicate if the renderer should only render the visible portion of the
-   * annotation given the current view settings
-   */
-  private boolean useClip = true;
-
-  /**
-   * master flag indicating if renderer should ever try to clip. not enabled for
-   * jalview 2.8.1
-   */
-  private boolean canClip = false;
-
   void drawNotCanonicalAnnot(Graphics g, Color nonCanColor,
           Annotation[] row_annotations, int lastSSX, int x, int y,
           int iconOffset, int startRes, int column, boolean validRes,
index d0d26b0..c235c7a 100755 (executable)
@@ -26,6 +26,7 @@ import jalview.api.analysis.ScoreModelI;
 
 import java.awt.Color;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -223,36 +224,36 @@ public class ResidueProperties
 
   static
   {
-    aa3Hash.put("ALA", new Integer(0));
-    aa3Hash.put("ARG", new Integer(1));
-    aa3Hash.put("ASN", new Integer(2));
-    aa3Hash.put("ASP", new Integer(3)); // D
-    aa3Hash.put("CYS", new Integer(4));
-    aa3Hash.put("GLN", new Integer(5)); // Q
-    aa3Hash.put("GLU", new Integer(6)); // E
-    aa3Hash.put("GLY", new Integer(7));
-    aa3Hash.put("HIS", new Integer(8));
-    aa3Hash.put("ILE", new Integer(9));
-    aa3Hash.put("LEU", new Integer(10));
-    aa3Hash.put("LYS", new Integer(11));
-    aa3Hash.put("MET", new Integer(12));
-    aa3Hash.put("PHE", new Integer(13));
-    aa3Hash.put("PRO", new Integer(14));
-    aa3Hash.put("SER", new Integer(15));
-    aa3Hash.put("THR", new Integer(16));
-    aa3Hash.put("TRP", new Integer(17));
-    aa3Hash.put("TYR", new Integer(18));
-    aa3Hash.put("VAL", new Integer(19));
+    aa3Hash.put("ALA", Integer.valueOf(0));
+    aa3Hash.put("ARG", Integer.valueOf(1));
+    aa3Hash.put("ASN", Integer.valueOf(2));
+    aa3Hash.put("ASP", Integer.valueOf(3)); // D
+    aa3Hash.put("CYS", Integer.valueOf(4));
+    aa3Hash.put("GLN", Integer.valueOf(5)); // Q
+    aa3Hash.put("GLU", Integer.valueOf(6)); // E
+    aa3Hash.put("GLY", Integer.valueOf(7));
+    aa3Hash.put("HIS", Integer.valueOf(8));
+    aa3Hash.put("ILE", Integer.valueOf(9));
+    aa3Hash.put("LEU", Integer.valueOf(10));
+    aa3Hash.put("LYS", Integer.valueOf(11));
+    aa3Hash.put("MET", Integer.valueOf(12));
+    aa3Hash.put("PHE", Integer.valueOf(13));
+    aa3Hash.put("PRO", Integer.valueOf(14));
+    aa3Hash.put("SER", Integer.valueOf(15));
+    aa3Hash.put("THR", Integer.valueOf(16));
+    aa3Hash.put("TRP", Integer.valueOf(17));
+    aa3Hash.put("TYR", Integer.valueOf(18));
+    aa3Hash.put("VAL", Integer.valueOf(19));
     // IUB Nomenclature for ambiguous peptides
-    aa3Hash.put("ASX", new Integer(20)); // "B";
-    aa3Hash.put("GLX", new Integer(21)); // Z
-    aa3Hash.put("XAA", new Integer(22)); // X unknown
-    aa3Hash.put("-", new Integer(23));
-    aa3Hash.put("*", new Integer(23));
-    aa3Hash.put(".", new Integer(23));
-    aa3Hash.put(" ", new Integer(23));
-    aa3Hash.put("Gap", new Integer(23));
-    aa3Hash.put("UR3", new Integer(24));
+    aa3Hash.put("ASX", Integer.valueOf(20)); // "B";
+    aa3Hash.put("GLX", Integer.valueOf(21)); // Z
+    aa3Hash.put("XAA", Integer.valueOf(22)); // X unknown
+    aa3Hash.put("-", Integer.valueOf(23));
+    aa3Hash.put("*", Integer.valueOf(23));
+    aa3Hash.put(".", Integer.valueOf(23));
+    aa3Hash.put(" ", Integer.valueOf(23));
+    aa3Hash.put("Gap", Integer.valueOf(23));
+    aa3Hash.put("UR3", Integer.valueOf(24));
   }
 
   static
@@ -305,24 +306,24 @@ public class ResidueProperties
 
   public static final Color midBlue = new Color(100, 100, 255);
 
-  public static final Vector scaleColours = new Vector();
-
-  static
-  {
-    scaleColours.addElement(new Color(114, 0, 147));
-    scaleColours.addElement(new Color(156, 0, 98));
-    scaleColours.addElement(new Color(190, 0, 0));
-    scaleColours.addElement(Color.red);
-    scaleColours.addElement(new Color(255, 125, 0));
-    scaleColours.addElement(Color.orange);
-    scaleColours.addElement(new Color(255, 194, 85));
-    scaleColours.addElement(Color.yellow);
-    scaleColours.addElement(new Color(255, 255, 181));
-    scaleColours.addElement(Color.white);
-  }
-
-  public static final Color[] taylor = { new Color(204, 255, 0), // A
-                                                                 // Greenish-yellowy-yellow
+  // not currently in use
+  // public static final Vector<Color> scaleColours = new Vector<Color>();
+  // static
+  // {
+  // scaleColours.addElement(new Color(114, 0, 147));
+  // scaleColours.addElement(new Color(156, 0, 98));
+  // scaleColours.addElement(new Color(190, 0, 0));
+  // scaleColours.addElement(Color.red);
+  // scaleColours.addElement(new Color(255, 125, 0));
+  // scaleColours.addElement(Color.orange);
+  // scaleColours.addElement(new Color(255, 194, 85));
+  // scaleColours.addElement(Color.yellow);
+  // scaleColours.addElement(new Color(255, 255, 181));
+  // scaleColours.addElement(Color.white);
+  // }
+
+  public static final Color[] taylor = { new Color(204, 255, 0),
+      // A Greenish-yellowy-yellow
       new Color(0, 0, 255), // R Blueish-bluey-blue
       new Color(204, 0, 255), // N Blueish-reddy-blue
       new Color(255, 0, 0), // D Reddish-reddy-red
@@ -572,21 +573,21 @@ public class ResidueProperties
       { -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8,
           -8, -8, -8, -8, -8, -8, 1 }, };
 
-  public static final Hashtable ssHash = new Hashtable(); // stores the number
-  // value of the aa
-
-  static
-  {
-    ssHash.put("H", Color.magenta);
-    ssHash.put("E", Color.yellow);
-    ssHash.put("-", Color.white);
-    ssHash.put(".", Color.white);
-    ssHash.put("S", Color.cyan);
-    ssHash.put("T", Color.blue);
-    ssHash.put("G", Color.pink);
-    ssHash.put("I", Color.pink);
-    ssHash.put("B", Color.yellow);
-  }
+  // not currently used
+  // public static final Map<String, Color> ssHash = new Hashtable<String,
+  // Color>();
+  // static
+  // {
+  // ssHash.put("H", Color.magenta);
+  // ssHash.put("E", Color.yellow);
+  // ssHash.put("-", Color.white);
+  // ssHash.put(".", Color.white);
+  // ssHash.put("S", Color.cyan);
+  // ssHash.put("T", Color.blue);
+  // ssHash.put("G", Color.pink);
+  // ssHash.put("I", Color.pink);
+  // ssHash.put("B", Color.yellow);
+  // }
 
   /*
    * new Color(60, 136, 238), // U Color.white, // I Color.white, // X
@@ -618,7 +619,6 @@ public class ResidueProperties
     scoreMatrices.put("BLOSUM62", new ScoreMatrix("BLOSUM62", BLOSUM62, 0));
     scoreMatrices.put("PAM250", new ScoreMatrix("PAM250", PAM250, 0));
     scoreMatrices.put("DNA", new ScoreMatrix("DNA", DNA, 1));
-
   }
 
   public static final Color[] pidColours = { midBlue,
@@ -628,77 +628,10 @@ public class ResidueProperties
 
   public static final float[] pidThresholds = { 80, 60, 40, };
 
-  public static Map<String, List<String>> codonHash = new HashMap<String, List<String>>();
-
-  private static List<String> Lys = new ArrayList<String>();
-
-  private static List<String> Asn = new ArrayList<String>();
-
-  private static List<String> Gln = new ArrayList<String>();
-
-  private static List<String> His = new ArrayList<String>();
-
-  private static List<String> Glu = new ArrayList<String>();
-
-  private static List<String> Asp = new ArrayList<String>();
-
-  private static List<String> Tyr = new ArrayList<String>();
-
-  private static List<String> Thr = new ArrayList<String>();
-
-  private static List<String> Pro = new ArrayList<String>();
-
-  private static List<String> Ala = new ArrayList<String>();
-
-  private static List<String> Ser = new ArrayList<String>();
-
-  private static List<String> Arg = new ArrayList<String>();
-
-  private static List<String> Gly = new ArrayList<String>();
-
-  private static List<String> Trp = new ArrayList<String>();
-
-  private static List<String> Cys = new ArrayList<String>();
-
-  private static List<String> Ile = new ArrayList<String>();
-
-  private static List<String> Met = new ArrayList<String>();
-
-  private static List<String> Leu = new ArrayList<String>();
-
-  private static List<String> Val = new ArrayList<String>();
-
-  private static List<String> Phe = new ArrayList<String>();
-
-  public static List<String> STOP = new ArrayList<String>();
+  public static List<String> STOP = Arrays.asList("TGA", "TAA", "TAG");
 
   public static String START = "ATG";
 
-  static
-  {
-    codonHash.put("K", Lys);
-    codonHash.put("N", Asn);
-    codonHash.put("Q", Gln);
-    codonHash.put("H", His);
-    codonHash.put("E", Glu);
-    codonHash.put("D", Asp);
-    codonHash.put("Y", Tyr);
-    codonHash.put("T", Thr);
-    codonHash.put("P", Pro);
-    codonHash.put("A", Ala);
-    codonHash.put("S", Ser);
-    codonHash.put("R", Arg);
-    codonHash.put("G", Gly);
-    codonHash.put("W", Trp);
-    codonHash.put("C", Cys);
-    codonHash.put("I", Ile);
-    codonHash.put("M", Met);
-    codonHash.put("L", Leu);
-    codonHash.put("V", Val);
-    codonHash.put("F", Phe);
-    codonHash.put("STOP", STOP);
-  }
-
   /**
    * Nucleotide Ambiguity Codes
    */
@@ -885,7 +818,6 @@ public class ResidueProperties
         // make all codons for this combination
         char allres[][] = new char[tpos.length][];
         String _acodon = "";
-        char _anuc;
         for (ipos = 0; ipos < tpos.length; ipos++)
         {
           if (acodon[ipos].length == 0 || tpos[ipos] < 0)
@@ -951,379 +883,294 @@ public class ResidueProperties
         }
       }
     }
-
-  }
-
-  static
-  {
-    Lys.add("AAA");
-    Lys.add("AAG");
-    Asn.add("AAC");
-    Asn.add("AAT");
-
-    Gln.add("CAA");
-    Gln.add("CAG");
-    His.add("CAC");
-    His.add("CAT");
-
-    Glu.add("GAA");
-    Glu.add("GAG");
-    Asp.add("GAC");
-    Asp.add("GAT");
-
-    Tyr.add("TAC");
-    Tyr.add("TAT");
-
-    Thr.add("ACA");
-    Thr.add("ACG");
-    Thr.add("ACC");
-    Thr.add("ACT");
-
-    Pro.add("CCA");
-    Pro.add("CCG");
-    Pro.add("CCC");
-    Pro.add("CCT");
-
-    Ala.add("GCA");
-    Ala.add("GCG");
-    Ala.add("GCC");
-    Ala.add("GCT");
-
-    Ser.add("TCA");
-    Ser.add("TCG");
-    Ser.add("TCC");
-    Ser.add("TCT");
-    Ser.add("AGC");
-    Ser.add("AGT");
-
-    Arg.add("AGA");
-    Arg.add("AGG");
-    Arg.add("CGA");
-    Arg.add("CGG");
-    Arg.add("CGC");
-    Arg.add("CGT");
-
-    Gly.add("GGA");
-    Gly.add("GGG");
-    Gly.add("GGC");
-    Gly.add("GGT");
-
-    STOP.add("TGA");
-    STOP.add("TAA");
-    STOP.add("TAG");
-
-    Trp.add("TGG");
-
-    Cys.add("TGC");
-    Cys.add("TGT");
-
-    Ile.add("ATA");
-    Ile.add("ATC");
-    Ile.add("ATT");
-
-    Met.add("ATG");
-
-    Leu.add("CTA");
-    Leu.add("CTG");
-    Leu.add("CTC");
-    Leu.add("CTT");
-    Leu.add("TTA");
-    Leu.add("TTG");
-
-    Val.add("GTA");
-    Val.add("GTG");
-    Val.add("GTC");
-    Val.add("GTT");
-
-    Phe.add("TTC");
-    Phe.add("TTT");
   }
 
   // Stores residue codes/names and colours and other things
-  public static Hashtable propHash = new Hashtable();
+  public static Map<String, Map<String, Integer>> propHash = new Hashtable<String, Map<String, Integer>>();
 
-  public static Hashtable hydrophobic = new Hashtable();
+  public static Map<String, Integer> hydrophobic = new Hashtable<String, Integer>();
 
-  public static Hashtable polar = new Hashtable();
+  public static Map<String, Integer> polar = new Hashtable<String, Integer>();
 
-  public static Hashtable small = new Hashtable();
+  public static Map<String, Integer> small = new Hashtable<String, Integer>();
 
-  public static Hashtable positive = new Hashtable();
+  public static Map<String, Integer> positive = new Hashtable<String, Integer>();
 
-  public static Hashtable negative = new Hashtable();
+  public static Map<String, Integer> negative = new Hashtable<String, Integer>();
 
-  public static Hashtable charged = new Hashtable();
+  public static Map<String, Integer> charged = new Hashtable<String, Integer>();
 
-  public static Hashtable aromatic = new Hashtable();
+  public static Map<String, Integer> aromatic = new Hashtable<String, Integer>();
 
-  public static Hashtable aliphatic = new Hashtable();
+  public static Map<String, Integer> aliphatic = new Hashtable<String, Integer>();
 
-  public static Hashtable tiny = new Hashtable();
+  public static Map<String, Integer> tiny = new Hashtable<String, Integer>();
 
-  public static Hashtable proline = new Hashtable();
+  public static Map<String, Integer> proline = new Hashtable<String, Integer>();
 
   static
   {
-    hydrophobic.put("I", new Integer(1));
-    hydrophobic.put("L", new Integer(1));
-    hydrophobic.put("V", new Integer(1));
-    hydrophobic.put("C", new Integer(1));
-    hydrophobic.put("A", new Integer(1));
-    hydrophobic.put("G", new Integer(1));
-    hydrophobic.put("M", new Integer(1));
-    hydrophobic.put("F", new Integer(1));
-    hydrophobic.put("Y", new Integer(1));
-    hydrophobic.put("W", new Integer(1));
-    hydrophobic.put("H", new Integer(1));
-    hydrophobic.put("K", new Integer(1));
-    hydrophobic.put("X", new Integer(1));
-    hydrophobic.put("-", new Integer(1));
-    hydrophobic.put("*", new Integer(1));
-    hydrophobic.put("R", new Integer(0));
-    hydrophobic.put("E", new Integer(0));
-    hydrophobic.put("Q", new Integer(0));
-    hydrophobic.put("D", new Integer(0));
-    hydrophobic.put("N", new Integer(0));
-    hydrophobic.put("S", new Integer(0));
-    hydrophobic.put("T", new Integer(0));
-    hydrophobic.put("P", new Integer(0));
+    hydrophobic.put("I", Integer.valueOf(1));
+    hydrophobic.put("L", Integer.valueOf(1));
+    hydrophobic.put("V", Integer.valueOf(1));
+    hydrophobic.put("C", Integer.valueOf(1));
+    hydrophobic.put("A", Integer.valueOf(1));
+    hydrophobic.put("G", Integer.valueOf(1));
+    hydrophobic.put("M", Integer.valueOf(1));
+    hydrophobic.put("F", Integer.valueOf(1));
+    hydrophobic.put("Y", Integer.valueOf(1));
+    hydrophobic.put("W", Integer.valueOf(1));
+    hydrophobic.put("H", Integer.valueOf(1));
+    hydrophobic.put("K", Integer.valueOf(1));
+    hydrophobic.put("X", Integer.valueOf(1));
+    hydrophobic.put("-", Integer.valueOf(1));
+    hydrophobic.put("*", Integer.valueOf(1));
+    hydrophobic.put("R", Integer.valueOf(0));
+    hydrophobic.put("E", Integer.valueOf(0));
+    hydrophobic.put("Q", Integer.valueOf(0));
+    hydrophobic.put("D", Integer.valueOf(0));
+    hydrophobic.put("N", Integer.valueOf(0));
+    hydrophobic.put("S", Integer.valueOf(0));
+    hydrophobic.put("T", Integer.valueOf(0));
+    hydrophobic.put("P", Integer.valueOf(0));
   }
 
   static
   {
-    polar.put("Y", new Integer(1));
-    polar.put("W", new Integer(1));
-    polar.put("H", new Integer(1));
-    polar.put("K", new Integer(1));
-    polar.put("R", new Integer(1));
-    polar.put("E", new Integer(1));
-    polar.put("Q", new Integer(1));
-    polar.put("D", new Integer(1));
-    polar.put("N", new Integer(1));
-    polar.put("S", new Integer(1));
-    polar.put("T", new Integer(1));
-    polar.put("X", new Integer(1));
-    polar.put("-", new Integer(1));
-    polar.put("*", new Integer(1));
-    polar.put("I", new Integer(0));
-    polar.put("L", new Integer(0));
-    polar.put("V", new Integer(0));
-    polar.put("C", new Integer(0));
-    polar.put("A", new Integer(0));
-    polar.put("G", new Integer(0));
-    polar.put("M", new Integer(0));
-    polar.put("F", new Integer(0));
-    polar.put("P", new Integer(0));
+    polar.put("Y", Integer.valueOf(1));
+    polar.put("W", Integer.valueOf(1));
+    polar.put("H", Integer.valueOf(1));
+    polar.put("K", Integer.valueOf(1));
+    polar.put("R", Integer.valueOf(1));
+    polar.put("E", Integer.valueOf(1));
+    polar.put("Q", Integer.valueOf(1));
+    polar.put("D", Integer.valueOf(1));
+    polar.put("N", Integer.valueOf(1));
+    polar.put("S", Integer.valueOf(1));
+    polar.put("T", Integer.valueOf(1));
+    polar.put("X", Integer.valueOf(1));
+    polar.put("-", Integer.valueOf(1));
+    polar.put("*", Integer.valueOf(1));
+    polar.put("I", Integer.valueOf(0));
+    polar.put("L", Integer.valueOf(0));
+    polar.put("V", Integer.valueOf(0));
+    polar.put("C", Integer.valueOf(0));
+    polar.put("A", Integer.valueOf(0));
+    polar.put("G", Integer.valueOf(0));
+    polar.put("M", Integer.valueOf(0));
+    polar.put("F", Integer.valueOf(0));
+    polar.put("P", Integer.valueOf(0));
   }
 
   static
   {
-    small.put("I", new Integer(0));
-    small.put("L", new Integer(0));
-    small.put("V", new Integer(1));
-    small.put("C", new Integer(1));
-    small.put("A", new Integer(1));
-    small.put("G", new Integer(1));
-    small.put("M", new Integer(0));
-    small.put("F", new Integer(0));
-    small.put("Y", new Integer(0));
-    small.put("W", new Integer(0));
-    small.put("H", new Integer(0));
-    small.put("K", new Integer(0));
-    small.put("R", new Integer(0));
-    small.put("E", new Integer(0));
-    small.put("Q", new Integer(0));
-    small.put("D", new Integer(1));
-    small.put("N", new Integer(1));
-    small.put("S", new Integer(1));
-    small.put("T", new Integer(1));
-    small.put("P", new Integer(1));
-    small.put("-", new Integer(1));
-    small.put("*", new Integer(1));
+    small.put("I", Integer.valueOf(0));
+    small.put("L", Integer.valueOf(0));
+    small.put("V", Integer.valueOf(1));
+    small.put("C", Integer.valueOf(1));
+    small.put("A", Integer.valueOf(1));
+    small.put("G", Integer.valueOf(1));
+    small.put("M", Integer.valueOf(0));
+    small.put("F", Integer.valueOf(0));
+    small.put("Y", Integer.valueOf(0));
+    small.put("W", Integer.valueOf(0));
+    small.put("H", Integer.valueOf(0));
+    small.put("K", Integer.valueOf(0));
+    small.put("R", Integer.valueOf(0));
+    small.put("E", Integer.valueOf(0));
+    small.put("Q", Integer.valueOf(0));
+    small.put("D", Integer.valueOf(1));
+    small.put("N", Integer.valueOf(1));
+    small.put("S", Integer.valueOf(1));
+    small.put("T", Integer.valueOf(1));
+    small.put("P", Integer.valueOf(1));
+    small.put("-", Integer.valueOf(1));
+    small.put("*", Integer.valueOf(1));
   }
 
   static
   {
-    positive.put("I", new Integer(0));
-    positive.put("L", new Integer(0));
-    positive.put("V", new Integer(0));
-    positive.put("C", new Integer(0));
-    positive.put("A", new Integer(0));
-    positive.put("G", new Integer(0));
-    positive.put("M", new Integer(0));
-    positive.put("F", new Integer(0));
-    positive.put("Y", new Integer(0));
-    positive.put("W", new Integer(0));
-    positive.put("H", new Integer(1));
-    positive.put("K", new Integer(1));
-    positive.put("R", new Integer(1));
-    positive.put("E", new Integer(0));
-    positive.put("Q", new Integer(0));
-    positive.put("D", new Integer(0));
-    positive.put("N", new Integer(0));
-    positive.put("S", new Integer(0));
-    positive.put("T", new Integer(0));
-    positive.put("P", new Integer(0));
-    positive.put("-", new Integer(1));
-    positive.put("*", new Integer(1));
+    positive.put("I", Integer.valueOf(0));
+    positive.put("L", Integer.valueOf(0));
+    positive.put("V", Integer.valueOf(0));
+    positive.put("C", Integer.valueOf(0));
+    positive.put("A", Integer.valueOf(0));
+    positive.put("G", Integer.valueOf(0));
+    positive.put("M", Integer.valueOf(0));
+    positive.put("F", Integer.valueOf(0));
+    positive.put("Y", Integer.valueOf(0));
+    positive.put("W", Integer.valueOf(0));
+    positive.put("H", Integer.valueOf(1));
+    positive.put("K", Integer.valueOf(1));
+    positive.put("R", Integer.valueOf(1));
+    positive.put("E", Integer.valueOf(0));
+    positive.put("Q", Integer.valueOf(0));
+    positive.put("D", Integer.valueOf(0));
+    positive.put("N", Integer.valueOf(0));
+    positive.put("S", Integer.valueOf(0));
+    positive.put("T", Integer.valueOf(0));
+    positive.put("P", Integer.valueOf(0));
+    positive.put("-", Integer.valueOf(1));
+    positive.put("*", Integer.valueOf(1));
   }
 
   static
   {
-    negative.put("I", new Integer(0));
-    negative.put("L", new Integer(0));
-    negative.put("V", new Integer(0));
-    negative.put("C", new Integer(0));
-    negative.put("A", new Integer(0));
-    negative.put("G", new Integer(0));
-    negative.put("M", new Integer(0));
-    negative.put("F", new Integer(0));
-    negative.put("Y", new Integer(0));
-    negative.put("W", new Integer(0));
-    negative.put("H", new Integer(0));
-    negative.put("K", new Integer(0));
-    negative.put("R", new Integer(0));
-    negative.put("E", new Integer(1));
-    negative.put("Q", new Integer(0));
-    negative.put("D", new Integer(1));
-    negative.put("N", new Integer(0));
-    negative.put("S", new Integer(0));
-    negative.put("T", new Integer(0));
-    negative.put("P", new Integer(0));
-    negative.put("-", new Integer(1));
-    negative.put("*", new Integer(1));
+    negative.put("I", Integer.valueOf(0));
+    negative.put("L", Integer.valueOf(0));
+    negative.put("V", Integer.valueOf(0));
+    negative.put("C", Integer.valueOf(0));
+    negative.put("A", Integer.valueOf(0));
+    negative.put("G", Integer.valueOf(0));
+    negative.put("M", Integer.valueOf(0));
+    negative.put("F", Integer.valueOf(0));
+    negative.put("Y", Integer.valueOf(0));
+    negative.put("W", Integer.valueOf(0));
+    negative.put("H", Integer.valueOf(0));
+    negative.put("K", Integer.valueOf(0));
+    negative.put("R", Integer.valueOf(0));
+    negative.put("E", Integer.valueOf(1));
+    negative.put("Q", Integer.valueOf(0));
+    negative.put("D", Integer.valueOf(1));
+    negative.put("N", Integer.valueOf(0));
+    negative.put("S", Integer.valueOf(0));
+    negative.put("T", Integer.valueOf(0));
+    negative.put("P", Integer.valueOf(0));
+    negative.put("-", Integer.valueOf(1));
+    negative.put("*", Integer.valueOf(1));
   }
 
   static
   {
-    charged.put("I", new Integer(0));
-    charged.put("L", new Integer(0));
-    charged.put("V", new Integer(0));
-    charged.put("C", new Integer(0));
-    charged.put("A", new Integer(0));
-    charged.put("G", new Integer(0));
-    charged.put("M", new Integer(0));
-    charged.put("F", new Integer(0));
-    charged.put("Y", new Integer(0));
-    charged.put("W", new Integer(0));
-    charged.put("H", new Integer(1));
-    charged.put("K", new Integer(1));
-    charged.put("R", new Integer(1));
-    charged.put("E", new Integer(1));
-    charged.put("Q", new Integer(0));
-    charged.put("D", new Integer(1));
-    charged.put("N", new Integer(0)); // Asparagine is polar but not charged.
+    charged.put("I", Integer.valueOf(0));
+    charged.put("L", Integer.valueOf(0));
+    charged.put("V", Integer.valueOf(0));
+    charged.put("C", Integer.valueOf(0));
+    charged.put("A", Integer.valueOf(0));
+    charged.put("G", Integer.valueOf(0));
+    charged.put("M", Integer.valueOf(0));
+    charged.put("F", Integer.valueOf(0));
+    charged.put("Y", Integer.valueOf(0));
+    charged.put("W", Integer.valueOf(0));
+    charged.put("H", Integer.valueOf(1));
+    charged.put("K", Integer.valueOf(1));
+    charged.put("R", Integer.valueOf(1));
+    charged.put("E", Integer.valueOf(1));
+    charged.put("Q", Integer.valueOf(0));
+    charged.put("D", Integer.valueOf(1));
+    charged.put("N", Integer.valueOf(0)); // Asparagine is polar but not
+                                          // charged.
                                       // Alternative would be charged and
                                       // negative (in basic form)?
-    charged.put("S", new Integer(0));
-    charged.put("T", new Integer(0));
-    charged.put("P", new Integer(0));
-    charged.put("-", new Integer(1));
-    charged.put("*", new Integer(1));
+    charged.put("S", Integer.valueOf(0));
+    charged.put("T", Integer.valueOf(0));
+    charged.put("P", Integer.valueOf(0));
+    charged.put("-", Integer.valueOf(1));
+    charged.put("*", Integer.valueOf(1));
   }
 
   static
   {
-    aromatic.put("I", new Integer(0));
-    aromatic.put("L", new Integer(0));
-    aromatic.put("V", new Integer(0));
-    aromatic.put("C", new Integer(0));
-    aromatic.put("A", new Integer(0));
-    aromatic.put("G", new Integer(0));
-    aromatic.put("M", new Integer(0));
-    aromatic.put("F", new Integer(1));
-    aromatic.put("Y", new Integer(1));
-    aromatic.put("W", new Integer(1));
-    aromatic.put("H", new Integer(1));
-    aromatic.put("K", new Integer(0));
-    aromatic.put("R", new Integer(0));
-    aromatic.put("E", new Integer(0));
-    aromatic.put("Q", new Integer(0));
-    aromatic.put("D", new Integer(0));
-    aromatic.put("N", new Integer(0));
-    aromatic.put("S", new Integer(0));
-    aromatic.put("T", new Integer(0));
-    aromatic.put("P", new Integer(0));
-    aromatic.put("-", new Integer(1));
-    aromatic.put("*", new Integer(1));
+    aromatic.put("I", Integer.valueOf(0));
+    aromatic.put("L", Integer.valueOf(0));
+    aromatic.put("V", Integer.valueOf(0));
+    aromatic.put("C", Integer.valueOf(0));
+    aromatic.put("A", Integer.valueOf(0));
+    aromatic.put("G", Integer.valueOf(0));
+    aromatic.put("M", Integer.valueOf(0));
+    aromatic.put("F", Integer.valueOf(1));
+    aromatic.put("Y", Integer.valueOf(1));
+    aromatic.put("W", Integer.valueOf(1));
+    aromatic.put("H", Integer.valueOf(1));
+    aromatic.put("K", Integer.valueOf(0));
+    aromatic.put("R", Integer.valueOf(0));
+    aromatic.put("E", Integer.valueOf(0));
+    aromatic.put("Q", Integer.valueOf(0));
+    aromatic.put("D", Integer.valueOf(0));
+    aromatic.put("N", Integer.valueOf(0));
+    aromatic.put("S", Integer.valueOf(0));
+    aromatic.put("T", Integer.valueOf(0));
+    aromatic.put("P", Integer.valueOf(0));
+    aromatic.put("-", Integer.valueOf(1));
+    aromatic.put("*", Integer.valueOf(1));
   }
 
   static
   {
-    aliphatic.put("I", new Integer(1));
-    aliphatic.put("L", new Integer(1));
-    aliphatic.put("V", new Integer(1));
-    aliphatic.put("C", new Integer(0));
-    aliphatic.put("A", new Integer(0));
-    aliphatic.put("G", new Integer(0));
-    aliphatic.put("M", new Integer(0));
-    aliphatic.put("F", new Integer(0));
-    aliphatic.put("Y", new Integer(0));
-    aliphatic.put("W", new Integer(0));
-    aliphatic.put("H", new Integer(0));
-    aliphatic.put("K", new Integer(0));
-    aliphatic.put("R", new Integer(0));
-    aliphatic.put("E", new Integer(0));
-    aliphatic.put("Q", new Integer(0));
-    aliphatic.put("D", new Integer(0));
-    aliphatic.put("N", new Integer(0));
-    aliphatic.put("S", new Integer(0));
-    aliphatic.put("T", new Integer(0));
-    aliphatic.put("P", new Integer(0));
-    aliphatic.put("-", new Integer(1));
-    aliphatic.put("*", new Integer(1));
+    aliphatic.put("I", Integer.valueOf(1));
+    aliphatic.put("L", Integer.valueOf(1));
+    aliphatic.put("V", Integer.valueOf(1));
+    aliphatic.put("C", Integer.valueOf(0));
+    aliphatic.put("A", Integer.valueOf(0));
+    aliphatic.put("G", Integer.valueOf(0));
+    aliphatic.put("M", Integer.valueOf(0));
+    aliphatic.put("F", Integer.valueOf(0));
+    aliphatic.put("Y", Integer.valueOf(0));
+    aliphatic.put("W", Integer.valueOf(0));
+    aliphatic.put("H", Integer.valueOf(0));
+    aliphatic.put("K", Integer.valueOf(0));
+    aliphatic.put("R", Integer.valueOf(0));
+    aliphatic.put("E", Integer.valueOf(0));
+    aliphatic.put("Q", Integer.valueOf(0));
+    aliphatic.put("D", Integer.valueOf(0));
+    aliphatic.put("N", Integer.valueOf(0));
+    aliphatic.put("S", Integer.valueOf(0));
+    aliphatic.put("T", Integer.valueOf(0));
+    aliphatic.put("P", Integer.valueOf(0));
+    aliphatic.put("-", Integer.valueOf(1));
+    aliphatic.put("*", Integer.valueOf(1));
   }
 
   static
   {
-    tiny.put("I", new Integer(0));
-    tiny.put("L", new Integer(0));
-    tiny.put("V", new Integer(0));
-    tiny.put("C", new Integer(0));
-    tiny.put("A", new Integer(1));
-    tiny.put("G", new Integer(1));
-    tiny.put("M", new Integer(0));
-    tiny.put("F", new Integer(0));
-    tiny.put("Y", new Integer(0));
-    tiny.put("W", new Integer(0));
-    tiny.put("H", new Integer(0));
-    tiny.put("K", new Integer(0));
-    tiny.put("R", new Integer(0));
-    tiny.put("E", new Integer(0));
-    tiny.put("Q", new Integer(0));
-    tiny.put("D", new Integer(0));
-    tiny.put("N", new Integer(0));
-    tiny.put("S", new Integer(1));
-    tiny.put("T", new Integer(0));
-    tiny.put("P", new Integer(0));
-    tiny.put("-", new Integer(1));
-    tiny.put("*", new Integer(1));
+    tiny.put("I", Integer.valueOf(0));
+    tiny.put("L", Integer.valueOf(0));
+    tiny.put("V", Integer.valueOf(0));
+    tiny.put("C", Integer.valueOf(0));
+    tiny.put("A", Integer.valueOf(1));
+    tiny.put("G", Integer.valueOf(1));
+    tiny.put("M", Integer.valueOf(0));
+    tiny.put("F", Integer.valueOf(0));
+    tiny.put("Y", Integer.valueOf(0));
+    tiny.put("W", Integer.valueOf(0));
+    tiny.put("H", Integer.valueOf(0));
+    tiny.put("K", Integer.valueOf(0));
+    tiny.put("R", Integer.valueOf(0));
+    tiny.put("E", Integer.valueOf(0));
+    tiny.put("Q", Integer.valueOf(0));
+    tiny.put("D", Integer.valueOf(0));
+    tiny.put("N", Integer.valueOf(0));
+    tiny.put("S", Integer.valueOf(1));
+    tiny.put("T", Integer.valueOf(0));
+    tiny.put("P", Integer.valueOf(0));
+    tiny.put("-", Integer.valueOf(1));
+    tiny.put("*", Integer.valueOf(1));
   }
 
   static
   {
-    proline.put("I", new Integer(0));
-    proline.put("L", new Integer(0));
-    proline.put("V", new Integer(0));
-    proline.put("C", new Integer(0));
-    proline.put("A", new Integer(0));
-    proline.put("G", new Integer(0));
-    proline.put("M", new Integer(0));
-    proline.put("F", new Integer(0));
-    proline.put("Y", new Integer(0));
-    proline.put("W", new Integer(0));
-    proline.put("H", new Integer(0));
-    proline.put("K", new Integer(0));
-    proline.put("R", new Integer(0));
-    proline.put("E", new Integer(0));
-    proline.put("Q", new Integer(0));
-    proline.put("D", new Integer(0));
-    proline.put("N", new Integer(0));
-    proline.put("S", new Integer(0));
-    proline.put("T", new Integer(0));
-    proline.put("P", new Integer(1));
-    proline.put("-", new Integer(1));
-    proline.put("*", new Integer(1));
+    proline.put("I", Integer.valueOf(0));
+    proline.put("L", Integer.valueOf(0));
+    proline.put("V", Integer.valueOf(0));
+    proline.put("C", Integer.valueOf(0));
+    proline.put("A", Integer.valueOf(0));
+    proline.put("G", Integer.valueOf(0));
+    proline.put("M", Integer.valueOf(0));
+    proline.put("F", Integer.valueOf(0));
+    proline.put("Y", Integer.valueOf(0));
+    proline.put("W", Integer.valueOf(0));
+    proline.put("H", Integer.valueOf(0));
+    proline.put("K", Integer.valueOf(0));
+    proline.put("R", Integer.valueOf(0));
+    proline.put("E", Integer.valueOf(0));
+    proline.put("Q", Integer.valueOf(0));
+    proline.put("D", Integer.valueOf(0));
+    proline.put("N", Integer.valueOf(0));
+    proline.put("S", Integer.valueOf(0));
+    proline.put("T", Integer.valueOf(0));
+    proline.put("P", Integer.valueOf(1));
+    proline.put("-", Integer.valueOf(1));
+    proline.put("*", Integer.valueOf(1));
   }
 
   static
@@ -1368,11 +1215,9 @@ public class ResidueProperties
         propMatrixF[i][j] = 0;
         propMatrixPos[i][j] = 0;
         propMatrixEpos[i][j] = 0;
-        for (Enumeration<String> en = propHash.keys(); en.hasMoreElements();)
+        for (String ph : propHash.keySet())
         {
-          String ph = en.nextElement();
-          Map<String, Integer> pph = (Map<String, Integer>) propHash
-                  .get(ph);
+          Map<String, Integer> pph = propHash.get(ph);
           if (pph.get(ic) != null && pph.get(jc) != null)
           {
             int icp = pph.get(ic).intValue(), jcp = pph.get(jc).intValue();
@@ -1470,22 +1315,8 @@ public class ResidueProperties
     return pog;
   }
 
-  public static Vector getCodons(String res)
-  {
-    if (codonHash.containsKey(res))
-    {
-      return (Vector) codonHash.get(res);
-    }
-
-    return null;
-  }
-
   public static String codonTranslate(String lccodon)
   {
-    if (false)
-    {
-      return _codonTranslate(lccodon);
-    }
     String cdn = codonHash2.get(lccodon.toUpperCase());
     if ("*".equals(cdn))
     {
@@ -1494,25 +1325,6 @@ public class ResidueProperties
     return cdn;
   }
 
-  public static String _codonTranslate(String lccodon)
-  {
-    String codon = lccodon.toUpperCase();
-    // all base ambiguity codes yield an 'X' amino acid residue
-    if (codon.indexOf('X') > -1 || codon.indexOf('N') > -1)
-    {
-      return "X";
-    }
-    for (String key : codonHash.keySet())
-    {
-      if (codonHash.get(key).contains(codon))
-      {
-        return key;
-      }
-    }
-
-    return null;
-  }
-
   public static int[][] getDefaultPeptideMatrix()
   {
     return ResidueProperties.getBLOSUM62();
@@ -1560,10 +1372,10 @@ public class ResidueProperties
     return pog;
   }
 
-  public static Hashtable toDssp3State;
+  public static Hashtable<String, String> toDssp3State;
   static
   {
-    toDssp3State = new Hashtable();
+    toDssp3State = new Hashtable<String, String>();
     toDssp3State.put("H", "H");
     toDssp3State.put("E", "E");
     toDssp3State.put("C", " ");
@@ -1593,7 +1405,7 @@ public class ResidueProperties
       String ssc = ssstring.substring(i, i + 1);
       if (toDssp3State.containsKey(ssc))
       {
-        ss.append((String) toDssp3State.get(ssc));
+        ss.append(toDssp3State.get(ssc));
       }
       else
       {
@@ -2921,51 +2733,47 @@ public class ResidueProperties
 
   }
 
-  public static String getCanonicalAminoAcid(String aa)
+  public static String getCanonicalAminoAcid(String aA)
   {
-    String canonical = modifications.get(aa);
-    return canonical == null ? aa : canonical;
+    String canonical = modifications.get(aA);
+    return canonical == null ? aA : canonical;
   }
 
   // main method generates perl representation of residue property hash
   // / cut here
   public static void main(String[] args)
   {
-    Hashtable aa = new Hashtable();
+    Hashtable<String, Vector<String>> aaProps = new Hashtable<String, Vector<String>>();
     System.out.println("my %aa = {");
     // invert property hashes
-    Enumeration prop = propHash.keys();
-    while (prop.hasMoreElements())
+    for (String pname : propHash.keySet())
     {
-      String pname = (String) prop.nextElement();
-      Hashtable phash = (Hashtable) propHash.get(pname);
-      Enumeration res = phash.keys();
-      while (res.hasMoreElements())
+      Map<String, Integer> phash = propHash.get(pname);
+      for (String rname : phash.keySet())
       {
-        String rname = (String) res.nextElement();
-        Vector aprops = (Vector) aa.get(rname);
+        Vector<String> aprops = aaProps.get(rname);
         if (aprops == null)
         {
-          aprops = new Vector();
-          aa.put(rname, aprops);
+          aprops = new Vector<String>();
+          aaProps.put(rname, aprops);
         }
-        Integer hasprop = (Integer) phash.get(rname);
+        Integer hasprop = phash.get(rname);
         if (hasprop.intValue() == 1)
         {
           aprops.addElement(pname);
         }
       }
     }
-    Enumeration res = aa.keys();
+    Enumeration<String> res = aaProps.keys();
     while (res.hasMoreElements())
     {
-      String rname = (String) res.nextElement();
+      String rname = res.nextElement();
 
       System.out.print("'" + rname + "' => [");
-      Enumeration props = ((Vector) aa.get(rname)).elements();
+      Enumeration<String> props = aaProps.get(rname).elements();
       while (props.hasMoreElements())
       {
-        System.out.print("'" + (String) props.nextElement() + "'");
+        System.out.print("'" + props.nextElement() + "'");
         if (props.hasMoreElements())
         {
           System.out.println(", ");
@@ -2981,15 +2789,15 @@ public class ResidueProperties
   /**
    * Returns a list of residue characters for the specified inputs
    * 
-   * @param nucleotide
+   * @param forNucleotide
    * @param includeAmbiguous
    * @return
    */
-  public static List<String> getResidues(boolean nucleotide,
+  public static List<String> getResidues(boolean forNucleotide,
           boolean includeAmbiguous)
   {
     List<String> result = new ArrayList<String>();
-    if (nucleotide)
+    if (forNucleotide)
     {
       for (String nuc : nucleotideName.keySet())
       {
index 97f2e1c..80319be 100644 (file)
@@ -44,7 +44,6 @@ import jalview.datamodel.SequenceI;
 import jalview.schemes.Blosum62ColourScheme;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.PIDColourScheme;
-import jalview.schemes.ResidueProperties;
 import jalview.structure.CommandListener;
 import jalview.structure.StructureSelectionManager;
 import jalview.structure.VamsasSource;
@@ -58,6 +57,7 @@ import jalview.workers.ConsensusThread;
 import jalview.workers.StrucConsensusThread;
 
 import java.awt.Color;
+import java.beans.PropertyChangeSupport;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.BitSet;
@@ -807,7 +807,8 @@ public abstract class AlignmentViewport implements AlignViewportI,
   public void updateConservation(final AlignmentViewPanel ap)
   {
     // see note in mantis : issue number 8585
-    if (alignment.isNucleotide() || conservation == null
+    if (alignment.isNucleotide()
+            || (conservation == null && quality == null)
             || !autoCalculateConsensus)
     {
       return;
@@ -913,6 +914,35 @@ public abstract class AlignmentViewport implements AlignViewportI,
     return false;
   }
 
+  public void setAlignment(AlignmentI align)
+  {
+    this.alignment = align;
+  }
+
+  /**
+   * Clean up references when this viewport is closed
+   */
+  @Override
+  public void dispose()
+  {
+    /*
+     * defensively null out references to large objects in case
+     * this object is not garbage collected (as if!)
+     */
+    consensus = null;
+    complementConsensus = null;
+    strucConsensus = null;
+    conservation = null;
+    quality = null;
+    groupConsensus = null;
+    groupConservation = null;
+    hconsensus = null;
+    hcomplementConsensus = null;
+    // TODO removed listeners from changeSupport?
+    changeSupport = null;
+    setAlignment(null);
+  }
+
   @Override
   public boolean isClosed()
   {
@@ -1107,6 +1137,13 @@ public abstract class AlignmentViewport implements AlignViewportI,
   }
 
   @Override
+  public boolean hasSelectedColumns()
+  {
+    ColumnSelection columnSelection = getColumnSelection();
+    return columnSelection != null && columnSelection.hasSelectedColumns();
+  }
+
+  @Override
   public boolean hasHiddenColumns()
   {
     return colSel != null && colSel.hasHiddenColumns();
@@ -1233,10 +1270,9 @@ public abstract class AlignmentViewport implements AlignViewportI,
     return ignoreGapsInConsensusCalculation;
   }
 
-  // / property change stuff
-
+  // property change stuff
   // JBPNote Prolly only need this in the applet version.
-  private final java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
+  private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
           this);
 
   protected boolean showConservation = true;
@@ -1827,9 +1863,9 @@ public abstract class AlignmentViewport implements AlignViewportI,
       cs.setConsensus(hconsensus);
       if (cs.conservationApplied())
       {
-        cs.setConservation(Conservation.calculateConservation("All",
-                ResidueProperties.propHash, 3, alignment.getSequences(), 0,
-                alignment.getWidth(), false, getConsPercGaps(), false));
+        cs.setConservation(Conservation.calculateConservation("All", 3,
+                alignment.getSequences(), 0, alignment.getWidth(), false,
+                getConsPercGaps(), false));
       }
     }
 
@@ -2763,8 +2799,7 @@ public abstract class AlignmentViewport implements AlignViewportI,
     if (sg != null
             && (sgs = sg.getStartRes()) >= 0
             && sg.getStartRes() <= (sge = sg.getEndRes())
-            && (colSel == null || colSel.getSelected() == null || colSel
-                    .getSelected().size() == 0))
+            && !this.hasSelectedColumns())
     {
       if (!wholewidth && alignment.getWidth() == (1 + sge - sgs))
       {
index 5c303fd..11ec521 100644 (file)
@@ -94,8 +94,7 @@ public class ConservationThread extends AlignCalcWorker
       }
       try
       {
-        cons = Conservation.calculateConservation("All",
-                jalview.schemes.ResidueProperties.propHash, 3,
+        cons = Conservation.calculateConservation("All", 3,
                 alignment.getSequences(), 0, alWidth - 1, false,
                 ConsPercGaps, quality != null);
       } catch (IndexOutOfBoundsException x)
index f33525f..f96d2c9 100644 (file)
@@ -188,6 +188,33 @@ public class RnaTest
     }
   }
 
+  @Test(groups = { "Functional" })
+  public void testIsCanonicalPair()
+  {
+    String bases = "acgtuACGTU";
+    for (int i = 0; i < bases.length(); i++)
+    {
+      for (int j = 0; j < bases.length(); j++)
+      {
+        char first = bases.charAt(i);
+        char second = bases.charAt(j);
+        boolean result = Rna.isCanonicalPair(first, second);
+        String pair = new String(new char[] { first, second })
+                .toUpperCase();
+        if (pair.equals("AT") || pair.equals("TA") || pair.equals("AU")
+                || pair.equals("UA") || pair.equals("GC")
+                || pair.equals("CG"))
+        {
+          assertTrue(pair + " should be valid", result);
+        }
+        else
+        {
+          assertFalse(pair + " should be invalid", result);
+        }
+      }
+    }
+  }
+
   /**
    * Tests for isOpeningParenthesis with char or String argument
    */
index e59719c..a943e7c 100644 (file)
@@ -22,12 +22,14 @@ package jalview.datamodel;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertFalse;
-import static org.testng.AssertJUnit.assertNotSame;
 import static org.testng.AssertJUnit.assertSame;
 import static org.testng.AssertJUnit.assertTrue;
+import static org.testng.AssertJUnit.fail;
 
 import java.util.Arrays;
 import java.util.BitSet;
+import java.util.Collections;
+import java.util.ConcurrentModificationException;
 import java.util.List;
 
 import org.testng.annotations.Test;
@@ -68,8 +70,8 @@ public class ColumnSelectionTest
 
     // removing an element in the list removes it
     cs.removeElement(2);
-    // ...but not from the copy list!
-    assertEquals(2, sel.size());
+    // ...and also from the read-only view
+    assertEquals(1, sel.size());
     sel = cs.getSelected();
     assertEquals(1, sel.size());
     assertEquals(new Integer(5), sel.get(0));
@@ -542,7 +544,7 @@ public class ColumnSelectionTest
    * were added
    */
   @Test(groups = { "Functional" })
-  public void testGetSelection()
+  public void testGetSelected()
   {
     ColumnSelection cs = new ColumnSelection();
     int[] sel = { 4, 3, 7, 21 };
@@ -551,32 +553,90 @@ public class ColumnSelectionTest
       cs.addElement(col);
     }
 
-    List<Integer> selected1 = cs.getSelected();
-    assertEquals(4, selected1.size());
+    List<Integer> selected = cs.getSelected();
+    assertEquals(4, selected.size());
+    assertEquals("[4, 3, 7, 21]", selected.toString());
 
     /*
-     * getSelected returns a copy, verify the list
-     * is externally immutable
+     * getSelected returns a read-only view of the list
+     * verify the view follows any changes in it
      */
-    selected1.clear();
-    List<Integer> selected2 = cs.getSelected();
-    assertNotSame(selected1, selected2);
-    assertEquals(4, selected2.size());
-    int i = 0;
-    for (int col : sel)
+    cs.removeElement(7);
+    cs.addElement(1);
+    cs.removeElement(4);
+    assertEquals("[3, 21, 1]", selected.toString());
+  }
+
+  /**
+   * Test to verify that the list returned by getSelection cannot be modified
+   */
+  @Test(groups = { "Functional" })
+  public void testGetSelected_isReadOnly()
+  {
+    ColumnSelection cs = new ColumnSelection();
+    cs.addElement(3);
+
+    List<Integer> selected = cs.getSelected();
+    try
+    {
+      selected.clear();
+      fail("expected exception");
+    } catch (UnsupportedOperationException e)
+    {
+      // expected
+    }
+    try
+    {
+      selected.add(1);
+      fail("expected exception");
+    } catch (UnsupportedOperationException e)
+    {
+      // expected
+    }
+    try
+    {
+      selected.remove(3);
+      fail("expected exception");
+    } catch (UnsupportedOperationException e)
     {
-      assertEquals(col, selected2.get(i++).intValue());
+      // expected
     }
+    try
+    {
+      Collections.sort(selected);
+      fail("expected exception");
+    } catch (UnsupportedOperationException e)
+    {
+      // expected
+    }
+  }
 
-    cs.removeElement(7);
+  /**
+   * Test that demonstrates a ConcurrentModificationException is thrown if you
+   * change the selection while iterating over it
+   */
+  @Test(
+    groups = "Functional",
+    expectedExceptions = { ConcurrentModificationException.class })
+  public void testGetSelected_concurrentModification()
+  {
+    ColumnSelection cs = new ColumnSelection();
+    cs.addElement(0);
     cs.addElement(1);
-    cs.removeElement(4);
+    cs.addElement(2);
 
-    List<Integer> selected3 = cs.getSelected();
-    assertEquals(3, selected3.size());
-    assertEquals(3, selected3.get(0).intValue());
-    assertEquals(21, selected3.get(1).intValue());
-    assertEquals(1, selected3.get(2).intValue());
+    /*
+     * simulate changing the list under us (e.g. in a separate
+     * thread) while iterating over it -> ConcurrentModificationException
+     */
+    List<Integer> selected = cs.getSelected();
+    for (Integer col : selected)
+    {
+      if (col.intValue() == 0)
+      {
+        cs.removeElement(1);
+      }
+    }
   }
 
   @Test(groups = "Functional")
@@ -669,4 +729,25 @@ public class ColumnSelectionTest
     assertTrue(selected.contains(6));
     assertTrue(selected.contains(10));
   }
+
+  @Test(groups = "Functional")
+  public void testCopyConstructor()
+  {
+    ColumnSelection cs = new ColumnSelection();
+    cs.addElement(3);
+    cs.addElement(1);
+    cs.hideColumns(10, 11);
+    cs.hideColumns(5, 7);
+    assertEquals("[5, 7]", Arrays.toString(cs.getHiddenColumns().get(0)));
+
+    ColumnSelection cs2 = new ColumnSelection(cs);
+    assertTrue(cs2.hasSelectedColumns());
+    assertTrue(cs2.hasHiddenColumns());
+    // order of column selection is preserved
+    assertEquals("[3, 1]", cs2.getSelected().toString());
+    assertEquals(2, cs2.getHiddenColumns().size());
+    // hidden columns are held in column order
+    assertEquals("[5, 7]", Arrays.toString(cs2.getHiddenColumns().get(0)));
+    assertEquals("[10, 11]", Arrays.toString(cs2.getHiddenColumns().get(1)));
+  }
 }
index eff3fdc..bbad963 100644 (file)
@@ -26,9 +26,13 @@ import static org.testng.AssertJUnit.assertNotNull;
 import static org.testng.AssertJUnit.assertSame;
 import static org.testng.AssertJUnit.assertTrue;
 
+import jalview.bin.Cache;
+import jalview.bin.Jalview;
 import jalview.datamodel.AlignedCodonFrame;
 import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.PDBEntry.Type;
 import jalview.datamodel.Sequence;
@@ -55,8 +59,7 @@ public class AlignViewportTest
   @BeforeClass(alwaysRun = true)
   public static void setUpBeforeClass() throws Exception
   {
-    jalview.bin.Jalview.main(new String[] { "-props",
-        "test/jalview/testProps.jvprops" });
+    Jalview.main(new String[] { "-props", "test/jalview/testProps.jvprops" });
   }
 
   @BeforeMethod(alwaysRun = true)
@@ -297,4 +300,32 @@ public class AlignViewportTest
     assertTrue(ssmMappings.contains(acf2));
     assertFalse(ssmMappings.contains(acf3));
   }
+  
+  /**
+   * Test for JAL-1306 - conservation thread should run even when only Quality
+   * (and not Conservation) is enabled in Preferences
+   */
+  @Test(groups = { "Functional" })
+  public void testUpdateConservation_qualityOnly()
+  {
+    Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS",
+            Boolean.TRUE.toString());
+    Cache.applicationProperties.setProperty("SHOW_QUALITY",
+            Boolean.TRUE.toString());
+    Cache.applicationProperties.setProperty("SHOW_CONSERVATION",
+            Boolean.FALSE.toString());
+    Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+            Boolean.FALSE.toString());
+    AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+            "examples/uniref50.fa", FormatAdapter.FILE);
+    AlignmentAnnotation[] anns = af.viewport.getAlignment().getAlignmentAnnotation();
+    assertNotNull("No annotations found", anns);
+    assertEquals("More than one annotation found", 1, anns.length);
+    assertTrue("Annotation is not Quality",
+            anns[0].description.startsWith("Alignment Quality"));
+    Annotation[] annotations = anns[0].annotations;
+    assertNotNull("Quality annotations are null", annotations);
+    assertNotNull("Quality in column 1 is null", annotations[0]);
+    assertTrue("No quality value in column 1", annotations[0].value > 10f);
+  }
 }
index f08fa8d..6621a94 100644 (file)
@@ -75,6 +75,7 @@ public class AnnotationChooserTest
   @BeforeMethod(alwaysRun = true)
   public void setUp() throws IOException
   {
+    Cache.loadProperties("test/jalview/io/testProps.jvprops");
     // pin down annotation sort order for test
     Cache.applicationProperties.setProperty(Preferences.SORT_ANNOTATIONS,
             SequenceAnnotationOrder.NONE.name());
index 9d0cedb..489fe4f 100644 (file)
@@ -23,16 +23,12 @@ package jalview.gui;
 import jalview.bin.Cache;
 
 import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
 
 import javax.swing.JDesktopPane;
 import javax.swing.JFrame;
 import javax.swing.JInternalFrame;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
 import javax.swing.JTextArea;
 
 import org.testng.annotations.AfterClass;
@@ -64,49 +60,29 @@ public class JAL1353bugdemo
     foo.setPreferredSize(new Dimension(600, 800));
     cfoo.setSize(600, 800);
     final JInternalFrame cont = new JInternalFrame("My Frame");
-    JTextArea evt;
-    cont.setPreferredSize(new Dimension(400, 300));
-    cont.add(evt = new JTextArea(
-            "Click here and drag text over this window to freeze java.\n\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\nThis is a dummy string. See teh dummy string go.\n"));
+    cont.setPreferredSize(new Dimension(400, 400));
+    String msg = "This is a dummy string. See the dummy string go.\n";
+    msg += msg; // 2
+    msg += msg; // 4
+    msg += msg; // 8
+    msg += msg; // 16
+    JTextArea evt = new JTextArea(
+            "Click here and drag text over this window to freeze java.\n\n"
+                    + msg);
+    cont.add(evt);
     cont.pack();
     foo.add("A frame", cont);
     foo.setVisible(true);
     foo.setEnabled(true);
     foo.doLayout();
     cfoo.add(foo);
-    final JMenu jm = new JMenu("Do");
-    JMenuItem jmi = new JMenuItem("this");
-    jm.add(jmi);
-    evt.addMouseListener(new MouseListener()
+    // final JMenu jm = new JMenu("Do");
+    // JMenuItem jmi = new JMenuItem("this");
+    // jm.add(jmi);
+    evt.addMouseListener(new MouseAdapter()
     {
 
       @Override
-      public void mouseReleased(MouseEvent e)
-      {
-      }
-
-      @Override
-      public void mousePressed(MouseEvent e)
-      {
-        // TODO Auto-generated method stub
-
-      }
-
-      @Override
-      public void mouseExited(MouseEvent e)
-      {
-        // TODO Auto-generated method stub
-
-      }
-
-      @Override
-      public void mouseEntered(MouseEvent e)
-      {
-        // TODO Auto-generated method stub
-
-      }
-
-      @Override
       public void mouseClicked(MouseEvent e)
       {
         // JFrame parent = new JFrame();
@@ -124,19 +100,19 @@ public class JAL1353bugdemo
     });
     cont.setVisible(true);
 
-    jmi.addActionListener(new ActionListener()
-    {
-
-      @Override
-      public void actionPerformed(ActionEvent arg0)
-      {
-        EditNameDialog end = new EditNameDialog("Sequence Name",
-                "Sequence Description", "label 1", "Label 2",
-                "Try and drag between the two text fields", cont);
-        assert (end != null);
-        finish = true;
-      }
-    });
+    // jmi.addActionListener(new ActionListener()
+    // {
+    //
+    // @Override
+    // public void actionPerformed(ActionEvent arg0)
+    // {
+    // EditNameDialog end = new EditNameDialog("Sequence Name",
+    // "Sequence Description", "label 1", "Label 2",
+    // "Try and drag between the two text fields", cont);
+    // assert (end != null);
+    // finish = true;
+    // }
+    // });
     foo.setVisible(true);
     cfoo.setVisible(true);
     while (!finish)
index b034fb0..0e2b630 100644 (file)
@@ -228,7 +228,7 @@ public class StockholmFileTest
     }
     assertEquals(
             "Generated and imported alignment have different annotation sets",
-            aa_new_size, aa_original_size);
+            aa_original_size, aa_new_size);
 
     // check sequences, annotation and features
     SequenceI[] seq_original = new SequenceI[al.getSequencesArray().length];
index ff2f2aa..45b56c2 100644 (file)
@@ -55,43 +55,4 @@ public class DnaCodonTests
               + codon.getKey() + "\", \"" + codon.getValue() + "\");");
     }
   }
-
-  @Test(groups = { "Functional" })
-  public void checkOldCodonagainstNewCodonTable()
-  {
-    // note - this test will be removed once the old codon table (including
-    // Vectors) is removed
-    String additional = "", failtrans = "", differentTr = "";
-    for (String amacid : ResidueProperties.codonHash.keySet())
-    {
-      for (String codon : ResidueProperties.codonHash.get(amacid))
-      {
-        String trans = ResidueProperties.codonTranslate(codon);
-        String oldtrans = ResidueProperties._codonTranslate(codon);
-        if (trans == null)
-        {
-          additional += "\nOld translation table includes additional codons for "
-                  + amacid + " : " + codon;
-        }
-        if (oldtrans == null)
-        {
-          failtrans += ("\nold translation routine failed for old translation entry (aa was "
-                  + amacid + " codon was " + codon + ")");
-        }
-        if (!oldtrans.equals(trans))
-        {
-          differentTr += ("\nDifferent translation for old and new routines: "
-                  + amacid
-                  + " "
-                  + codon
-                  + " => expected "
-                  + oldtrans
-                  + " and got " + trans);
-        }
-      }
-    }
-    assertTrue("" + additional + "\n" + failtrans + "\n" + differentTr,
-            additional.length() == 0 && failtrans.length() == 0
-                    && differentTr.length() == 0);
-  }
 }
index c1d1144..1401f6a 100644 (file)
@@ -42,6 +42,7 @@ public class PDBSequenceFetcherTest
   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
+    Cache.loadProperties("test/jalview/io/testProps.jvprops");
     // ensure 'add annotation from structure' is selected
     Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
             Boolean.TRUE.toString());
@@ -62,8 +63,6 @@ public class PDBSequenceFetcherTest
   @Test(groups = { "Network" }, enabled = true)
   public void testRnaSeqRetrieve() throws Exception
   {
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
-            Boolean.TRUE.toString());
     Cache.applicationProperties.setProperty("PDB_DOWNLOAD_FORMAT",
             "PDB");
     List<DbSourceProxy> sps = sf.getSourceProxy("PDB");
@@ -85,8 +84,6 @@ public class PDBSequenceFetcherTest
   @Test(groups = { "Network" }, enabled = true)
   public void testPdbSeqRetrieve() throws Exception
   {
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
-            Boolean.TRUE.toString());
     StructureImportSettings.setDefaultStructureFileFormat("PDB");
     StructureImportSettings
             .setDefaultPDBFileParser(StructureParser.JALVIEW_PARSER);
@@ -97,8 +94,6 @@ public class PDBSequenceFetcherTest
   @Test(groups = { "Network" }, enabled = true)
   public void testmmCifSeqRetrieve() throws Exception
   {
-    Cache.applicationProperties.setProperty("STRUCT_FROM_PDB",
-            Boolean.TRUE.toString());
     StructureImportSettings.setDefaultStructureFileFormat("mmCIF");
     testRetrieveProteinSeqFromPDB();
   }