From 3a7e301b545949dc3e5906c0e4343b4f6db56b0c Mon Sep 17 00:00:00 2001 From: TZVanaalten Date: Tue, 15 Aug 2017 10:45:55 +0100 Subject: [PATCH] JAL-2599 fix HMMER scheme not colouring inserts and made red darker --- src/jalview/schemes/HMMERColourScheme.java | 48 +++++++++++++++------------- 1 file changed, 26 insertions(+), 22 deletions(-) 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; } -- 1.7.10.2