From: TZVanaalten Date: Tue, 15 Aug 2017 09:45:55 +0000 (+0100) Subject: JAL-2599 fix HMMER scheme not colouring inserts and made red darker X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3a7e301b545949dc3e5906c0e4343b4f6db56b0c;p=jalview.git JAL-2599 fix HMMER scheme not colouring inserts and made red darker --- diff --git a/src/jalview/schemes/HMMERColourScheme.java b/src/jalview/schemes/HMMERColourScheme.java index 3c25ec2..113afd1 100644 --- a/src/jalview/schemes/HMMERColourScheme.java +++ b/src/jalview/schemes/HMMERColourScheme.java @@ -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 hiddenReps) { - List seqs = collection.getSequences(); - for (SequenceI seq : seqs) - { - if (seq.getHMM() != null) - { - hmm = seq.getHMM(); - break; - } - } + List 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 hiddenRepSequences) { - HiddenMarkovModel markov = null; - List 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 seqs = sg.getSequences(); + for (SequenceI seq : seqs) + { + if (seq.getHMM() != null) + { + markov = seq.getHMM(); + break; + } + } + HMMERColourScheme colour = new HMMERColourScheme(markov); + return colour; }