JAL-2599 fix HMMER scheme not colouring inserts and made red darker
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Tue, 15 Aug 2017 09:45:55 +0000 (10:45 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Tue, 15 Aug 2017 09:45:55 +0000 (10:45 +0100)
src/jalview/schemes/HMMERColourScheme.java

index 3c25ec2..113afd1 100644 (file)
@@ -49,6 +49,10 @@ public class HMMERColourScheme extends ResidueColourScheme
     {
       return Color.white;
     }
+    if (Character.isLowerCase(symbol))
+    {
+      return new Color(230, 0, 0);
+    }
     Double prob;
     prob = hmm.getMatchEmissionProbability(position, symbol);
     double freq = 0;
@@ -78,7 +82,7 @@ public class HMMERColourScheme extends ResidueColourScheme
     }
     if (prob == 0)
     {
-      return Color.red;
+      return new Color(230, 0, 0);
     }
     Double value = Math.log(prob / freq);
     Color colour = null;
@@ -106,15 +110,15 @@ public class HMMERColourScheme extends ResidueColourScheme
   public void alignmentChanged(AnnotatedCollectionI collection,
           Map<SequenceI, SequenceCollectionI> hiddenReps)
   {
-    List<SequenceI> seqs = collection.getSequences();
-    for (SequenceI seq : seqs)
-    {
-      if (seq.getHMM() != null)
-      {
-        hmm = seq.getHMM();
-        break;
-      }
-    }
+         List<SequenceI> seqs = collection.getSequences();
+           for (SequenceI seq : seqs)
+           {
+             if (seq.getHMM() != null)
+             {
+               hmm = seq.getHMM();
+               break;
+             }
+           }
 
   }
 
@@ -124,18 +128,18 @@ public class HMMERColourScheme extends ResidueColourScheme
   public ColourSchemeI getInstance(AnnotatedCollectionI sg,
           Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
   {
-    HiddenMarkovModel markov = null;
-    List<SequenceI> seqs = sg.getSequences();
-    for (SequenceI seq : seqs)
-    {
-      if (seq.getHMM() != null)
-      {
-        markov = seq.getHMM();
-        break;
-      }
-    }
-    HMMERColourScheme colour = new HMMERColourScheme(markov);
-    return colour;
+         HiddenMarkovModel markov = null;
+           List<SequenceI> seqs = sg.getSequences();
+           for (SequenceI seq : seqs)
+           {
+             if (seq.getHMM() != null)
+             {
+               markov = seq.getHMM();
+               break;
+             }
+           }
+           HMMERColourScheme colour = new HMMERColourScheme(markov);
+           return colour;
 
   }