From 7db0832b434e34aa682d38a896fbd3ad3ae2d217 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 30 Jun 2017 11:48:15 +0100 Subject: [PATCH] JAL-2602 pulled up identical methods to base class --- src/jalview/appletgui/AlignViewport.java | 40 ------------------------ src/jalview/gui/AlignViewport.java | 43 -------------------------- src/jalview/viewmodel/AlignmentViewport.java | 41 ++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 83 deletions(-) diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index a894d0b..1d2c4bc 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -230,46 +230,6 @@ public class AlignViewport extends AlignmentViewport implements } - /** - * 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; - } - StringBuilder seqs = new StringBuilder(consensus.annotations.length); - 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(annotation.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; - } - java.awt.Frame nullFrame; protected FeatureSettings featureSettings = null; diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 288f261..835371f 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -34,13 +34,11 @@ import jalview.commands.CommandI; import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; -import jalview.datamodel.Annotation; import jalview.datamodel.ColumnSelection; import jalview.datamodel.HiddenColumns; import jalview.datamodel.PDBEntry; import jalview.datamodel.SearchResults; import jalview.datamodel.SearchResultsI; -import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.renderer.ResidueShader; @@ -312,47 +310,6 @@ public class AlignViewport extends AlignmentViewport implements } } - /** - * 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; - } - boolean validCharWidth; /** diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 107cdd4..9a08a2b 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -2870,4 +2870,45 @@ public abstract class AlignmentViewport implements AlignViewportI, { 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; + } } -- 1.7.10.2