+ SequenceI[] insect=getSequencesInOrder(alignment);
+ sgroup.sequences = new Vector();
+ for (int s=0;insect!=null && s<insect.length;s++) {
+ if (hashtable==null || hashtable.containsKey(insect[s]))
+ {
+ sgroup.sequences.addElement(insect[s]); }
+ }
+ //Enumeration en =getSequences(hashtable).elements();
+ //while (en.hasMoreElements())
+ // {
+ // SequenceI elem = (SequenceI) en.nextElement();
+ // if (alignment.getSequences().contains(elem))
+ // {
+ // sgroup.addSequence(elem, false);
+ // }
+ // }
+ return sgroup;
+ }
+
+ /**
+ * @return the showUnconserved
+ */
+ public boolean getShowunconserved()
+ {
+ return showUnconserved;
+ }
+
+ /**
+ * @param showUnconserved the showUnconserved to set
+ */
+ public void setShowunconserved(boolean displayNonconserved)
+ {
+ this.showUnconserved = displayNonconserved;
+ }
+ AlignmentAnnotation consensus=null,conservation=null;
+
+ /**
+ * flag indicating if consensus histogram should be rendered
+ */
+ private boolean showConsensusHistogram;
+
+
+ /**
+ *
+ * @return automatically calculated consensus row
+ */
+ public AlignmentAnnotation getConsensus()
+ {
+ // TODO get or calculate and get consensus annotation row for this group
+ int aWidth = this.getWidth();
+ // pointer
+ // possibility
+ // here.
+ if (aWidth < 0)
+ {
+ return null;
+ }
+ if (consensus==null)
+ {
+ consensus = new AlignmentAnnotation("","",
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ consensus.hasText = true;
+ consensus.autoCalculated = true;
+ consensus.groupRef = this;
+ }
+ consensus.label = "Consensus for "+getName();
+ consensus.description = "Percent Identity";
+ return consensus;
+ }
+ /**
+ * get the conservation annotation row for this group
+ * @return autoCalculated annotation row
+ */
+ public AlignmentAnnotation getConservationRow() {
+ if (conservation == null) {
+ conservation = new AlignmentAnnotation("","", new Annotation[1], 0f, 11f,
+ AlignmentAnnotation.BAR_GRAPH);
+ conservation.hasText = true;
+ conservation.autoCalculated = true;
+ conservation.groupRef = this;
+ }
+ conservation.label = "Conservation for "+getName();
+ conservation.description = "Conservation for group "+getName()+" less than " + consPercGaps
+ + "% gaps";
+ return conservation;
+ }
+
+ /**
+ *
+ * @return true if annotation rows have been instantiated for this group
+ */
+ public boolean hasAnnotationRows()
+ {
+ return consensus!=null || conservation!=null;
+ }
+
+ public SequenceI getConsensusSeq()
+ {
+ getConsensus();
+ StringBuffer seqs = new StringBuffer();
+ for (int i = 0; i < consensus.annotations.length; i++)