boolean wrapAlignment=false;\r
boolean renderGaps = true;\r
boolean showSequenceFeatures = false;\r
+ boolean showAnnotation = true;\r
\r
boolean colourAppliesToAllGroups = true;\r
ColourSchemeI globalColourScheme = null;\r
\r
ColumnSelection colSel = new ColumnSelection();\r
\r
-\r
int threshold;\r
int increment;\r
\r
NJTree currentTree = null;\r
\r
+ boolean scaleAboveWrapped = false;\r
+ boolean scaleLeftWrapped = true;\r
+ boolean scaleRightWrapped = true;\r
+\r
\r
public AlignViewport(AlignmentI al,\r
boolean showText,\r
alignment.getWidth());\r
cons.calculate();\r
cons.verdict(false, 100);\r
-\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
- int value = 0;\r
+ float value = 0;\r
try\r
{\r
- value = Integer.parseInt(sequence.charAt(i) + "");\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
-\r
+ float vprop = value-min;\r
+ vprop/=max;\r
annotations[i] = new Annotation(sequence.charAt(i) + "",\r
- "Conservation graph", ' ', value);\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, 0, 10, 1);\r
+ annotations,\r
+ cons.qualityRange[0].floatValue(),\r
+ cons.qualityRange[1].floatValue(), 1);\r
alignment.addAnnotation(conservation);\r
}\r
else\r
maxRes = "+ ";\r
}\r
\r
- mouseOver += value+"%";\r
+ mouseOver += (int)value+"%";\r
annotations[i] = new Annotation(maxRes, mouseOver, ' ', value);\r
\r
}\r
{\r
showFullId = b;\r
}\r
+\r
+ public boolean getShowAnnotation()\r
+ {\r
+ return showAnnotation;\r
+ }\r
+\r
+ public void setShowAnnotation(boolean b)\r
+ {\r
+ showAnnotation = b;\r
+ }\r
+\r
+ public boolean getScaleAboveWrapped()\r
+ { return scaleAboveWrapped;}\r
+\r
+ public boolean getScaleLeftWrapped()\r
+ { return scaleLeftWrapped; }\r
+\r
+ public boolean getScaleRightWrapped()\r
+ { return scaleRightWrapped; }\r
+\r
+ public void setScaleAboveWrapped(boolean b)\r
+ { scaleAboveWrapped = b; }\r
+\r
+ public void setScaleLeftWrapped(boolean b)\r
+ { scaleLeftWrapped = b; }\r
+\r
+ public void setScaleRightWrapped(boolean b)\r
+ { scaleRightWrapped = b; }\r
+\r
+\r
}\r