2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
20 package jalview.appletgui;
\r
26 import jalview.analysis.*;
\r
27 import jalview.bin.*;
\r
28 import jalview.datamodel.*;
\r
29 import jalview.schemes.*;
\r
31 public class AlignViewport
\r
40 boolean cursorMode = false;
\r
42 boolean showJVSuffix = true;
\r
43 boolean showText = true;
\r
44 boolean showColourText = false;
\r
45 boolean showBoxes = true;
\r
46 boolean wrapAlignment = false;
\r
47 boolean renderGaps = true;
\r
48 boolean showSequenceFeatures = false;
\r
49 boolean showAnnotation = true;
\r
50 boolean showConservation = true;
\r
51 boolean showQuality = true;
\r
52 boolean showConsensus = true;
\r
53 boolean upperCasebold = false;
\r
55 boolean colourAppliesToAllGroups = true;
\r
56 ColourSchemeI globalColourScheme = null;
\r
57 boolean conservationColourSelected = false;
\r
58 boolean abovePIDThreshold = false;
\r
60 SequenceGroup selectionGroup;
\r
66 Font font = new Font("SansSerif", Font.PLAIN, 10);
\r
67 boolean validCharWidth = true;
\r
68 AlignmentI alignment;
\r
70 ColumnSelection colSel = new ColumnSelection();
\r
75 NJTree currentTree = null;
\r
77 boolean scaleAboveWrapped = true;
\r
78 boolean scaleLeftWrapped = true;
\r
79 boolean scaleRightWrapped = true;
\r
81 // The following vector holds the features which are
\r
82 // currently visible, in the correct order or rendering
\r
83 public Hashtable featuresDisplayed;
\r
85 boolean hasHiddenColumns = false;
\r
86 boolean hasHiddenRows = false;
\r
87 boolean showHiddenMarkers = true;
\r
90 public Hashtable [] hconsensus;
\r
91 AlignmentAnnotation consensus;
\r
92 AlignmentAnnotation conservation;
\r
93 AlignmentAnnotation quality;
\r
95 boolean autocalculateConsensus = true;
\r
97 public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
\r
99 private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(this);
\r
101 boolean ignoreGapsInConsensusCalculation = false;
\r
103 jalview.bin.JalviewLite applet;
\r
105 Hashtable sequenceColours;
\r
107 boolean MAC = false;
\r
109 public AlignViewport(AlignmentI al, JalviewLite applet)
\r
111 this.applet = applet;
\r
114 this.endRes = al.getWidth() - 1;
\r
116 this.endSeq = al.getHeight() - 1;
\r
119 if(System.getProperty("os.name").startsWith("Mac"))
\r
122 if (applet != null)
\r
124 String param = applet.getParameter("showFullId");
\r
127 showJVSuffix = Boolean.valueOf(param).booleanValue();
\r
130 param = applet.getParameter("showAnnotation");
\r
133 showAnnotation = Boolean.valueOf(param).booleanValue();
\r
136 param = applet.getParameter("showConservation");
\r
139 showConservation = Boolean.valueOf(param).booleanValue();
\r
142 param = applet.getParameter("showQuality");
\r
145 showQuality = Boolean.valueOf(param).booleanValue();
\r
148 param = applet.getParameter("showConsensus");
\r
151 showConsensus = Boolean.valueOf(param).booleanValue();
\r
154 param = applet.getParameter("upperCase");
\r
157 if(param.equalsIgnoreCase("bold"))
\r
158 upperCasebold = true;
\r
162 // We must set conservation and consensus before setting colour,
\r
163 // as Blosum and Clustal require this to be done
\r
164 updateConservation();
\r
168 if (applet != null)
\r
170 String colour = applet.getParameter("defaultColour");
\r
174 colour = applet.getParameter("userDefinedColour");
\r
176 colour = "User Defined";
\r
181 globalColourScheme = ColourSchemeProperty.getColour(alignment, colour);
\r
182 if (globalColourScheme != null)
\r
184 globalColourScheme.setConsensus(hconsensus);
\r
188 if(applet.getParameter("userDefinedColour")!=null)
\r
190 ((UserColourScheme)globalColourScheme).parseAppletParameter(
\r
191 applet.getParameter("userDefinedColour"));
\r
198 public void showSequenceFeatures(boolean b)
\r
200 showSequenceFeatures = b;
\r
203 public boolean getShowSequenceFeatures()
\r
205 return showSequenceFeatures;
\r
209 public void updateConservation()
\r
211 if(alignment.isNucleotide())
\r
214 Conservation cons = new jalview.analysis.Conservation("All",
\r
215 jalview.schemes.ResidueProperties.propHash, 3,
\r
216 alignment.getSequences(), 0,
\r
217 alignment.getWidth() - 1);
\r
219 cons.verdict(false, ConsPercGaps);
\r
220 cons.findQuality();
\r
221 int alWidth = alignment.getWidth();
\r
222 Annotation[] annotations = new Annotation[alWidth];
\r
223 Annotation[] qannotations = new Annotation[alWidth];
\r
224 String sequence = cons.getConsSequence().getSequence();
\r
225 float minR, minG, minB, maxR, maxG, maxB;
\r
229 maxR = 1.0f - minR;
\r
230 maxG = 0.9f - minG;
\r
231 maxB = 0f - minB; // scalable range for colouring both Conservation and Quality
\r
234 float qmin = cons.qualityRange[0].floatValue();
\r
235 float qmax = cons.qualityRange[1].floatValue();
\r
237 for (int i = 0; i < alWidth; i++)
\r
242 value = Integer.parseInt(sequence.charAt(i) + "");
\r
244 catch (Exception ex)
\r
246 if (sequence.charAt(i) == '*')
\r
250 if (sequence.charAt(i) == '+')
\r
255 float vprop = value - min;
\r
258 annotations[i] = new Annotation(sequence.charAt(i) + "",
\r
260 new Color(minR + maxR * vprop,
\r
261 minG + maxG * vprop,
\r
262 minB + maxB * vprop));
\r
264 value = ( (Double) cons.quality.elementAt(i)).floatValue();
\r
265 vprop = value - qmin;
\r
267 qannotations[i] = new Annotation(" ",
\r
268 String.valueOf(value), ' ', value,
\r
270 Color(minR + maxR * vprop,
\r
271 minG + maxG * vprop,
\r
272 minB + maxB * vprop));
\r
275 if (conservation == null)
\r
277 conservation = new AlignmentAnnotation("Conservation",
\r
278 "Conservation of total alignment less than " +
\r
279 ConsPercGaps + "% gaps",
\r
281 0f, // cons.qualityRange[0].floatValue(),
\r
282 11f, // cons.qualityRange[1].floatValue()
\r
283 AlignmentAnnotation.BAR_GRAPH);
\r
284 if (showConservation)
\r
286 alignment.addAnnotation(conservation);
\r
288 quality = new AlignmentAnnotation("Quality",
\r
289 "Alignment Quality based on Blosum62 scores",
\r
291 cons.qualityRange[0].floatValue(),
\r
292 cons.qualityRange[1].floatValue(),
\r
293 AlignmentAnnotation.BAR_GRAPH);
\r
296 alignment.addAnnotation(quality);
\r
301 conservation.annotations = annotations;
\r
302 quality.annotations = qannotations;
\r
303 quality.graphMax = cons.qualityRange[1].floatValue();
\r
308 public void updateConsensus()
\r
310 // this routine prevents vconsensus becoming a new object each time
\r
311 // consenus is calculated. Important for speed of Blosum62
\r
312 // and PID colouring of alignment
\r
313 int aWidth = alignment.getWidth();
\r
315 Annotation[] annotations = new Annotation[aWidth];
\r
317 hconsensus = new Hashtable[aWidth];
\r
318 AAFrequency.calculate(alignment.getSequencesArray(),
\r
322 for (int i = 0; i < aWidth; i++)
\r
325 if(ignoreGapsInConsensusCalculation)
\r
326 value = ((Float)hconsensus[i].get(AAFrequency.PID_NOGAPS)).floatValue();
\r
328 value = ((Float)hconsensus[i].get(AAFrequency.PID_GAPS)).floatValue();
\r
330 String maxRes = hconsensus[i].get(AAFrequency.MAXRESIDUE).toString();
\r
331 String mouseOver = maxRes;
\r
332 if (maxRes.length() > 1)
\r
334 mouseOver = "[" + maxRes + "] ";
\r
339 mouseOver += (int) value + "%";
\r
340 annotations[i] = new Annotation(maxRes, mouseOver, ' ', value);
\r
344 if (consensus == null)
\r
346 consensus = new AlignmentAnnotation("Consensus",
\r
347 "PID", annotations, 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
\r
350 alignment.addAnnotation(consensus);
\r
355 consensus.annotations = annotations;
\r
358 if(globalColourScheme!=null)
\r
359 globalColourScheme.setConsensus(hconsensus);
\r
363 * get the consensus sequence as displayed under the PID consensus annotation row.
\r
364 * @return consensus sequence as a new sequence object
\r
367 * get the consensus sequence as displayed under the PID consensus annotation row.
\r
368 * @return consensus sequence as a new sequence object
\r
370 public SequenceI getConsensusSeq() {
\r
371 if (consensus==null)
\r
373 if (consensus==null)
\r
375 StringBuffer seqs=new StringBuffer();
\r
376 for (int i=0; i<consensus.annotations.length; i++) {
\r
377 if (consensus.annotations[i]!=null) {
\r
378 if (consensus.annotations[i].description.charAt(0) == '[')
\r
379 seqs.append(consensus.annotations[i].description.charAt(1));
\r
381 seqs.append(consensus.annotations[i].displayCharacter);
\r
384 SequenceI sq = new Sequence("Consensus", seqs.toString());
\r
385 sq.setDescription("Percentage Identity Consensus "+((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
\r
388 public SequenceGroup getSelectionGroup()
\r
390 return selectionGroup;
\r
393 public void setSelectionGroup(SequenceGroup sg)
\r
395 selectionGroup = sg;
\r
398 public boolean getConservationSelected()
\r
400 return conservationColourSelected;
\r
403 public void setConservationSelected(boolean b)
\r
405 conservationColourSelected = b;
\r
408 public boolean getAbovePIDThreshold()
\r
410 return abovePIDThreshold;
\r
413 public void setAbovePIDThreshold(boolean b)
\r
415 abovePIDThreshold = b;
\r
418 public int getStartRes()
\r
423 public int getEndRes()
\r
428 public int getStartSeq()
\r
433 public void setGlobalColourScheme(ColourSchemeI cs)
\r
435 globalColourScheme = cs;
\r
438 public ColourSchemeI getGlobalColourScheme()
\r
440 return globalColourScheme;
\r
443 public void setStartRes(int res)
\r
445 this.startRes = res;
\r
448 public void setStartSeq(int seq)
\r
450 this.startSeq = seq;
\r
453 public void setEndRes(int res)
\r
455 if (res > alignment.getWidth() - 1)
\r
457 // log.System.out.println(" Corrected res from " + res + " to maximum " + (alignment.getWidth()-1));
\r
458 res = alignment.getWidth() - 1;
\r
467 public void setEndSeq(int seq)
\r
469 if (seq > alignment.getHeight())
\r
471 seq = alignment.getHeight();
\r
480 public int getEndSeq()
\r
485 java.awt.Frame nullFrame;
\r
486 public void setFont(Font f)
\r
489 if(nullFrame == null)
\r
491 nullFrame = new java.awt.Frame();
\r
492 nullFrame.addNotify();
\r
495 java.awt.FontMetrics fm = nullFrame.getGraphics().getFontMetrics(font);
\r
496 setCharHeight(fm.getHeight());
\r
497 charWidth = fm.charWidth('M');
\r
501 Font f2 = new Font(f.getName(), Font.BOLD, f.getSize());
\r
502 fm = nullFrame.getGraphics().getFontMetrics(f2);
\r
503 charWidth = fm.stringWidth("MMMMMMMMMMM") / 10;
\r
507 public Font getFont()
\r
512 public int getCharWidth()
\r
517 public void setCharHeight(int h)
\r
519 this.charHeight = h;
\r
522 public int getCharHeight()
\r
527 public void setWrappedWidth(int w)
\r
529 this.wrappedWidth = w;
\r
532 public int getwrappedWidth()
\r
534 return wrappedWidth;
\r
537 public AlignmentI getAlignment()
\r
542 public void setAlignment(AlignmentI align)
\r
544 this.alignment = align;
\r
547 public void setWrapAlignment(boolean state)
\r
549 wrapAlignment = state;
\r
552 public void setShowText(boolean state)
\r
557 public void setRenderGaps(boolean state)
\r
559 renderGaps = state;
\r
562 public boolean getColourText()
\r
564 return showColourText;
\r
567 public void setColourText(boolean state)
\r
569 showColourText = state;
\r
572 public void setShowBoxes(boolean state)
\r
577 public boolean getWrapAlignment()
\r
579 return wrapAlignment;
\r
582 public boolean getShowText()
\r
587 public boolean getShowBoxes()
\r
592 public char getGapCharacter()
\r
594 return getAlignment().getGapCharacter();
\r
597 public void setGapCharacter(char gap)
\r
599 if (getAlignment() != null)
\r
601 getAlignment().setGapCharacter(gap);
\r
605 public void setThreshold(int thresh)
\r
607 threshold = thresh;
\r
610 public int getThreshold()
\r
615 public void setIncrement(int inc)
\r
620 public int getIncrement()
\r
625 public void setHiddenColumns(ColumnSelection colsel)
\r
627 this.colSel = colsel;
\r
628 if(colSel.getHiddenColumns()!=null)
\r
629 hasHiddenColumns = true;
\r
632 public ColumnSelection getColumnSelection()
\r
637 public void resetSeqLimits(int height)
\r
639 setEndSeq(height / getCharHeight());
\r
642 public void setCurrentTree(NJTree tree)
\r
644 currentTree = tree;
\r
647 public NJTree getCurrentTree()
\r
649 return currentTree;
\r
652 public void setColourAppliesToAllGroups(boolean b)
\r
654 colourAppliesToAllGroups = b;
\r
657 public boolean getColourAppliesToAllGroups()
\r
659 return colourAppliesToAllGroups;
\r
662 public boolean getShowJVSuffix()
\r
664 return showJVSuffix;
\r
667 public void setShowJVSuffix(boolean b)
\r
672 public boolean getShowAnnotation()
\r
674 return showAnnotation;
\r
677 public void setShowAnnotation(boolean b)
\r
679 showAnnotation = b;
\r
682 public boolean getScaleAboveWrapped()
\r
684 return scaleAboveWrapped;
\r
687 public boolean getScaleLeftWrapped()
\r
689 return scaleLeftWrapped;
\r
692 public boolean getScaleRightWrapped()
\r
694 return scaleRightWrapped;
\r
697 public void setScaleAboveWrapped(boolean b)
\r
699 scaleAboveWrapped = b;
\r
702 public void setScaleLeftWrapped(boolean b)
\r
704 scaleLeftWrapped = b;
\r
707 public void setScaleRightWrapped(boolean b)
\r
709 scaleRightWrapped = b;
\r
712 public void setIgnoreGapsConsensus(boolean b)
\r
714 ignoreGapsInConsensusCalculation = b;
\r
716 if (globalColourScheme!=null)
\r
718 globalColourScheme.setThreshold(globalColourScheme.getThreshold(),
\r
719 ignoreGapsInConsensusCalculation);
\r
725 * Property change listener for changes in alignment
\r
727 * @param listener DOCUMENT ME!
\r
729 public void addPropertyChangeListener(
\r
730 java.beans.PropertyChangeListener listener)
\r
732 changeSupport.addPropertyChangeListener(listener);
\r
738 * @param listener DOCUMENT ME!
\r
740 public void removePropertyChangeListener(
\r
741 java.beans.PropertyChangeListener listener)
\r
743 changeSupport.removePropertyChangeListener(listener);
\r
747 * Property change listener for changes in alignment
\r
749 * @param prop DOCUMENT ME!
\r
750 * @param oldvalue DOCUMENT ME!
\r
751 * @param newvalue DOCUMENT ME!
\r
753 public void firePropertyChange(String prop, Object oldvalue, Object newvalue)
\r
755 changeSupport.firePropertyChange(prop, oldvalue, newvalue);
\r
760 public boolean getIgnoreGapsConsensus()
\r
762 return ignoreGapsInConsensusCalculation;
\r
764 public void hideSelectedColumns()
\r
766 if (colSel.size() < 1)
\r
769 colSel.hideSelectedColumns();
\r
770 setSelectionGroup(null);
\r
772 hasHiddenColumns = true;
\r
775 public void invertColumnSelection()
\r
778 for (int i = 0; i < alignment.getWidth(); i++)
\r
782 if (colSel.contains(column))
\r
783 colSel.removeElement(column);
\r
785 colSel.addElement(column);
\r
791 public void hideColumns(int start, int end)
\r
794 colSel.hideColumns(start);
\r
796 colSel.hideColumns(start, end);
\r
798 hasHiddenColumns = true;
\r
801 public void hideAllSelectedSeqs()
\r
803 if (selectionGroup == null)
\r
806 SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
\r
808 hideSequence(seqs);
\r
810 setSelectionGroup(null);
\r
813 public void hideSequence(SequenceI [] seq)
\r
817 for (int i = 0; i < seq.length; i++)
\r
818 alignment.getHiddenSequences().hideSequence(seq[i]);
\r
820 hasHiddenRows = true;
\r
821 firePropertyChange("alignment", null, alignment.getSequences());
\r
825 public void showColumn(int col)
\r
827 colSel.revealHiddenColumns(col);
\r
828 if(colSel.getHiddenColumns()==null)
\r
829 hasHiddenColumns = false;
\r
832 public void showAllHiddenColumns()
\r
834 colSel.revealAllHiddenColumns();
\r
835 hasHiddenColumns = false;
\r
838 public void showAllHiddenSeqs()
\r
840 if(alignment.getHiddenSequences().getSize()>0)
\r
842 if(selectionGroup==null)
\r
844 selectionGroup = new SequenceGroup();
\r
845 selectionGroup.setEndRes(alignment.getWidth()-1);
\r
847 Vector tmp = alignment.getHiddenSequences().showAll();
\r
848 for(int t=0; t<tmp.size(); t++)
\r
850 selectionGroup.addSequence(
\r
851 (SequenceI)tmp.elementAt(t), false
\r
854 firePropertyChange("alignment", null, alignment.getSequences());
\r
855 hasHiddenRows = false;
\r
859 public int adjustForHiddenSeqs(int alignmentIndex)
\r
861 return alignment.getHiddenSequences().adjustForHiddenSeqs(alignmentIndex);
\r
865 * This method returns the a new SequenceI [] with
\r
866 * the selection sequence and start and end points adjusted
\r
869 public SequenceI[] getSelectionAsNewSequence()
\r
871 SequenceI[] sequences;
\r
873 if (selectionGroup == null)
\r
874 sequences = alignment.getSequencesArray();
\r
876 sequences = selectionGroup.getSelectionAsNewSequences(alignment);
\r
882 * This method returns the visible alignment as text, as
\r
883 * seen on the GUI, ie if columns are hidden they will not
\r
884 * be returned in the result.
\r
885 * Use this for calculating trees, PCA, redundancy etc on views
\r
886 * which contain hidden columns.
\r
889 public jalview.datamodel.CigarArray getViewAsCigars(boolean selectedRegionOnly)
\r
891 CigarArray selection=null;
\r
892 SequenceI [] seqs= null;
\r
894 int start = 0, end = 0;
\r
895 if(selectedRegionOnly && selectionGroup!=null)
\r
897 iSize = selectionGroup.getSize(false);
\r
898 seqs = selectionGroup.getSequencesInOrder(alignment);
\r
899 start = selectionGroup.getStartRes();
\r
900 end = selectionGroup.getEndRes(); // inclusive for start and end in SeqCigar constructor
\r
904 iSize = alignment.getHeight();
\r
905 seqs = alignment.getSequencesArray();
\r
906 end = alignment.getWidth()-1;
\r
908 SeqCigar[] selseqs = new SeqCigar[iSize];
\r
909 for(i=0; i<iSize; i++)
\r
911 selseqs[i] = new SeqCigar(seqs[i], start, end);
\r
913 selection=new CigarArray(selseqs);
\r
914 // now construct the CigarArray operations
\r
915 if (hasHiddenColumns) {
\r
916 Vector regions = colSel.getHiddenColumns();
\r
918 int hideStart, hideEnd;
\r
920 for (int j = 0; last<end & j < regions.size(); j++)
\r
922 region = (int[]) regions.elementAt(j);
\r
923 hideStart = region[0];
\r
924 hideEnd = region[1];
\r
925 // edit hidden regions to selection range
\r
926 if(hideStart<last) {
\r
927 if (hideEnd > last)
\r
940 if (hideStart>hideEnd)
\r
943 * form operations...
\r
945 if (last<hideStart)
\r
946 selection.addOperation(CigarArray.M, hideStart-last);
\r
947 selection.addOperation(CigarArray.D, 1+hideEnd-hideStart);
\r
950 // Final match if necessary.
\r
952 selection.addOperation(CigarArray.M, end-last+1);
\r
954 selection.addOperation(CigarArray.M, end-start+1);
\r
959 * return a compact representation of the current alignment selection to
\r
960 * pass to an analysis function
\r
961 * @param selectedOnly boolean true to just return the selected view
\r
962 * @return AlignmentView
\r
964 jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly) {
\r
966 // this is here because the AlignmentView constructor modifies the CigarArray
\r
967 // object. Refactoring of Cigar and alignment view representation should
\r
968 // be done to remove redundancy.
\r
969 CigarArray aligview = getViewAsCigars(selectedOnly);
\r
970 if (aligview!=null) {
\r
971 return new AlignmentView(aligview,
\r
972 (selectedOnly && selectionGroup!=null) ? selectionGroup.getStartRes() : 0);
\r
977 * This method returns the visible alignment as text, as
\r
978 * seen on the GUI, ie if columns are hidden they will not
\r
979 * be returned in the result.
\r
980 * Use this for calculating trees, PCA, redundancy etc on views
\r
981 * which contain hidden columns.
\r
984 public String [] getViewAsString(boolean selectedRegionOnly)
\r
986 String [] selection = null;
\r
987 SequenceI [] seqs= null;
\r
989 int start = 0, end = 0;
\r
990 if(selectedRegionOnly && selectionGroup!=null)
\r
992 iSize = selectionGroup.getSize(false);
\r
993 seqs = selectionGroup.getSequencesInOrder(alignment);
\r
994 start = selectionGroup.getStartRes();
\r
995 end = selectionGroup.getEndRes()+1;
\r
999 iSize = alignment.getHeight();
\r
1000 seqs = alignment.getSequencesArray();
\r
1001 end = alignment.getWidth();
\r
1004 selection = new String[iSize];
\r
1007 for(i=0; i<iSize; i++)
\r
1009 if (hasHiddenColumns)
\r
1011 StringBuffer visibleSeq = new StringBuffer();
\r
1012 Vector regions = colSel.getHiddenColumns();
\r
1014 int blockStart = start, blockEnd=end;
\r
1016 int hideStart, hideEnd;
\r
1018 for (int j = 0; j < regions.size(); j++)
\r
1020 region = (int[]) regions.elementAt(j);
\r
1021 hideStart = region[0];
\r
1022 hideEnd = region[1];
\r
1024 if(hideStart < start)
\r
1029 blockStart = Math.min(blockStart, hideEnd+1);
\r
1030 blockEnd = Math.min(blockEnd, hideStart);
\r
1032 if(blockStart>blockEnd)
\r
1038 visibleSeq.append(seqs[i].getSequence(blockStart, blockEnd));
\r
1040 blockStart = hideEnd+1;
\r
1044 if(end>blockStart)
\r
1045 visibleSeq.append(seqs[i].getSequence(blockStart, end));
\r
1047 selection[i] = visibleSeq.toString();
\r
1051 selection[i] = seqs[i].getSequence(start, end);
\r
1058 public boolean getShowHiddenMarkers()
\r
1060 return showHiddenMarkers;
\r
1063 public void setShowHiddenMarkers(boolean show)
\r
1065 showHiddenMarkers = show;
\r
1068 public Color getSequenceColour(SequenceI seq)
\r
1070 if (sequenceColours == null || !sequenceColours.containsKey(seq))
\r
1071 return Color.white;
\r
1073 return (Color) sequenceColours.get(seq);
\r
1076 public void setSequenceColour(SequenceI seq, Color col)
\r
1078 if (sequenceColours == null)
\r
1079 sequenceColours = new Hashtable();
\r
1082 sequenceColours.remove(seq);
\r
1084 sequenceColours.put(seq, col);
\r