+ this.startRes = 0;\r
+ this.endRes = al.getWidth()-1;\r
+ this.startSeq = 0;\r
+ this.endSeq = al.getHeight()-1;\r
+ this.showText = showText;\r
+ this.showBoxes = showBoxes;\r
+ this.wrapAlignment = wrapAlignment;\r
+\r
+ setAlignment(al);\r
+ setFont( font );\r
+ }\r
+\r
+ public void showSequenceFeatures(boolean b)\r
+ {\r
+ showSequenceFeatures = b;\r
+ }\r
+\r
+ AlignmentAnnotation consensus;\r
+ AlignmentAnnotation conservation;\r
+ public void updateConservation()\r
+ {\r
+ Annotation [] annotations = new Annotation[alignment.getWidth()];\r
+\r
+ Conservation cons = new jalview.analysis.Conservation("All",\r
+ jalview.schemes.ResidueProperties.propHash, 3,\r
+ alignment.getSequences(), 0,\r
+ alignment.getWidth());\r
+ cons.calculate();\r
+ cons.verdict(false, 100);\r
+ cons.findQuality();\r
+ String sequence = cons.getConsSequence().getSequence();\r
+ float minR,minG,minB, maxR,maxG,maxB;\r
+ minR = 0.3f;\r
+ minG = 0f;\r
+ minB = 0f;\r
+ maxR = 1.0f-minR; maxG=0.9f-minG; maxB=0f-minB; // scalable range for colouring\r
+ float min = cons.qualityRange[0].floatValue();\r
+ float max = cons.qualityRange[1].floatValue();\r
+\r
+ for (int i = 0; i < alignment.getWidth(); i++)\r
+ {\r
+ float value = 0;\r
+ try\r
+ {\r
+ //value = Integer.parseInt(sequence.charAt(i) + "");\r
+ value = ((Double) cons.quality.get(i)).floatValue();\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ if (sequence.charAt(i) == '*') value = 10;\r
+ }\r
+ float vprop = value-min;\r
+ vprop/=max;\r
+ annotations[i] = new Annotation(sequence.charAt(i) + "",\r
+ "Conservation graph", ' ', value, new Color(minR+maxR*vprop, minB+maxB*vprop, minB+maxB*vprop));\r
+ }\r
+\r
+ if(conservation==null)\r
+ {\r
+ conservation = new AlignmentAnnotation("Conservation",\r
+ "Conservation of total alignment",\r
+ annotations,\r
+ cons.qualityRange[0].floatValue(),\r
+ cons.qualityRange[1].floatValue(), 1);\r
+ alignment.addAnnotation(conservation);\r
+ }\r
+ else\r
+ conservation.annotations = annotations;\r
+\r