From: Jim Procter Date: Wed, 5 Jul 2017 15:06:42 +0000 (+0100) Subject: Merge branch 'develop' into features/JAL-2349_matrixvis X-Git-Tag: Release_2_11_4_0~562^2~9^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=393c021841078b08e5d020f73b7215ef949526f6;p=jalview.git Merge branch 'develop' into features/JAL-2349_matrixvis --- 393c021841078b08e5d020f73b7215ef949526f6 diff --cc src/jalview/viewmodel/AlignmentViewport.java index 8ba72f9,9a08a2b..39820c8 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@@ -2872,9 -2871,44 +2872,50 @@@ public abstract class AlignmentViewpor return searchResults; } + @Override + public ContactListI getContactList(AlignmentAnnotation _aa, int column) + { + return alignment.getContactListFor(_aa, column); + } ++ + /** + * 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; + } }