JAL-2668 fix broken factory method for colour scheme
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 27 Feb 2018 15:56:53 +0000 (15:56 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 27 Feb 2018 15:56:53 +0000 (15:56 +0000)
src/jalview/schemes/HMMERAlignmentColourScheme.java

index 8e7aef7..52ee6e5 100644 (file)
@@ -10,6 +10,7 @@ import jalview.util.Comparison;
 
 import java.awt.Color;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -131,7 +132,9 @@ public class HMMERAlignmentColourScheme extends ResidueColourScheme
   public ColourSchemeI getInstance(AnnotatedCollectionI sg,
           Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
   {
-    return new HMMERAlignmentColourScheme(sg, hmm);
+    List<SequenceI> hmms = sg.getHMMConsensusSequences();
+    HiddenMarkovModel model = hmms.isEmpty() ? null : hmms.get(0).getHMM();
+    return new HMMERAlignmentColourScheme(sg, model);
   }
 
   @Override