2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.analysis.Conservation;
24 import jalview.datamodel.AlignmentAnnotation;
25 import jalview.datamodel.AlignmentI;
26 import jalview.datamodel.AlignmentView;
27 import jalview.datamodel.CigarArray;
28 import jalview.datamodel.ColumnSelection;
29 import jalview.datamodel.SequenceCollectionI;
30 import jalview.datamodel.SequenceGroup;
31 import jalview.datamodel.SequenceI;
32 import jalview.schemes.ColourSchemeI;
34 import java.util.Hashtable;
35 import java.util.List;
42 public interface AlignViewportI extends ViewStyleI
48 * calculate the height for visible annotation, revalidating bounds where
49 * necessary ABSTRACT GUI METHOD
51 * @return total height of annotation
53 public int calcPanelHeight();
55 boolean hasHiddenColumns();
57 boolean isValidCharWidth();
59 boolean isShowConsensusHistogram();
61 boolean isShowSequenceLogo();
63 boolean isNormaliseSequenceLogo();
65 ColourSchemeI getGlobalColourScheme();
67 AlignmentI getAlignment();
69 ColumnSelection getColumnSelection();
71 Hashtable[] getSequenceConsensusHash();
74 * Get consensus data table for the cDNA complement of this alignment (if any)
78 Hashtable[] getComplementConsensusHash();
80 Hashtable[] getRnaStructureConsensusHash();
82 boolean isIgnoreGapsConsensus();
84 boolean isCalculationInProgress(AlignmentAnnotation alignmentAnnotation);
86 AlignmentAnnotation getAlignmentQualityAnnot();
88 AlignmentAnnotation getAlignmentConservationAnnotation();
91 * get the container for alignment consensus annotation
95 AlignmentAnnotation getAlignmentConsensusAnnotation();
98 * get the container for cDNA complement consensus annotation
102 AlignmentAnnotation getComplementConsensusAnnotation();
105 * Test to see if viewport is still open and active
107 * @return true indicates that all references to viewport should be dropped
112 * get the associated calculation thread manager for the view
116 AlignCalcManagerI getCalcManager();
119 * get the percentage gaps allowed in a conservation calculation
122 public int getConsPercGaps();
125 * set the consensus result object for the viewport
129 void setSequenceConsensusHash(Hashtable[] hconsensus);
132 * Set the cDNA complement consensus for the viewport
136 void setComplementConsensusHash(Hashtable[] hconsensus);
140 * @return the alignment annotatino row for the structure consensus
143 AlignmentAnnotation getAlignmentStrucConsensusAnnotation();
146 * set the Rna structure consensus result object for the viewport
148 * @param hStrucConsensus
150 void setRnaStructureConsensusHash(Hashtable[] hStrucConsensus);
153 * set global colourscheme
157 void setGlobalColourScheme(ColourSchemeI rhc);
159 Map<SequenceI, SequenceCollectionI> getHiddenRepSequences();
161 void setHiddenRepSequences(
162 Map<SequenceI, SequenceCollectionI> hiddenRepSequences);
165 * hides or shows dynamic annotation rows based on groups and group and
166 * alignment associated auto-annotation state flags apply the current
167 * group/autoannotation settings to the alignment view. Usually you should
168 * call the AlignmentViewPanel.adjustAnnotationHeight() method afterwards to
169 * ensure the annotation panel bounds are set correctly.
171 * @param applyGlobalSettings
172 * - apply to all autoannotation rows or just the ones associated
173 * with the current visible region
174 * @param preserveNewGroupSettings
175 * - don't apply global settings to groups which don't already have
176 * group associated annotation
178 void updateGroupAnnotationSettings(boolean applyGlobalSettings,
179 boolean preserveNewGroupSettings);
181 void setSequenceColour(SequenceI seq, ColorI col);
183 ColorI getSequenceColour(SequenceI seq);
185 void updateSequenceIdColours();
187 SequenceGroup getSelectionGroup();
190 * get the currently selected sequence objects or all the sequences in the
191 * alignment. TODO: change to List<>
193 * @return array of references to sequence objects
195 SequenceI[] getSequenceSelection();
197 void clearSequenceColours();
200 * This method returns the visible alignment as text, as seen on the GUI, ie
201 * if columns are hidden they will not be returned in the result. Use this for
202 * calculating trees, PCA, redundancy etc on views which contain hidden
207 CigarArray getViewAsCigars(boolean selectedRegionOnly);
210 * return a compact representation of the current alignment selection to pass
211 * to an analysis function
213 * @param selectedOnly
214 * boolean true to just return the selected view
215 * @return AlignmentView
217 AlignmentView getAlignmentView(boolean selectedOnly);
220 * return a compact representation of the current alignment selection to pass
221 * to an analysis function
223 * @param selectedOnly
224 * boolean true to just return the selected view
226 * boolean true to annotate the alignment view with groups on the
227 * alignment (and intersecting with selected region if selectedOnly
229 * @return AlignmentView
231 AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups);
234 * This method returns the visible alignment as text, as seen on the GUI, ie
235 * if columns are hidden they will not be returned in the result. Use this for
236 * calculating trees, PCA, redundancy etc on views which contain hidden
241 String[] getViewAsString(boolean selectedRegionOnly);
243 void setSelectionGroup(SequenceGroup sg);
245 char getGapCharacter();
247 void setColumnSelection(ColumnSelection cs);
249 void setConservation(Conservation cons);
252 * get a copy of the currently visible alignment annotation
254 * @param selectedOnly
255 * if true - trim to selected regions on the alignment
256 * @return an empty list or new alignment annotation objects shown only
257 * visible columns trimmed to selected region only
259 List<AlignmentAnnotation> getVisibleAlignmentAnnotation(
260 boolean selectedOnly);
262 FeaturesDisplayedI getFeaturesDisplayed();
264 String getSequenceSetId();
266 boolean areFeaturesDisplayed();
268 void setFeaturesDisplayed(FeaturesDisplayedI featuresDisplayedI);
270 void alignmentChanged(AlignmentViewPanel ap);
273 * @return the padGaps
281 void setPadGaps(boolean padGaps);
284 * return visible region boundaries within given column range
287 * first column (inclusive, from 0)
289 * last column (exclusive)
290 * @return int[][] range of {start,end} visible positions
292 List<int[]> getVisibleRegionBoundaries(int min, int max);
295 * This method returns an array of new SequenceI objects derived from the
296 * whole alignment or just the current selection with start and end points
299 * @note if you need references to the actual SequenceI objects in the
300 * alignment or currently selected then use getSequenceSelection()
301 * @return selection as new sequenceI objects
303 SequenceI[] getSelectionAsNewSequence();
305 void invertColumnSelection();
308 * broadcast selection to any interested parties
310 void sendSelection();
313 * calculate the row position for alignmentIndex if all hidden sequences were
316 * @param alignmentIndex
317 * @return adjusted row position
319 int adjustForHiddenSeqs(int alignmentIndex);
321 boolean hasHiddenRows();
325 * @return a copy of this view's current display settings
327 public ViewStyleI getViewStyle();
330 * update the view's display settings with the given style set
332 * @param settingsForView
334 public void setViewStyle(ViewStyleI settingsForView);
337 * Returns a viewport which holds the cDna for this (protein), or vice versa,
338 * or null if none is set.
342 AlignViewportI getCodingComplement();
345 * Sets the viewport which holds the cDna for this (protein), or vice versa.
346 * Implementation should guarantee that the reciprocal relationship is always
347 * set, i.e. each viewport is the complement of the other.
349 void setCodingComplement(AlignViewportI sl);
352 * Answers true if viewport hosts DNA/RNA, else false.
356 boolean isNucleotide();
359 * Returns an id guaranteed to be unique for this viewport.
366 * Return true if view should scroll to show the highlighted region of a
371 boolean isFollowHighlight();
374 * Set whether view should scroll to show the highlighted region of a sequence
376 void setFollowHighlight(boolean b);
378 public void applyFeaturesStyle(FeatureSettingsModelI featureSettings);