+ f = c;
+ cons++;
+ }
+ else if (f == c)
+ {
+ cons++;
+ }
+ }
+ }
+
+ r[0] = (nres == cons) ? 1 : 0;
+ r[1] = count;
+
+ return r;
+ }
+
+ /**
+ * Returns the upper-cased character if between 'a' and 'z', else the
+ * unchanged value
+ *
+ * @param c
+ * @return
+ */
+ char toUpperCase(char c)
+ {
+ if ('a' <= c && c <= 'z')
+ {
+ c -= (32); // 32 = 'a' - 'A'
+ }
+ return c;
+ }
+
+ /**
+ * Calculates the conservation sequence
+ *
+ * @param consflag
+ * if true, positive conservation; false calculates negative
+ * conservation
+ * @param percentageGaps
+ * commonly used value is 25
+ */
+ public void verdict(boolean consflag, float percentageGaps)
+ {
+ StringBuffer consString = new StringBuffer();
+
+ // NOTE THIS SHOULD CHECK IF THE CONSEQUENCE ALREADY
+ // EXISTS AND NOT OVERWRITE WITH '-', BUT THIS CASE
+ // DOES NOT EXIST IN JALVIEW 2.1.2
+ for (int i = 0; i < start; i++)
+ {
+ consString.append('-');
+ }
+ consSymbs = new String[end - start + 1];
+ for (int i = start; i <= end; i++)
+ {
+ int[] gapcons = countConsNGaps(i);
+ int totGaps = gapcons[1];
+ float pgaps = ((float) totGaps * 100) / sequences.length;
+ consSymbs[i - start] = new String();