JAL-2416 order score models by order of addition rather than name
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 17 Feb 2017 13:27:33 +0000 (13:27 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 17 Feb 2017 13:27:33 +0000 (13:27 +0000)
src/jalview/analysis/scoremodels/ScoreModels.java

index 9af68d0..377fdef 100644 (file)
@@ -6,8 +6,8 @@ import jalview.io.FileParse;
 import jalview.io.ScoreMatrixFile;
 
 import java.io.IOException;
+import java.util.LinkedHashMap;
 import java.util.Map;
-import java.util.TreeMap;
 
 /**
  * A class that can register and serve instances of ScoreModelI
@@ -29,6 +29,7 @@ public class ScoreModels
    * <ul>
    * <li>BLOSUM62</li>
    * <li>PAM250</li>
+   * <li>SeqSpace (identity matrix)</li>
    * <li>DNA</li>
    * <li>Sequence Feature Similarity</li>
    * <li>Percentage Identity</li>
@@ -37,11 +38,12 @@ public class ScoreModels
   private ScoreModels()
   {
     /*
-     * using TreeMap keeps models ordered alphabetically by name
+     * using LinkedHashMap keeps models ordered as added
      */
-    models = new TreeMap<String, ScoreModelI>(String.CASE_INSENSITIVE_ORDER);
+    models = new LinkedHashMap<String, ScoreModelI>();
     loadScoreMatrix("scoreModel/blosum62.scm");
     loadScoreMatrix("scoreModel/pam250.scm");
+    loadScoreMatrix("scoreModel/seqspace.scm");
     loadScoreMatrix("scoreModel/dna.scm");
     registerScoreModel(new FeatureScoreModel());
     registerScoreModel(new PIDScoreModel());
@@ -74,7 +76,7 @@ public class ScoreModels
 
   /**
    * Answers an iterable set of the registered score models. Currently these are
-   * ordered by name (not case sensitive).
+   * returned in the order in which they were registered.
    * 
    * @return
    */