From: gmungoc Date: Mon, 3 Jul 2017 14:39:09 +0000 (+0100) Subject: Merge branch 'develop' into bug/JAL-147scrollWrappedView X-Git-Tag: Release_2_10_3b1~132^2~57 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2c50a2864785391e69940a9381d0ee5c5a6ea538;hp=-c;p=jalview.git Merge branch 'develop' into bug/JAL-147scrollWrappedView --- 2c50a2864785391e69940a9381d0ee5c5a6ea538 diff --combined src/jalview/viewmodel/AlignmentViewport.java index 0cdba1e,9a08a2b..1e094fd --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@@ -405,7 -405,6 +405,7 @@@ public abstract class AlignmentViewpor public void setWrapAlignment(boolean state) { viewStyle.setWrapAlignment(state); + ranges.setWrappedMode(state); } /** @@@ -2871,4 -2870,45 +2871,45 @@@ { 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; + } }