2 * Jalview - A Sequence Alignment Editor and Viewer
3 * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 import jalview.analysis.*;
25 import jalview.datamodel.*;
27 import jalview.schemes.*;
40 public class AlignViewport
46 boolean showJVSuffix = true;
47 boolean showText = true;
48 boolean showColourText = false;
49 boolean showBoxes = true;
50 boolean wrapAlignment = false;
51 boolean renderGaps = true;
52 boolean showSequenceFeatures = false;
53 boolean showAnnotation = true;
54 boolean showConservation = true;
55 boolean showQuality = true;
56 boolean showIdentity = true;
57 boolean colourAppliesToAllGroups = true;
58 ColourSchemeI globalColourScheme = null;
59 boolean conservationColourSelected = false;
60 boolean abovePIDThreshold = false;
61 SequenceGroup selectionGroup;
64 boolean validCharWidth;
68 ColumnSelection colSel = new ColumnSelection();
71 NJTree currentTree = null;
72 boolean scaleAboveWrapped = false;
73 boolean scaleLeftWrapped = true;
74 boolean scaleRightWrapped = true;
75 boolean hasHiddenColumns = false;
76 boolean hasHiddenRows = false;
77 boolean showHiddenMarkers = true;
79 boolean cursorMode = false;
81 // The following vector holds the features which are
82 // currently visible, in the correct order or rendering
83 Hashtable featuresDisplayed = null;
87 public Hashtable [] hconsensus;
88 AlignmentAnnotation consensus;
89 AlignmentAnnotation conservation;
90 AlignmentAnnotation quality;
91 boolean autoCalculateConsensus = true;
94 public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!
96 // JBPNote Prolly only need this in the applet version.
97 private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(this);
99 boolean ignoreGapsInConsensusCalculation = false;
101 boolean isDataset = false;
103 boolean antiAlias = false;
105 boolean padGaps = false;
107 Rectangle explodedPosition;
111 String sequenceSetID;
113 boolean gatherViewsHere = false;
116 public AlignViewport(AlignmentI al, boolean dataset)
123 * Creates a new AlignViewport object.
125 * @param al DOCUMENT ME!
127 public AlignViewport(AlignmentI al)
133 * Create a new AlignViewport with hidden regions
134 * @param al AlignmentI
135 * @param hiddenColumns ColumnSelection
137 public AlignViewport(AlignmentI al, ColumnSelection hiddenColumns) {
139 if (hiddenColumns!=null) {
140 this.colSel = hiddenColumns;
141 if (hiddenColumns.getHiddenColumns() != null)
142 hasHiddenColumns = true;
150 this.endRes = alignment.getWidth() - 1;
152 this.endSeq = alignment.getHeight() - 1;
154 antiAlias = Cache.getDefault("ANTI_ALIAS", false);
156 showJVSuffix = Cache.getDefault("SHOW_JVSUFFIX", true);
157 showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true);
158 showConservation = Cache.getDefault("SHOW_CONSERVATION", true);
160 showQuality = Cache.getDefault("SHOW_QUALITY", true);
161 showIdentity = Cache.getDefault("SHOW_IDENTITY", true);
163 autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
165 padGaps = Cache.getDefault("PAD_GAPS", false);
167 String fontName = Cache.getDefault("FONT_NAME", "SansSerif");
168 String fontStyle = Cache.getDefault("FONT_STYLE", Font.PLAIN + "") ;
169 String fontSize = Cache.getDefault("FONT_SIZE", "10");
173 if (fontStyle.equals("bold"))
177 else if (fontStyle.equals("italic"))
182 setFont(new Font(fontName, style, Integer.parseInt(fontSize)));
185 alignment.setGapCharacter( Cache.getDefault("GAP_SYMBOL", "-").charAt(0) );
188 // We must set conservation and consensus before setting colour,
189 // as Blosum and Clustal require this to be done
190 if(hconsensus==null && !isDataset)
192 if(!alignment.isNucleotide())
194 conservation = new AlignmentAnnotation("Conservation",
195 "Conservation of total alignment less than " +
196 ConsPercGaps + "% gaps",
197 new Annotation[1], 0f,
199 AlignmentAnnotation.BAR_GRAPH);
200 conservation.hasText = true;
202 if (showConservation)
204 alignment.addAnnotation(conservation);
209 quality = new AlignmentAnnotation("Quality",
210 "Alignment Quality based on Blosum62 scores",
214 AlignmentAnnotation.BAR_GRAPH);
215 quality.hasText = true;
217 alignment.addAnnotation(quality);
221 consensus = new AlignmentAnnotation("Consensus", "PID",
222 new Annotation[1], 0f, 100f,
223 AlignmentAnnotation.BAR_GRAPH);
224 consensus.hasText = true;
228 alignment.addAnnotation(consensus);
233 if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
235 globalColourScheme = ColourSchemeProperty.getColour(alignment,
236 jalview.bin.Cache.getProperty("DEFAULT_COLOUR"));
238 if (globalColourScheme instanceof UserColourScheme)
240 globalColourScheme = UserDefinedColours.loadDefaultColours();
241 ((UserColourScheme)globalColourScheme).setThreshold(0, getIgnoreGapsConsensus());
244 if (globalColourScheme != null)
246 globalColourScheme.setConsensus(hconsensus);
256 * @param b DOCUMENT ME!
258 public void setShowSequenceFeatures(boolean b)
260 showSequenceFeatures = b;
263 public boolean getShowSequenceFeatures()
265 return showSequenceFeatures;
270 class ConservationThread extends Thread
273 public ConservationThread(AlignmentPanel ap)
282 int alWidth = alignment.getWidth();
284 Conservation cons = new jalview.analysis.Conservation("All",
285 jalview.schemes.ResidueProperties.propHash, 3,
286 alignment.getSequences(), 0, alWidth -1);
289 cons.verdict(false, ConsPercGaps);
297 String sequence = cons.getConsSequence().getSequence();
309 maxB = 0f - minB; // scalable range for colouring both Conservation and Quality
318 conservation.annotations = new Annotation[alWidth];
322 quality.graphMax = cons.qualityRange[1].floatValue();
323 quality.annotations = new Annotation[alWidth];
324 qmin = cons.qualityRange[0].floatValue();
325 qmax = cons.qualityRange[1].floatValue();
328 for (int i = 0; i < alWidth; i++)
332 c = sequence.charAt(i);
334 if (Character.isDigit(c))
335 value = (int) (c - '0');
341 float vprop = value - min;
343 conservation.annotations[i] =
344 new Annotation(String.valueOf(c),
345 String.valueOf(value), ' ', value,
346 new Color(minR + (maxR * vprop),
347 minG + (maxG * vprop),
348 minB + (maxB * vprop)));
353 value = ( (Double) cons.quality.get(i)).floatValue();
354 vprop = value - qmin;
356 quality.annotations[i] = new Annotation(" ", String.valueOf(value), ' ',
358 new Color(minR + (maxR * vprop),
359 minG + (maxG * vprop),
360 minB + (maxB * vprop)));
364 catch (OutOfMemoryError error)
366 javax.swing.SwingUtilities.invokeLater(new Runnable()
370 javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,
371 "Out of memory calculating conservation!!"
373 "\nSee help files for increasing Java Virtual Machine memory."
375 javax.swing.JOptionPane.WARNING_MESSAGE);
379 System.out.println("Conservation calculation: " + error);
388 updatingConservation = false;
393 ConservationThread conservationThread;
395 ConsensusThread consensusThread;
397 boolean consUpdateNeeded = false;
399 boolean updatingConsensus = false;
401 boolean updatingConservation = false;
406 public void updateConservation(AlignmentPanel ap)
408 if (alignment.isNucleotide())
411 updatingConservation = true;
413 if (conservationThread == null || !conservationThread.isAlive())
415 conservationThread = new ConservationThread(ap);
416 conservationThread.start();
420 consUpdateNeeded = true;
421 System.out.println("come back later");
428 public void updateConsensus(AlignmentPanel ap)
430 updatingConsensus = true;
432 if (consensusThread == null || !consensusThread.isAlive())
434 consensusThread = new ConsensusThread(ap);
435 consensusThread.start();
439 consUpdateNeeded = true;
440 System.out.println("come back later");
445 class ConsensusThread extends Thread
448 public ConsensusThread(AlignmentPanel ap)
456 int aWidth = alignment.getWidth();
458 consensus.annotations = null;
459 consensus.annotations = new Annotation[aWidth];
462 hconsensus = new Hashtable[aWidth];
463 AAFrequency.calculate(alignment.getSequencesArray(),
465 alignment.getWidth(),
468 for (int i = 0; i < aWidth; i++)
471 if (ignoreGapsInConsensusCalculation)
472 value = ( (Float) hconsensus[i].get(AAFrequency.PID_NOGAPS)).
475 value = ( (Float) hconsensus[i].get(AAFrequency.PID_GAPS)).
478 String maxRes = hconsensus[i].get(AAFrequency.MAXRESIDUE).toString();
479 String mouseOver = hconsensus[i].get(AAFrequency.MAXRESIDUE) + " ";
481 if (maxRes.length() > 1)
483 mouseOver = "[" + maxRes + "] ";
487 mouseOver += ( (int) value + "%");
488 consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ', value);
492 if (globalColourScheme != null)
493 globalColourScheme.setConsensus(hconsensus);
496 catch (OutOfMemoryError error)
498 javax.swing.SwingUtilities.invokeLater(new Runnable()
502 javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,
503 "Out of memory calculating consensus!!"
505 "\nSee help files for increasing Java Virtual Machine memory."
507 javax.swing.JOptionPane.WARNING_MESSAGE);
511 System.out.println("Consensus calculation: " + error);
521 updatingConsensus = false;
525 * get the consensus sequence as displayed under the PID consensus annotation row.
526 * @return consensus sequence as a new sequence object
528 public SequenceI getConsensusSeq() {
530 updateConsensus(null);
533 StringBuffer seqs=new StringBuffer();
534 for (int i=0; i<consensus.annotations.length; i++) {
535 if (consensus.annotations[i]!=null) {
536 if (consensus.annotations[i].description.charAt(0) == '[')
537 seqs.append(consensus.annotations[i].description.charAt(1));
539 seqs.append(consensus.annotations[i].displayCharacter);
542 SequenceI sq = new Sequence("Consensus", seqs.toString());
543 sq.setDescription("Percentage Identity Consensus "+((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
549 * @return DOCUMENT ME!
551 public SequenceGroup getSelectionGroup()
553 return selectionGroup;
559 * @param sg DOCUMENT ME!
561 public void setSelectionGroup(SequenceGroup sg)
569 * @return DOCUMENT ME!
571 public boolean getConservationSelected()
573 return conservationColourSelected;
579 * @param b DOCUMENT ME!
581 public void setConservationSelected(boolean b)
583 conservationColourSelected = b;
589 * @return DOCUMENT ME!
591 public boolean getAbovePIDThreshold()
593 return abovePIDThreshold;
599 * @param b DOCUMENT ME!
601 public void setAbovePIDThreshold(boolean b)
603 abovePIDThreshold = b;
609 * @return DOCUMENT ME!
611 public int getStartRes()
619 * @return DOCUMENT ME!
621 public int getEndRes()
629 * @return DOCUMENT ME!
631 public int getStartSeq()
639 * @param cs DOCUMENT ME!
641 public void setGlobalColourScheme(ColourSchemeI cs)
643 globalColourScheme = cs;
649 * @return DOCUMENT ME!
651 public ColourSchemeI getGlobalColourScheme()
653 return globalColourScheme;
659 * @param res DOCUMENT ME!
661 public void setStartRes(int res)
669 * @param seq DOCUMENT ME!
671 public void setStartSeq(int seq)
679 * @param res DOCUMENT ME!
681 public void setEndRes(int res)
683 if (res > (alignment.getWidth() - 1))
685 // log.System.out.println(" Corrected res from " + res + " to maximum " + (alignment.getWidth()-1));
686 res = alignment.getWidth() - 1;
700 * @param seq DOCUMENT ME!
702 public void setEndSeq(int seq)
704 if (seq > alignment.getHeight())
706 seq = alignment.getHeight();
720 * @return DOCUMENT ME!
722 public int getEndSeq()
730 * @param f DOCUMENT ME!
732 public void setFont(Font f)
736 Container c = new Container();
738 java.awt.FontMetrics fm = c.getFontMetrics(font);
739 setCharHeight(fm.getHeight());
740 setCharWidth(fm.charWidth('M'));
741 validCharWidth = true;
747 * @return DOCUMENT ME!
749 public Font getFont()
757 * @param w DOCUMENT ME!
759 public void setCharWidth(int w)
767 * @return DOCUMENT ME!
769 public int getCharWidth()
777 * @param h DOCUMENT ME!
779 public void setCharHeight(int h)
787 * @return DOCUMENT ME!
789 public int getCharHeight()
797 * @param w DOCUMENT ME!
799 public void setWrappedWidth(int w)
801 this.wrappedWidth = w;
807 * @return DOCUMENT ME!
809 public int getWrappedWidth()
818 * @return DOCUMENT ME!
820 public AlignmentI getAlignment()
828 * @param align DOCUMENT ME!
830 public void setAlignment(AlignmentI align)
832 this.alignment = align;
838 * @param state DOCUMENT ME!
840 public void setWrapAlignment(boolean state)
842 wrapAlignment = state;
848 * @param state DOCUMENT ME!
850 public void setShowText(boolean state)
858 * @param state DOCUMENT ME!
860 public void setRenderGaps(boolean state)
868 * @return DOCUMENT ME!
870 public boolean getColourText()
872 return showColourText;
878 * @param state DOCUMENT ME!
880 public void setColourText(boolean state)
882 showColourText = state;
888 * @param state DOCUMENT ME!
890 public void setShowBoxes(boolean state)
898 * @return DOCUMENT ME!
900 public boolean getWrapAlignment()
902 return wrapAlignment;
908 * @return DOCUMENT ME!
910 public boolean getShowText()
918 * @return DOCUMENT ME!
920 public boolean getShowBoxes()
928 * @return DOCUMENT ME!
930 public char getGapCharacter()
932 return getAlignment().getGapCharacter();
938 * @param gap DOCUMENT ME!
940 public void setGapCharacter(char gap)
942 if (getAlignment() != null)
944 getAlignment().setGapCharacter(gap);
951 * @param thresh DOCUMENT ME!
953 public void setThreshold(int thresh)
961 * @return DOCUMENT ME!
963 public int getThreshold()
971 * @param inc DOCUMENT ME!
973 public void setIncrement(int inc)
981 * @return DOCUMENT ME!
983 public int getIncrement()
992 * @return DOCUMENT ME!
994 public ColumnSelection getColumnSelection()
1003 * @param tree DOCUMENT ME!
1005 public void setCurrentTree(NJTree tree)
1013 * @return DOCUMENT ME!
1015 public NJTree getCurrentTree()
1023 * @param b DOCUMENT ME!
1025 public void setColourAppliesToAllGroups(boolean b)
1027 colourAppliesToAllGroups = b;
1033 * @return DOCUMENT ME!
1035 public boolean getColourAppliesToAllGroups()
1037 return colourAppliesToAllGroups;
1043 * @return DOCUMENT ME!
1045 public boolean getShowJVSuffix()
1047 return showJVSuffix;
1053 * @param b DOCUMENT ME!
1055 public void setShowJVSuffix(boolean b)
1064 * @return DOCUMENT ME!
1066 public boolean getShowAnnotation()
1068 return showAnnotation;
1074 * @param b DOCUMENT ME!
1076 public void setShowAnnotation(boolean b)
1084 * @return DOCUMENT ME!
1086 public boolean getScaleAboveWrapped()
1088 return scaleAboveWrapped;
1094 * @return DOCUMENT ME!
1096 public boolean getScaleLeftWrapped()
1098 return scaleLeftWrapped;
1104 * @return DOCUMENT ME!
1106 public boolean getScaleRightWrapped()
1108 return scaleRightWrapped;
1114 * @param b DOCUMENT ME!
1116 public void setScaleAboveWrapped(boolean b)
1118 scaleAboveWrapped = b;
1124 * @param b DOCUMENT ME!
1126 public void setScaleLeftWrapped(boolean b)
1128 scaleLeftWrapped = b;
1134 * @param b DOCUMENT ME!
1136 public void setScaleRightWrapped(boolean b)
1138 scaleRightWrapped = b;
1142 * Property change listener for changes in alignment
1144 * @param listener DOCUMENT ME!
1146 public void addPropertyChangeListener(
1147 java.beans.PropertyChangeListener listener)
1149 changeSupport.addPropertyChangeListener(listener);
1155 * @param listener DOCUMENT ME!
1157 public void removePropertyChangeListener(
1158 java.beans.PropertyChangeListener listener)
1160 changeSupport.removePropertyChangeListener(listener);
1164 * Property change listener for changes in alignment
1166 * @param prop DOCUMENT ME!
1167 * @param oldvalue DOCUMENT ME!
1168 * @param newvalue DOCUMENT ME!
1170 public void firePropertyChange(String prop, Object oldvalue, Object newvalue)
1172 changeSupport.firePropertyChange(prop, oldvalue, newvalue);
1175 public void setIgnoreGapsConsensus(boolean b, AlignmentPanel ap)
1177 ignoreGapsInConsensusCalculation = b;
1178 updateConsensus(ap);
1179 if(globalColourScheme!=null)
1181 globalColourScheme.setThreshold(globalColourScheme.getThreshold(), ignoreGapsInConsensusCalculation);
1185 public boolean getIgnoreGapsConsensus()
1187 return ignoreGapsInConsensusCalculation;
1190 public void setDataset(boolean b)
1195 public boolean isDataset()
1201 public void hideSelectedColumns()
1203 if (colSel.size() < 1)
1206 colSel.hideSelectedColumns();
1207 setSelectionGroup(null);
1209 hasHiddenColumns = true;
1213 public void hideColumns(int start, int end)
1216 colSel.hideColumns(start);
1218 colSel.hideColumns(start, end);
1220 hasHiddenColumns = true;
1223 public void hideAllSelectedSeqs()
1225 if (selectionGroup == null)
1228 SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
1232 setSelectionGroup(null);
1235 public void hideSequence(SequenceI [] seq)
1239 for (int i = 0; i < seq.length; i++)
1240 alignment.getHiddenSequences().hideSequence(seq[i]);
1242 hasHiddenRows = true;
1243 firePropertyChange("alignment", null, alignment.getSequences());
1247 public void showSequence(int index)
1249 Vector tmp = alignment.getHiddenSequences().showSequence(index);
1252 if(selectionGroup==null)
1254 selectionGroup = new SequenceGroup();
1255 selectionGroup.setEndRes(alignment.getWidth()-1);
1258 for (int t = 0; t < tmp.size(); t++)
1260 selectionGroup.addSequence(
1261 (SequenceI) tmp.elementAt(t), false
1264 firePropertyChange("alignment", null, alignment.getSequences());
1267 if(alignment.getHiddenSequences().getSize()<1)
1268 hasHiddenRows = false;
1271 public void showColumn(int col)
1273 colSel.revealHiddenColumns(col);
1274 if(colSel.getHiddenColumns()==null)
1275 hasHiddenColumns = false;
1278 public void showAllHiddenColumns()
1280 colSel.revealAllHiddenColumns();
1281 hasHiddenColumns = false;
1284 public void showAllHiddenSeqs()
1286 if(alignment.getHiddenSequences().getSize()>0)
1288 if(selectionGroup==null)
1290 selectionGroup = new SequenceGroup();
1291 selectionGroup.setEndRes(alignment.getWidth()-1);
1293 Vector tmp = alignment.getHiddenSequences().showAll();
1294 for(int t=0; t<tmp.size(); t++)
1296 selectionGroup.addSequence(
1297 (SequenceI)tmp.elementAt(t), false
1300 firePropertyChange("alignment", null, alignment.getSequences());
1301 hasHiddenRows = false;
1305 public void invertColumnSelection()
1308 for(int i=0; i<alignment.getWidth(); i++)
1312 if(colSel.contains(column))
1313 colSel.removeElement(column);
1315 colSel.addElement(column);
1321 public int adjustForHiddenSeqs(int alignmentIndex)
1323 return alignment.getHiddenSequences().adjustForHiddenSeqs(alignmentIndex);
1327 * This method returns the a new SequenceI [] with
1328 * the selection sequence and start and end points adjusted
1331 public SequenceI[] getSelectionAsNewSequence()
1333 SequenceI[] sequences;
1335 if (selectionGroup == null)
1336 sequences = alignment.getSequencesArray();
1338 sequences = selectionGroup.getSelectionAsNewSequences(alignment);
1344 * This method returns the visible alignment as text, as
1345 * seen on the GUI, ie if columns are hidden they will not
1346 * be returned in the result.
1347 * Use this for calculating trees, PCA, redundancy etc on views
1348 * which contain hidden columns.
1351 public jalview.datamodel.CigarArray getViewAsCigars(boolean selectedRegionOnly)
1353 CigarArray selection=null;
1354 SequenceI [] seqs= null;
1356 int start = 0, end = 0;
1357 if(selectedRegionOnly && selectionGroup!=null)
1359 iSize = selectionGroup.getSize(false);
1360 seqs = selectionGroup.getSequencesInOrder(alignment);
1361 start = selectionGroup.getStartRes();
1362 end = selectionGroup.getEndRes(); // inclusive for start and end in SeqCigar constructor
1366 iSize = alignment.getHeight();
1367 seqs = alignment.getSequencesArray();
1368 end = alignment.getWidth()-1;
1370 SeqCigar[] selseqs = new SeqCigar[iSize];
1371 for(i=0; i<iSize; i++)
1373 selseqs[i] = new SeqCigar(seqs[i], start, end);
1375 selection=new CigarArray(selseqs);
1376 // now construct the CigarArray operations
1377 if (hasHiddenColumns) {
1378 Vector regions = colSel.getHiddenColumns();
1380 int hideStart, hideEnd;
1382 for (int j = 0; last<end & j < regions.size(); j++)
1384 region = (int[]) regions.elementAt(j);
1385 hideStart = region[0];
1386 hideEnd = region[1];
1387 // edit hidden regions to selection range
1388 if(hideStart<last) {
1402 if (hideStart>hideEnd)
1405 * form operations...
1408 selection.addOperation(CigarArray.M, hideStart-last);
1409 selection.addOperation(CigarArray.D, 1+hideEnd-hideStart);
1412 // Final match if necessary.
1414 selection.addOperation(CigarArray.M, end-last+1);
1416 selection.addOperation(CigarArray.M, end-start+1);
1421 * return a compact representation of the current alignment selection to
1422 * pass to an analysis function
1423 * @param selectedOnly boolean true to just return the selected view
1424 * @return AlignmentView
1426 jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly) {
1428 // this is here because the AlignmentView constructor modifies the CigarArray
1429 // object. Refactoring of Cigar and alignment view representation should
1430 // be done to remove redundancy.
1431 CigarArray aligview = getViewAsCigars(selectedOnly);
1432 if (aligview!=null) {
1433 return new AlignmentView(aligview,
1434 (selectedOnly && selectionGroup!=null) ? selectionGroup.getStartRes() : 0);
1439 * This method returns the visible alignment as text, as
1440 * seen on the GUI, ie if columns are hidden they will not
1441 * be returned in the result.
1442 * Use this for calculating trees, PCA, redundancy etc on views
1443 * which contain hidden columns.
1446 public String [] getViewAsString(boolean selectedRegionOnly)
1448 String [] selection = null;
1449 SequenceI [] seqs= null;
1451 int start = 0, end = 0;
1452 if(selectedRegionOnly && selectionGroup!=null)
1454 iSize = selectionGroup.getSize(false);
1455 seqs = selectionGroup.getSequencesInOrder(alignment);
1456 start = selectionGroup.getStartRes();
1457 end = selectionGroup.getEndRes()+1;
1461 iSize = alignment.getHeight();
1462 seqs = alignment.getSequencesArray();
1463 end = alignment.getWidth();
1466 selection = new String[iSize];
1467 if (hasHiddenColumns) {
1468 selection = colSel.getVisibleSequenceStrings(start, end, seqs);
1470 for(i=0; i<iSize; i++)
1472 selection[i] = seqs[i].getSequence(start, end);
1479 public boolean getShowHiddenMarkers()
1481 return showHiddenMarkers;
1484 public void setShowHiddenMarkers(boolean show)
1486 showHiddenMarkers = show;
1489 public String getSequenceSetId()
1491 if(sequenceSetID==null)
1492 sequenceSetID = alignment.hashCode()+"";
1494 return sequenceSetID;