Merge branch 'develop' into Release_2_9_0b1_Branch
authorJim Procter <jprocter@issues.jalview.org>
Thu, 8 Oct 2015 11:09:47 +0000 (12:09 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 8 Oct 2015 11:09:47 +0000 (12:09 +0100)
23 files changed:
1  2 
help/html/features/groovy.html
help/html/releases.html
help/html/whatsNew.html
src/jalview/analysis/AlignmentUtils.java
src/jalview/appletgui/AlignFrame.java
src/jalview/bin/Jalview.java
src/jalview/bin/JalviewLite.java
src/jalview/datamodel/AlignmentAnnotation.java
src/jalview/datamodel/Mapping.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/Desktop.java
src/jalview/io/BioJsHTMLOutput.java
src/jalview/io/FeaturesFile.java
src/jalview/io/JSONFile.java
src/jalview/javascript/MouseOverStructureListener.java
src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java
src/jalview/json/binding/biojson/v1/AnnotationPojo.java
src/jalview/schemes/UserColourScheme.java
src/jalview/ws/DBRefFetcher.java
src/jalview/ws/uimodel/AlignAnalysisUIText.java
test/jalview/analysis/ParsePropertiesTest.java
test/jalview/io/JSONFileTest.java
test/jalview/util/MappingUtilsTest.java

@@@ -1,7 -1,7 +1,7 @@@
  <html>
  <!--
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -73,7 -73,7 +73,7 @@@
      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 environent which corresponds to the
+     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:
diff --combined help/html/releases.html
@@@ -1,7 -1,7 +1,7 @@@
  <html>
  <!--
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -48,7 -48,7 +48,7 @@@
        <td width="60" nowrap>
          <div align="center">
            <strong><a name="Jalview.2.9.0b1">2.9.0b1</a><br />
-             <em>6/10/2015</em></strong>
+             <em>8/10/2015</em></strong>
          </div>
        </td>
        <td>
@@@ -58,7 -58,8 +58,8 @@@
        </ul>
        <em>Application</em><ul>
        <!-- <li>cDNA/Protein splitframe window geometry preserved in Jalview projects</li>-->
-       <li>Signed OSX InstallAnywhere installer</li></ul>
+       <li>Signed OSX InstallAnywhere installer<br></li>
+       <li>Support for per-sequence based annotations in BioJSON</li></ul>
          <em>Applet</em>
          <ul><li>Split frame example added to applet examples page</li>
              </ul>
@@@ -83,6 -84,7 +84,7 @@@
              <li>Disabled 'minimise' button on Jalview windows running on OSX to workaround redraw hang bug</li>
              <li>Split cDNA/Protein view position and geometry not recovered from jalview project</li>
              <li>Initial enabled/disabled state of annotation menu sorter 'show autocalculated first/last' corresponds to alignment view</li>
+             <li>Restoring of Clustal, RNA helix and TCoffee colour shcemes from BioJSON</li>
              </ul>
        <em>Applet</em><ul>
              <li>Reorder sequences mirrored in cDNA/Protein split frame</li>
diff --combined help/html/whatsNew.html
@@@ -1,7 -1,7 +1,7 @@@
  <html>
  <!--
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
      <strong>What's new ?</strong>
    </p>
    <p>
-     Jalview 2.9 has been in development since December 2014. In addition
+     Jalview 2.9.0b1 is a bug fix release for Jalview 2.9, which has been in development since December 2014. In addition
      to a multitude of bug fixes and minor improvements (both small, and
      rather big!), it also brings major new capabilities for codon-level
      analysis of protein alignments and the retrieval and manipulation of
-     structural data.</p><p>For the full list of changes, see the
-     <a href="releases.html#Jalview.2.9">Jalview 2.9 Release Notes</a>.
+     structural data.</p><p>For the patches since version 2.9 was release, see the
+     <a href="releases.html#Jalview.2.9.0b1">Jalview 2.9.0b1 Release Notes</a>.
    </p>
    <p>
      <strong>Highlights in Jalview 2.9</strong>
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -228,8 -228,8 +228,8 @@@ public class AlignmentUtil
     * @param cdnaAlignment
     * @return
     */
-   public static boolean mapProteinAlignmentToCdna(final AlignmentI proteinAlignment,
-           final AlignmentI cdnaAlignment)
+   public static boolean mapProteinAlignmentToCdna(
+           final AlignmentI proteinAlignment, final AlignmentI cdnaAlignment)
    {
      if (proteinAlignment == null || cdnaAlignment == null)
      {
      {
        return null;
      }
-     if (!translatesAs(cdnaSeqChars, startOffset,
-             aaSeqChars))
+     if (!translatesAs(cdnaSeqChars, startOffset, aaSeqChars))
      {
        return null;
      }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -2081,8 -2081,7 +2081,7 @@@ public class AlignFrame extends Embmenu
          infoPanel
                  .add(new Label(MessageManager.getString("warn.delete_all")));
  
-         final JVDialog dialog = new JVDialog(this, title, true, 400,
-                 200);
+         final JVDialog dialog = new JVDialog(this, title, true, 400, 200);
          dialog.setMainPanel(infoPanel);
          dialog.ok.setLabel(MessageManager.getString("action.ok"));
          dialog.cancel.setLabel(MessageManager.getString("action.cancel"));
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -387,7 -387,7 +387,7 @@@ public class Jalvie
        }
        else
        {
+         Desktop.setCurrentAlignFrame(af);
          data = aparser.getValue("colour", true);
          if (data != null)
          {
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -2404,8 -2404,7 +2404,7 @@@ public class JalviewLite extends Apple
          return rtn;
        } catch (Exception ex)
        {
-         System.out.println("Exception checking resources: " + f + " "
-                 + ex);
+         System.out.println("Exception checking resources: " + f + " " + ex);
          return false;
        }
      }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -957,6 -957,12 +957,12 @@@ public class AlignmentAnnotatio
  
    }
  
+   /**
+    * When positional annotation and a sequence reference is present, clears and
+    * resizes the annotations array to the current alignment width, and adds
+    * annotation according to aligned positions of the sequenceRef given by
+    * sequenceMapping.
+    */
    public void adjustForAlignment()
    {
      if (sequenceRef == null)
      int position;
      Annotation[] temp = new Annotation[aSize];
      Integer index;
-     for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++)
+     if (sequenceMapping != null)
      {
-       index = new Integer(a);
-       if (sequenceMapping.containsKey(index))
+       for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++)
        {
-         position = sequenceRef.findIndex(a) - 1;
+         index = new Integer(a);
+         Annotation annot = sequenceMapping.get(index);
+         if (annot != null)
+         {
+           position = sequenceRef.findIndex(a) - 1;
  
-         temp[position] = sequenceMapping.get(index);
+           temp[position] = annot;
+         }
        }
      }
      annotations = temp;
    }
  
    }
  
    /**
-    * Associate this annotion with the aligned residues of a particular sequence.
-    * sequenceMapping will be updated in the following way: null sequenceI -
-    * existing mapping will be discarded but annotations left in mapped
-    * positions. valid sequenceI not equal to current sequenceRef: mapping is
-    * discarded and rebuilt assuming 1:1 correspondence TODO: overload with
+    * Associate this annotation with the aligned residues of a particular
+    * sequence. sequenceMapping will be updated in the following way: null
+    * sequenceI - existing mapping will be discarded but annotations left in
+    * mapped positions. valid sequenceI not equal to current sequenceRef: mapping
+    * is discarded and rebuilt assuming 1:1 correspondence TODO: overload with
     * parameter to specify correspondence between current and new sequenceRef
     * 
     * @param sequenceI
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -253,8 -253,7 +253,7 @@@ public class Mappin
         * allow for offset e.g. treat pos 8 as 2 if sequence starts at 7
         */
        int truePos = sequencePos - (start - 1);
-       while (alignedBases < truePos
-               && alignedColumn < alignedSeq.length)
+       while (alignedBases < truePos && alignedColumn < alignedSeq.length)
        {
          if (alignedSeq[alignedColumn++] != gap)
          {
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -2415,7 -2415,6 +2415,6 @@@ public class AlignFrame extends GAlignF
      }
    }
  
    /**
     * DOCUMENT ME!
     * 
          cs.setConservationInc(SliderPanel.setConservationSlider(alignPanel,
                  cs, "Background"));
        }
+       if (cs instanceof TCoffeeColourScheme)
+       {
+         tcoffeeColour.setEnabled(true);
+         tcoffeeColour.setSelected(true);
+       }
      }
  
      viewport.setGlobalColourScheme(cs);
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -23,6 -23,7 +23,7 @@@ package jalview.gui
  import jalview.api.AlignViewportI;
  import jalview.api.AlignmentViewPanel;
  import jalview.bin.Cache;
+ import jalview.bin.Jalview;
  import jalview.io.FileLoader;
  import jalview.io.FormatAdapter;
  import jalview.io.IdentifyFile;
@@@ -2381,6 -2382,12 +2382,12 @@@ public class Desktop extends jalview.jb
     */
    public static AlignFrame[] getAlignFrames()
    {
+     if (Jalview.isHeadlessMode())
+     {
+       // Desktop.desktop is null in headless mode
+       return new AlignFrame[] { currentAlignFrame };
+     }
      JInternalFrame[] frames = Desktop.desktop.getAllFrames();
  
      if (frames == null)
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -115,16 -115,15 +115,15 @@@ public class BioJsHTMLOutpu
        AlignmentExportData exportData = jalview.gui.AlignFrame
                .getAlignmentForExport(JSONFile.FILE_DESC,
                        ap.getAlignViewport(), exportSettings);
-       String bioJSON = new FormatAdapter(ap,
-               exportData.getSettings()).formatSequences(JSONFile.FILE_DESC,
-               exportData.getAlignment(), exportData.getOmitHidden(),
-               exportData.getStartEndPostions(), ap.getAlignViewport()
-                       .getColumnSelection());
+       String bioJSON = new FormatAdapter(ap, exportData.getSettings())
+               .formatSequences(JSONFile.FILE_DESC, exportData
+                       .getAlignment(), exportData.getOmitHidden(),
+                       exportData.getStartEndPostions(), ap
+                               .getAlignViewport().getColumnSelection());
  
        String bioJSTemplateString = getBioJsTemplateAsString();
        String generatedBioJsWithJalviewAlignmentAsJson = bioJSTemplateString
-               .replaceAll("#sequenceData#", bioJSON)
-               .toString();
+               .replaceAll("#sequenceData#", bioJSON).toString();
  
        PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(
                outputFile));
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -123,8 -123,7 +123,7 @@@ public class FeaturesFile extends Align
     *          - process html strings into plain text
     * @return true if features were added
     */
-   public boolean parse(AlignmentI align, Map colours,
-           boolean removeHTML)
+   public boolean parse(AlignmentI align, Map colours, boolean removeHTML)
    {
      return parse(align, colours, null, removeHTML, false);
    }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -39,12 -39,14 +39,14 @@@ import jalview.datamodel.SequenceGroup
  import jalview.datamodel.SequenceI;
  import jalview.json.binding.biojson.v1.AlignmentAnnotationPojo;
  import jalview.json.binding.biojson.v1.AlignmentPojo;
+ import jalview.json.binding.biojson.v1.AnnotationDisplaySettingPojo;
  import jalview.json.binding.biojson.v1.AnnotationPojo;
  import jalview.json.binding.biojson.v1.ColourSchemeMapper;
  import jalview.json.binding.biojson.v1.SequenceFeaturesPojo;
  import jalview.json.binding.biojson.v1.SequenceGrpPojo;
  import jalview.json.binding.biojson.v1.SequencePojo;
  import jalview.schemes.ColourSchemeProperty;
+ import jalview.schemes.UserColourScheme;
  import jalview.viewmodel.seqfeatures.FeaturesDisplayed;
  
  import java.awt.Color;
@@@ -90,6 -92,8 +92,8 @@@ public class JSONFile extends AlignFil
  
    private ArrayList<SequenceI> hiddenSequences;
  
+   private final static String TCOFFEE_SCORE = "TCoffeeScore";
    public JSONFile()
    {
      super();
        }
        else
        {
-         if (globalColourScheme.equalsIgnoreCase("RNA Helices"))
+         // These color schemes require annotation, disable them if annotations
+         // are not exported
+         if (globalColourScheme.equalsIgnoreCase("RNA Helices")
+                 || globalColourScheme.equalsIgnoreCase("T-COFFEE SCORES"))
          {
            jsonAlignmentPojo.setGlobalColorScheme("None");
          }
        AlignmentAnnotationPojo alignAnnotPojo = new AlignmentAnnotationPojo();
        alignAnnotPojo.setDescription(annot.description);
        alignAnnotPojo.setLabel(annot.label);
+       if (!Double.isNaN(annot.score))
+       {
+         alignAnnotPojo.setScore(annot.score);
+       }
+       alignAnnotPojo.setCalcId(annot.getCalcId());
+       alignAnnotPojo.setGraphType(annot.graph);
+       AnnotationDisplaySettingPojo annotSetting = new AnnotationDisplaySettingPojo();
+       annotSetting.setBelowAlignment(annot.belowAlignment);
+       annotSetting.setCentreColLabels(annot.centreColLabels);
+       annotSetting.setScaleColLabel(annot.scaleColLabel);
+       annotSetting.setShowAllColLabels(annot.showAllColLabels);
+       annotSetting.setVisible(annot.visible);
+       annotSetting.setHasIcon(annot.hasIcons);
+       alignAnnotPojo.setAnnotationSettings(annotSetting);
+       SequenceI refSeq = annot.sequenceRef;
+       if (refSeq != null)
+       {
+         alignAnnotPojo.setSequenceRef(String.valueOf(refSeq.hashCode()));
+       }
        for (Annotation annotation : annot.annotations)
        {
          AnnotationPojo annotationPojo = new AnnotationPojo();
            annotationPojo.setValue(annotation.value);
            annotationPojo
                    .setSecondaryStructure(annotation.secondaryStructure);
-           annotationPojo.setDisplayCharacter(annotation.displayCharacter);
+           String displayChar = annotation.displayCharacter == null ? null
+                   : annotation.displayCharacter;
+           // System.out.println("--------------------->[" + displayChar + "]");
+           annotationPojo.setDisplayCharacter(displayChar);
+           if (annotation.colour != null)
+           {
+             annotationPojo.setColour(jalview.util.Format
+                     .getHexString(annotation.colour));
+           }
            alignAnnotPojo.getAnnotations().add(annotationPojo);
          }
          else
          {
-           alignAnnotPojo.getAnnotations().add(annotationPojo);
+           if (annot.getCalcId() != null
+                   && annot.getCalcId().equalsIgnoreCase(TCOFFEE_SCORE))
+           {
+             // do nothing
+           }
+           else
+           {
+             alignAnnotPojo.getAnnotations().add(annotationPojo);
+           }
          }
        }
        jsonAnnotations.add(alignAnnotPojo);
          seqMap.put(seqUniqueId, seq);
        }
  
        parseFeatures(jsonSeqArray);
  
        for (Iterator<JSONObject> seqGrpIter = seqGrpJsonArray.iterator(); seqGrpIter
            }
          }
          SequenceGroup seqGrp = new SequenceGroup(grpSeqs, grpName, null,
-                 displayBoxes, displayText, colourText,
-                 startRes, endRes);
+                 displayBoxes, displayText, colourText, startRes, endRes);
          seqGrp.cs = ColourSchemeMapper.getJalviewColourScheme(colourScheme,
                  seqGrp);
          seqGrp.setShowNonconserved(showNonconserved);
                      : annot.get("displayCharacter").toString();
  
              annotations[count] = new Annotation(displayChar, desc, ss, val);
+             if (annot.get("colour") != null)
+             {
+               Color color = UserColourScheme.getColourFromString(annot.get(
+                       "colour").toString());
+               annotations[count].colour = color;
+             }
            }
            ++count;
          }
          AlignmentAnnotation alignAnnot = new AlignmentAnnotation(alAnnot
                  .get("label").toString(), alAnnot.get("description")
                  .toString(), annotations);
+         alignAnnot.graph = (alAnnot.get("graphType") == null) ? 0 : Integer
+                 .valueOf(alAnnot.get("graphType").toString());
+         JSONObject diplaySettings = (JSONObject) alAnnot
+                 .get("annotationSettings");
+         if (diplaySettings != null)
+         {
+           alignAnnot.scaleColLabel = (diplaySettings.get("scaleColLabel") == null) ? false
+                   : Boolean.valueOf(diplaySettings.get("scaleColLabel")
+                           .toString());
+           alignAnnot.showAllColLabels = (diplaySettings
+                   .get("showAllColLabels") == null) ? true : Boolean
+                   .valueOf(diplaySettings.get("showAllColLabels")
+                           .toString());
+           alignAnnot.centreColLabels = (diplaySettings
+                   .get("centreColLabels") == null) ? true
+                   : Boolean.valueOf(diplaySettings.get("centreColLabels")
+                           .toString());
+           alignAnnot.belowAlignment = (diplaySettings.get("belowAlignment") == null) ? false
+                   : Boolean.valueOf(diplaySettings.get("belowAlignment")
+                           .toString());
+           alignAnnot.visible = (diplaySettings.get("visible") == null) ? true
+                   : Boolean.valueOf(diplaySettings.get("visible")
+                           .toString());
+           alignAnnot.hasIcons = (diplaySettings.get("hasIcon") == null) ? true
+                   : Boolean.valueOf(diplaySettings.get("hasIcon")
+                           .toString());
+         }
+         if (alAnnot.get("score") != null)
+         {
+           alignAnnot.score = Double
+                   .valueOf(alAnnot.get("score").toString());
+         }
+         String calcId = (alAnnot.get("calcId") == null) ? "" : alAnnot.get(
+                 "calcId").toString();
+         alignAnnot.setCalcId(calcId);
+         String seqHash = (alAnnot.get("sequenceRef") != null) ? alAnnot
+                 .get("sequenceRef").toString() : null;
+         Sequence sequence = (seqHash != null) ? seqMap.get(seqHash) : null;
+         if (sequence != null)
+         {
+           alignAnnot.sequenceRef = sequence;
+           sequence.addAlignmentAnnotation(alignAnnot);
+           if (alignAnnot.label.equalsIgnoreCase("T-COFFEE"))
+           {
+             alignAnnot.createSequenceMapping(sequence, sequence.getStart(),
+                     false);
+             sequence.addAlignmentAnnotation(alignAnnot);
+             alignAnnot.adjustForAlignment();
+           }
+         }
+         alignAnnot.validateRangeAndDisplay();
          this.annotations.add(alignAnnot);
        }
      } catch (Exception e)
      {
      {
        if (annot != null && !annot.autoCalculated)
        {
-         if (!annot.visible)
-         {
-           continue;
-         }
          annotations.add(annot);
        }
      }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -34,9 -34,6 +34,6 @@@ import jalview.structure.StructureMappi
  import jalview.structure.StructureSelectionManager;
  import jalview.util.HttpUtils;
  
- import java.io.IOException;
- import java.io.InputStream;
- import java.net.URL;
  import java.util.ArrayList;
  import java.util.List;
  
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -30,17 -30,41 +30,41 @@@ public class AlignmentAnnotationPoj
  
    @Attributes(
      required = false,
-     description = "Label for the Alignment Annotation")
+     description = "Label for the alignment annotation")
    private String label;
  
    @Attributes(
      required = false,
-     description = "Description for the Alignment Annotation")
+     description = "Description for the alignment annotation")
    private String description;
  
    @Attributes(required = false)
    private List<AnnotationPojo> annotations = new ArrayList<AnnotationPojo>();
  
+   @Attributes(
+     required = false,
+     enums = { "0", "1", "2" },
+     description = "Determines the rendering for the annotation<br><ul><li>0 - No graph</li><li>1 - Bar Graph</li><li>2 - Line graph</li></ul>")
+   private int graphType;
+   @Attributes(
+     required = false,
+     description = "Reference to the sequence in the alignment<br> if per-sequence annotation")
+   private String sequenceRef;
+   @Attributes(
+     required = false,
+     description = "Stores display settings for an annotation")
+   private AnnotationDisplaySettingPojo annotationSettings;
+   @Attributes(required = false, description = "Score of the annotation")
+   private double score;
+   @Attributes(
+     required = false,
+     description = "The annotation generation source")
+   private String calcId;
    public String getLabel()
    {
      return label;
      this.annotations = annotations;
    }
  
+   public String getSequenceRef()
+   {
+     return sequenceRef;
+   }
+   public void setSequenceRef(String sequenceRef)
+   {
+     this.sequenceRef = sequenceRef;
+   }
+   public int getGraphType()
+   {
+     return graphType;
+   }
+   public void setGraphType(int graphType)
+   {
+     this.graphType = graphType;
+   }
+   public AnnotationDisplaySettingPojo getAnnotationSettings()
+   {
+     return annotationSettings;
+   }
+   public void setAnnotationSettings(
+           AnnotationDisplaySettingPojo annotationSettings)
+   {
+     this.annotationSettings = annotationSettings;
+   }
+   public double getScore()
+   {
+     return score;
+   }
+   public void setScore(double score)
+   {
+     this.score = score;
+   }
+   public String getCalcId()
+   {
+     return calcId;
+   }
+   public void setCalcId(String calcId)
+   {
+     this.calcId = calcId;
+   }
  }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -43,6 -43,11 +43,11 @@@ public class AnnotationPoj
    @Attributes(required = false, description = "Value of the annotation")
    private float value;
  
+   @Attributes(
+     required = false,
+     description = "Colour of the annotation position in hex string.")
+   private String colour;
    public String getDisplayCharacter()
    {
      return displayCharacter;
      this.value = value;
    }
  
+   public String getColour()
+   {
+     return colour;
+   }
+   public void setColour(String colour)
+   {
+     this.colour = colour;
+   }
  }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -99,7 -99,7 +99,7 @@@ public class UserColourScheme extends R
      return schemeName;
    }
  
-   public Color getColourFromString(String colour)
+   public static Color getColourFromString(String colour)
    {
      colour = colour.trim();
  
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -622,11 -622,10 +622,10 @@@ public class DBRefFetcher implements Ru
            // absStart = 0;
            // create valid mapping between matching region of local sequence and
            // the mapped sequence
-           mp = new Mapping(null, new int[] {
-               sequenceStart + absStart,
-               sequenceStart + absStart + entrySeq.length() - 1 },
-                   new int[] { entry.getStart(),
-                       entry.getStart() + entrySeq.length() - 1 }, 1, 1);
+           mp = new Mapping(null, new int[] { sequenceStart + absStart,
+               sequenceStart + absStart + entrySeq.length() - 1 }, new int[]
+           { entry.getStart(), entry.getStart() + entrySeq.length() - 1 },
+                   1, 1);
            updateRefFrame = false; // mapping is based on current start/end so
            // don't modify start and end
          }
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -20,7 -20,6 +20,6 @@@
   */
  package jalview.ws.uimodel;
  
  public class AlignAnalysisUIText
  {
  
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -27,6 -27,7 +27,7 @@@ import jalview.datamodel.Alignment
  import jalview.datamodel.AlignmentAnnotation;
  import jalview.datamodel.Sequence;
  import jalview.datamodel.SequenceI;
+ import jalview.gui.AlignFrame;
  
  import java.util.List;
  
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -324,9 -324,6 +324,6 @@@ public class JSONFileTes
              "Colourscheme is null, parsing failed!");
      Assert.assertEquals(testJsonFile.getGlobalColourScheme(), "Zappo",
              "Zappo colour scheme expected!");
-     // Assert.assertTrue(
-     // testJsonFile.getGlobalColourScheme() instanceof ZappoColourScheme,
-     // "Zappo colour scheme expected!");
    }
  
    @Test(groups = { "Functional" })
@@@ -1,6 -1,6 +1,6 @@@
  /*
 - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
 - * Copyright (C) $$Year-Rel$$ The Jalview Authors
 + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9)
 + * Copyright (C) 2015 The Jalview Authors
   * 
   * This file is part of Jalview.
   * 
@@@ -364,8 -364,7 +364,7 @@@ public class MappingUtilsTes
  
      // map second dna to second protein seq
      map = new MapList(new int[] { 20, 20, 22, 23, 24, 26 }, new int[] { 50,
-         51 },
-             3, 1);
+         51 }, 3, 1);
      acf.addMap(cdna.getSequenceAt(1).getDatasetSequence(), protein
              .getSequenceAt(1).getDatasetSequence(), map);