public void setWrapAlignment(boolean state)
{
viewStyle.setWrapAlignment(state);
+ ranges.setWrappedMode(state);
}
/**
@Override
public boolean hasHiddenColumns()
{
- return colSel != null
+ return alignment.getHiddenColumns() != null
&& alignment.getHiddenColumns().hasHiddenColumns();
}
hiddenRepSequences = null;
+ ranges.setViewportStartAndHeight(0, alignment.getHeight());
firePropertyChange("alignment", null, alignment.getSequences());
// used to set hasHiddenRows/hiddenRepSequences here, after the property
// changed event
selectionGroup.addSequence(seq, false);
setSequenceAnnotationsVisible(seq, true);
}
+ ranges.setViewportStartAndHeight(0, alignment.getHeight());
firePropertyChange("alignment", null, alignment.getSequences());
sendSelection();
}
alignment.getHiddenSequences().hideSequence(seq[i]);
setSequenceAnnotationsVisible(seq[i], false);
}
+ ranges.setViewportStartAndHeight(0, alignment.getHeight());
firePropertyChange("alignment", null, alignment.getSequences());
}
}
{
return searchResults;
}
+
+ /**
+ * get the consensus sequence as displayed under the PID consensus annotation
+ * row.
+ *
+ * @return consensus sequence as a new sequence object
+ */
+ public SequenceI getConsensusSeq()
+ {
+ if (consensus == null)
+ {
+ updateConsensus(null);
+ }
+ if (consensus == null)
+ {
+ return null;
+ }
+ StringBuffer seqs = new StringBuffer();
+ for (int i = 0; i < consensus.annotations.length; i++)
+ {
+ Annotation annotation = consensus.annotations[i];
+ if (annotation != null)
+ {
+ String description = annotation.description;
+ if (description != null && description.startsWith("["))
+ {
+ // consensus is a tie - just pick the first one
+ seqs.append(description.charAt(1));
+ }
+ else
+ {
+ seqs.append(annotation.displayCharacter);
+ }
+ }
+ }
+
+ SequenceI sq = new Sequence("Consensus", seqs.toString());
+ sq.setDescription("Percentage Identity Consensus "
+ + ((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
+ return sq;
+ }
}