/*\r
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)\r
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6.1)\r
* Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
* \r
* This file is part of Jalview.\r
text.append("displayBoxes=" + sg.getDisplayBoxes() + "\t");\r
text.append("displayText=" + sg.getDisplayText() + "\t");\r
text.append("colourText=" + sg.getColourText() + "\t");\r
- text.append("showUnconserved=" + sg.getShowunconserved() + "\t");\r
+ text.append("showUnconserved=" + sg.getShowNonconserved() + "\t");\r
if (sg.textColour != java.awt.Color.black)\r
{\r
text.append("textCol1="\r
if (aa[aai].autoCalculated)\r
{\r
// make a note of the name and description\r
- autoAnnots.put(aa[aai].graph\r
- + "\t"\r
- + aa[aai].label\r
- + "\t"\r
- + aa[aai].description\r
- + "\t"\r
- + (aa[aai].sequenceRef != null ? aa[aai].sequenceRef\r
- .getDisplayId(true) : ""), new Integer(1));\r
+ autoAnnots\r
+ .put(aa[aai].graph\r
+ + "\t"\r
+ + aa[aai].label\r
+ + "\t"\r
+ + aa[aai].description\r
+ + "\t"\r
+ + (aa[aai].sequenceRef != null ? aa[aai].sequenceRef\r
+ .getDisplayId(true) : ""),\r
+ new Integer(1));\r
}\r
}\r
}\r
int graphGroup = -1;\r
String group = st.nextToken();\r
// First make sure we are not overwriting the graphIndex\r
- for (int i = 0; i < al.getAlignmentAnnotation().length; i++)\r
- {\r
- if (al.getAlignmentAnnotation()[i].label.equalsIgnoreCase(group))\r
- {\r
- graphGroup = al.getAlignmentAnnotation()[i].graphGroup + 1;\r
- al.getAlignmentAnnotation()[i].graphGroup = graphGroup;\r
- break;\r
- }\r
- }\r
-\r
- // Now update groups\r
- while (st.hasMoreTokens())\r
+ if (al.getAlignmentAnnotation() != null)\r
{\r
- group = st.nextToken();\r
for (int i = 0; i < al.getAlignmentAnnotation().length; i++)\r
{\r
if (al.getAlignmentAnnotation()[i].label.equalsIgnoreCase(group))\r
{\r
+ graphGroup = al.getAlignmentAnnotation()[i].graphGroup + 1;\r
al.getAlignmentAnnotation()[i].graphGroup = graphGroup;\r
break;\r
}\r
}\r
+\r
+ // Now update groups\r
+ while (st.hasMoreTokens())\r
+ {\r
+ group = st.nextToken();\r
+ for (int i = 0; i < al.getAlignmentAnnotation().length; i++)\r
+ {\r
+ if (al.getAlignmentAnnotation()[i].label.equalsIgnoreCase(group))\r
+ {\r
+ al.getAlignmentAnnotation()[i].graphGroup = graphGroup;\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ else\r
+ {\r
+ System.err\r
+ .println("Couldn't combine annotations. None are added to alignment yet!");\r
}\r
}\r
\r
void addLine(AlignmentI al, StringTokenizer st)\r
{\r
String group = st.nextToken();\r
- AlignmentAnnotation annotation = null;\r
-\r
- for (int i = 0; i < al.getAlignmentAnnotation().length; i++)\r
+ AlignmentAnnotation annotation = null, alannot[] = al\r
+ .getAlignmentAnnotation();\r
+ if (alannot != null)\r
{\r
- if (al.getAlignmentAnnotation()[i].label.equalsIgnoreCase(group))\r
+ for (int i = 0; i < alannot.length; i++)\r
{\r
- annotation = al.getAlignmentAnnotation()[i];\r
- break;\r
+ if (alannot[i].label.equalsIgnoreCase(group))\r
+ {\r
+ annotation = alannot[i];\r
+ break;\r
+ }\r
}\r
}\r
-\r
if (annotation == null)\r
{\r
return;\r
}\r
else\r
{\r
- sg\r
- .addSequence(al.getSequenceAt(Integer.parseInt(tmp) - 1),\r
- false);\r
+ sg.addSequence(al.getSequenceAt(Integer.parseInt(tmp) - 1), false);\r
}\r
}\r
}\r
centerlab = Boolean.valueOf(value).booleanValue();\r
}\r
AlignmentAnnotation[] alr = al.getAlignmentAnnotation();\r
- for (int i = 0; i < alr.length; i++)\r
+ if (alr != null)\r
{\r
- if (alr[i].label.equalsIgnoreCase(label))\r
+ for (int i = 0; i < alr.length; i++)\r
{\r
- alr[i].centreColLabels = centerlab;\r
- alr[i].scaleColLabel = scaletofit;\r
- alr[i].showAllColLabels = showalllabs;\r
+ if (alr[i].label.equalsIgnoreCase(label))\r
+ {\r
+ alr[i].centreColLabels = centerlab;\r
+ alr[i].scaleColLabel = scaletofit;\r
+ alr[i].showAllColLabels = showalllabs;\r
+ }\r
}\r
}\r
}\r
{\r
sg.cs.setConservationInc(Integer.parseInt(value));\r
Conservation c = new Conservation("Group",\r
- ResidueProperties.propHash, 3, sg.getSequences(null), sg\r
- .getStartRes(), sg.getEndRes() + 1);\r
+ ResidueProperties.propHash, 3, sg.getSequences(null),\r
+ sg.getStartRes(), sg.getEndRes() + 1);\r
\r
c.calculate();\r
c.verdict(false, 25);\r
}\r
else if (key.equalsIgnoreCase("showUnconserved"))\r
{\r
- sg.setShowunconserved(Boolean.valueOf(value).booleanValue());\r
+ sg.setShowNonconserved(Boolean.valueOf(value).booleanValue());\r
}\r
else if (key.equalsIgnoreCase("displayText"))\r
{\r
void setBelowAlignment(AlignmentI al, StringTokenizer st)\r
{\r
String token;\r
- AlignmentAnnotation aa;\r
+ AlignmentAnnotation aa, ala[] = al.getAlignmentAnnotation();\r
+ if (ala == null)\r
+ {\r
+ System.err\r
+ .print("Warning - no annotation to set below for sequence associated annotation:");\r
+ }\r
while (st.hasMoreTokens())\r
{\r
token = st.nextToken();\r
- for (int i = 0; i < al.getAlignmentAnnotation().length; i++)\r
+ if (ala == null)\r
+ {\r
+ System.err.print(" " + token);\r
+ }\r
+ else\r
{\r
- aa = al.getAlignmentAnnotation()[i];\r
- if (aa.sequenceRef == refSeq && aa.label.equals(token))\r
+ for (int i = 0; i < al.getAlignmentAnnotation().length; i++)\r
{\r
- aa.belowAlignment = true;\r
+ aa = al.getAlignmentAnnotation()[i];\r
+ if (aa.sequenceRef == refSeq && aa.label.equals(token))\r
+ {\r
+ aa.belowAlignment = true;\r
+ }\r
}\r
}\r
}\r
+ if (ala == null)\r
+ {\r
+ System.err.print("\n");\r
+ }\r
}\r
\r
void addAlignmentDetails(AlignmentI al, StringTokenizer st)\r