+ if (getColourAppliesToAllGroups())
+ {
+ for (SequenceGroup sg : getAlignment().getGroups())
+ {
+ if (cs == null)
+ {
+ sg.cs = null;
+ continue;
+ }
+ if (cs instanceof ClustalxColourScheme)
+ {
+ sg.cs = new ClustalxColourScheme(sg, getHiddenRepSequences());
+ }
+ else
+ {
+ try
+ {
+ sg.cs = cs.getClass().newInstance();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ sg.cs = cs;
+ }
+ }
+
+ if (getAbovePIDThreshold() || cs instanceof PIDColourScheme
+ || cs instanceof Blosum62ColourScheme)
+ {
+ sg.cs.setThreshold(threshold, getIgnoreGapsConsensus());
+ sg.cs.setConsensus(AAFrequency.calculate(
+ sg.getSequences(getHiddenRepSequences()), 0,
+ sg.getWidth()));
+ }
+ else
+ {
+ sg.cs.setThreshold(0, getIgnoreGapsConsensus());
+ }
+
+ if (getConservationSelected())
+ {
+ Conservation c = new Conservation("Group",
+ ResidueProperties.propHash, 3,
+ sg.getSequences(getHiddenRepSequences()), 0,
+ getAlignment().getWidth() - 1);
+ c.calculate();
+ c.verdict(false, getConsPercGaps());
+ sg.cs.setConservation(c);
+ }
+ else
+ {
+ sg.cs.setConservation(null);
+ sg.cs.setThreshold(0, getIgnoreGapsConsensus());
+ }
+
+ }
+ }
+