+ public static final int LINE_GRAPH = 2;
+
+ public static final int CONTACT_MAP = 4;
+
+ /**
+ * property that when set to non-empty string disables display of column
+ * groups defined on the contact matrix
+ */
+ public static final String CONTACT_MAP_NOGROUPS = "CMNOGRPS";
+
+ public boolean belowAlignment = true;
+
+ public SequenceGroup groupRef = null;
+
+ /**
+ * display every column label, even if there is a row of identical labels
+ */
+ public boolean showAllColLabels = false;
+
+ /**
+ * scale the column label to fit within the alignment column.
+ */
+ public boolean scaleColLabel = false;
+
+ /**
+ * centre the column labels relative to the alignment column
+ */
+ public boolean centreColLabels = false;
+
+ private boolean isrna;
+
+ public static int getGraphValueFromString(String string)
+ {
+ if (string.equalsIgnoreCase("BAR_GRAPH"))
+ {
+ return BAR_GRAPH;
+ }
+ else if (string.equalsIgnoreCase("LINE_GRAPH"))
+ {
+ return LINE_GRAPH;
+ }
+ else
+ {
+ return NO_GRAPH;
+ }
+ }
+
+ /**
+ * Creates a new AlignmentAnnotation object.
+ *
+ * @param label
+ * short label shown under sequence labels
+ * @param description
+ * text displayed on mouseover
+ * @param annotations
+ * set of positional annotation elements
+ */
+ public AlignmentAnnotation(String label, String description,
+ Annotation[] annotations)
+ {
+ setAnnotationId();
+ // always editable?
+ editable = true;
+ this.label = label;
+ this.description = description;
+ this.annotations = annotations;
+
+ validateRangeAndDisplay();
+ }
+
+ /**
+ * Checks if annotation labels represent secondary structures
+ *
+ */
+ void areLabelsSecondaryStructure()
+ {
+ boolean nonSSLabel = false;
+ isrna = false;
+ StringBuffer rnastring = new StringBuffer();
+
+ char firstChar = 0;
+ for (int i = 0; i < annotations.length; i++)
+ {
+ // DEBUG jalview.bin.Console.outPrintln(i + ": " + annotations[i]);
+ if (annotations[i] == null)
+ {
+ continue;
+ }
+ if (annotations[i].secondaryStructure == 'H'
+ || annotations[i].secondaryStructure == 'E')
+ {
+ // DEBUG jalview.bin.Console.outPrintln( "/H|E/ '" +
+ // annotations[i].secondaryStructure + "'");
+ hasIcons |= true;
+ }
+ else
+ // Check for RNA secondary structure
+ {
+ // DEBUG jalview.bin.Console.outPrintln( "/else/ '" +
+ // annotations[i].secondaryStructure + "'");
+ // TODO: 2.8.2 should this ss symbol validation check be a function in
+ // RNA/ResidueProperties ?
+ // allow for DSSP extended code:
+ // https://www.wikidoc.org/index.php/Secondary_structure#The_DSSP_code
+ // GHITEBS as well as C and X (for missing?)
+ if (annotations[i].secondaryStructure == '('
+ || annotations[i].secondaryStructure == '['
+ || annotations[i].secondaryStructure == '<'
+ || annotations[i].secondaryStructure == '{'
+ || annotations[i].secondaryStructure == 'A'
+ // || annotations[i].secondaryStructure == 'B'
+ // || annotations[i].secondaryStructure == 'C'
+ || annotations[i].secondaryStructure == 'D'
+ // || annotations[i].secondaryStructure == 'E' // ambiguous on
+ // its own -- already checked above
+ || annotations[i].secondaryStructure == 'F'
+ // || annotations[i].secondaryStructure == 'G'
+ // || annotations[i].secondaryStructure == 'H' // ambiguous on
+ // its own -- already checked above
+ // || annotations[i].secondaryStructure == 'I'
+ || annotations[i].secondaryStructure == 'J'
+ || annotations[i].secondaryStructure == 'K'
+ || annotations[i].secondaryStructure == 'L'
+ || annotations[i].secondaryStructure == 'M'
+ || annotations[i].secondaryStructure == 'N'
+ || annotations[i].secondaryStructure == 'O'
+ || annotations[i].secondaryStructure == 'P'
+ || annotations[i].secondaryStructure == 'Q'
+ || annotations[i].secondaryStructure == 'R'
+ // || annotations[i].secondaryStructure == 'S'
+ // || annotations[i].secondaryStructure == 'T'
+ || annotations[i].secondaryStructure == 'U'
+ || annotations[i].secondaryStructure == 'V'
+ || annotations[i].secondaryStructure == 'W'
+ // || annotations[i].secondaryStructure == 'X'
+ || annotations[i].secondaryStructure == 'Y'
+ || annotations[i].secondaryStructure == 'Z')