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()
372 javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,
373 "Out of memory calculating conservation!!"
375 "\nSee help files for increasing Java Virtual Machine memory."
377 javax.swing.JOptionPane.WARNING_MESSAGE);
384 System.out.println("Conservation calculation: " + error);
393 updatingConservation = false;
398 ConservationThread conservationThread;
400 ConsensusThread consensusThread;
402 boolean consUpdateNeeded = false;
404 boolean updatingConsensus = false;
406 boolean updatingConservation = false;
411 public void updateConservation(AlignmentPanel ap)
413 if (alignment.isNucleotide())
416 updatingConservation = true;
418 if (conservationThread == null || !conservationThread.isAlive())
420 conservationThread = new ConservationThread(ap);
421 conservationThread.start();
425 consUpdateNeeded = true;
426 System.out.println("come back later");
433 public void updateConsensus(AlignmentPanel ap)
435 updatingConsensus = true;
437 if (consensusThread == null || !consensusThread.isAlive())
439 consensusThread = new ConsensusThread(ap);
440 consensusThread.start();
444 consUpdateNeeded = true;
445 System.out.println("come back later");
450 class ConsensusThread extends Thread
453 public ConsensusThread(AlignmentPanel ap)
461 int aWidth = alignment.getWidth();
463 consensus.annotations = null;
464 consensus.annotations = new Annotation[aWidth];
467 hconsensus = new Hashtable[aWidth];
468 AAFrequency.calculate(alignment.getSequencesArray(),
470 alignment.getWidth(),
473 for (int i = 0; i < aWidth; i++)
476 if (ignoreGapsInConsensusCalculation)
477 value = ( (Float) hconsensus[i].get(AAFrequency.PID_NOGAPS)).
480 value = ( (Float) hconsensus[i].get(AAFrequency.PID_GAPS)).
483 String maxRes = hconsensus[i].get(AAFrequency.MAXRESIDUE).toString();
484 String mouseOver = hconsensus[i].get(AAFrequency.MAXRESIDUE) + " ";
486 if (maxRes.length() > 1)
488 mouseOver = "[" + maxRes + "] ";
492 mouseOver += ( (int) value + "%");
493 consensus.annotations[i] = new Annotation(maxRes, mouseOver, ' ', value);
497 if (globalColourScheme != null)
498 globalColourScheme.setConsensus(hconsensus);
501 catch (OutOfMemoryError error)
503 javax.swing.SwingUtilities.invokeLater(new Runnable()
507 javax.swing.JOptionPane.showInternalMessageDialog(Desktop.desktop,
508 "Out of memory calculating consensus!!"
510 "\nSee help files for increasing Java Virtual Machine memory."
512 javax.swing.JOptionPane.WARNING_MESSAGE);
516 System.out.println("Consensus calculation: " + error);
526 updatingConsensus = false;
530 * get the consensus sequence as displayed under the PID consensus annotation row.
531 * @return consensus sequence as a new sequence object
533 public SequenceI getConsensusSeq() {
535 updateConsensus(null);
538 StringBuffer seqs=new StringBuffer();
539 for (int i=0; i<consensus.annotations.length; i++) {
540 if (consensus.annotations[i]!=null) {
541 if (consensus.annotations[i].description.charAt(0) == '[')
542 seqs.append(consensus.annotations[i].description.charAt(1));
544 seqs.append(consensus.annotations[i].displayCharacter);
547 SequenceI sq = new Sequence("Consensus", seqs.toString());
548 sq.setDescription("Percentage Identity Consensus "+((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
554 * @return DOCUMENT ME!
556 public SequenceGroup getSelectionGroup()
558 return selectionGroup;
564 * @param sg DOCUMENT ME!
566 public void setSelectionGroup(SequenceGroup sg)
574 * @return DOCUMENT ME!
576 public boolean getConservationSelected()
578 return conservationColourSelected;
584 * @param b DOCUMENT ME!
586 public void setConservationSelected(boolean b)
588 conservationColourSelected = b;
594 * @return DOCUMENT ME!
596 public boolean getAbovePIDThreshold()
598 return abovePIDThreshold;
604 * @param b DOCUMENT ME!
606 public void setAbovePIDThreshold(boolean b)
608 abovePIDThreshold = b;
614 * @return DOCUMENT ME!
616 public int getStartRes()
624 * @return DOCUMENT ME!
626 public int getEndRes()
634 * @return DOCUMENT ME!
636 public int getStartSeq()
644 * @param cs DOCUMENT ME!
646 public void setGlobalColourScheme(ColourSchemeI cs)
648 globalColourScheme = cs;
654 * @return DOCUMENT ME!
656 public ColourSchemeI getGlobalColourScheme()
658 return globalColourScheme;
664 * @param res DOCUMENT ME!
666 public void setStartRes(int res)
674 * @param seq DOCUMENT ME!
676 public void setStartSeq(int seq)
684 * @param res DOCUMENT ME!
686 public void setEndRes(int res)
688 if (res > (alignment.getWidth() - 1))
690 // log.System.out.println(" Corrected res from " + res + " to maximum " + (alignment.getWidth()-1));
691 res = alignment.getWidth() - 1;
705 * @param seq DOCUMENT ME!
707 public void setEndSeq(int seq)
709 if (seq > alignment.getHeight())
711 seq = alignment.getHeight();
725 * @return DOCUMENT ME!
727 public int getEndSeq()
735 * @param f DOCUMENT ME!
737 public void setFont(Font f)
741 Container c = new Container();
743 java.awt.FontMetrics fm = c.getFontMetrics(font);
744 setCharHeight(fm.getHeight());
745 setCharWidth(fm.charWidth('M'));
746 validCharWidth = true;
752 * @return DOCUMENT ME!
754 public Font getFont()
762 * @param w DOCUMENT ME!
764 public void setCharWidth(int w)
772 * @return DOCUMENT ME!
774 public int getCharWidth()
782 * @param h DOCUMENT ME!
784 public void setCharHeight(int h)
792 * @return DOCUMENT ME!
794 public int getCharHeight()
802 * @param w DOCUMENT ME!
804 public void setWrappedWidth(int w)
806 this.wrappedWidth = w;
812 * @return DOCUMENT ME!
814 public int getWrappedWidth()
823 * @return DOCUMENT ME!
825 public AlignmentI getAlignment()
833 * @param align DOCUMENT ME!
835 public void setAlignment(AlignmentI align)
837 this.alignment = align;
843 * @param state DOCUMENT ME!
845 public void setWrapAlignment(boolean state)
847 wrapAlignment = state;
853 * @param state DOCUMENT ME!
855 public void setShowText(boolean state)
863 * @param state DOCUMENT ME!
865 public void setRenderGaps(boolean state)
873 * @return DOCUMENT ME!
875 public boolean getColourText()
877 return showColourText;
883 * @param state DOCUMENT ME!
885 public void setColourText(boolean state)
887 showColourText = state;
893 * @param state DOCUMENT ME!
895 public void setShowBoxes(boolean state)
903 * @return DOCUMENT ME!
905 public boolean getWrapAlignment()
907 return wrapAlignment;
913 * @return DOCUMENT ME!
915 public boolean getShowText()
923 * @return DOCUMENT ME!
925 public boolean getShowBoxes()
933 * @return DOCUMENT ME!
935 public char getGapCharacter()
937 return getAlignment().getGapCharacter();
943 * @param gap DOCUMENT ME!
945 public void setGapCharacter(char gap)
947 if (getAlignment() != null)
949 getAlignment().setGapCharacter(gap);
956 * @param thresh DOCUMENT ME!
958 public void setThreshold(int thresh)
966 * @return DOCUMENT ME!
968 public int getThreshold()
976 * @param inc DOCUMENT ME!
978 public void setIncrement(int inc)
986 * @return DOCUMENT ME!
988 public int getIncrement()
997 * @return DOCUMENT ME!
999 public ColumnSelection getColumnSelection()
1008 * @param tree DOCUMENT ME!
1010 public void setCurrentTree(NJTree tree)
1018 * @return DOCUMENT ME!
1020 public NJTree getCurrentTree()
1028 * @param b DOCUMENT ME!
1030 public void setColourAppliesToAllGroups(boolean b)
1032 colourAppliesToAllGroups = b;
1038 * @return DOCUMENT ME!
1040 public boolean getColourAppliesToAllGroups()
1042 return colourAppliesToAllGroups;
1048 * @return DOCUMENT ME!
1050 public boolean getShowJVSuffix()
1052 return showJVSuffix;
1058 * @param b DOCUMENT ME!
1060 public void setShowJVSuffix(boolean b)
1069 * @return DOCUMENT ME!
1071 public boolean getShowAnnotation()
1073 return showAnnotation;
1079 * @param b DOCUMENT ME!
1081 public void setShowAnnotation(boolean b)
1089 * @return DOCUMENT ME!
1091 public boolean getScaleAboveWrapped()
1093 return scaleAboveWrapped;
1099 * @return DOCUMENT ME!
1101 public boolean getScaleLeftWrapped()
1103 return scaleLeftWrapped;
1109 * @return DOCUMENT ME!
1111 public boolean getScaleRightWrapped()
1113 return scaleRightWrapped;
1119 * @param b DOCUMENT ME!
1121 public void setScaleAboveWrapped(boolean b)
1123 scaleAboveWrapped = b;
1129 * @param b DOCUMENT ME!
1131 public void setScaleLeftWrapped(boolean b)
1133 scaleLeftWrapped = b;
1139 * @param b DOCUMENT ME!
1141 public void setScaleRightWrapped(boolean b)
1143 scaleRightWrapped = b;
1147 * Property change listener for changes in alignment
1149 * @param listener DOCUMENT ME!
1151 public void addPropertyChangeListener(
1152 java.beans.PropertyChangeListener listener)
1154 changeSupport.addPropertyChangeListener(listener);
1160 * @param listener DOCUMENT ME!
1162 public void removePropertyChangeListener(
1163 java.beans.PropertyChangeListener listener)
1165 changeSupport.removePropertyChangeListener(listener);
1169 * Property change listener for changes in alignment
1171 * @param prop DOCUMENT ME!
1172 * @param oldvalue DOCUMENT ME!
1173 * @param newvalue DOCUMENT ME!
1175 public void firePropertyChange(String prop, Object oldvalue, Object newvalue)
1177 changeSupport.firePropertyChange(prop, oldvalue, newvalue);
1180 public void setIgnoreGapsConsensus(boolean b, AlignmentPanel ap)
1182 ignoreGapsInConsensusCalculation = b;
1183 updateConsensus(ap);
1184 if(globalColourScheme!=null)
1186 globalColourScheme.setThreshold(globalColourScheme.getThreshold(), ignoreGapsInConsensusCalculation);
1190 public boolean getIgnoreGapsConsensus()
1192 return ignoreGapsInConsensusCalculation;
1195 public void setDataset(boolean b)
1200 public boolean isDataset()
1206 public void hideSelectedColumns()
1208 if (colSel.size() < 1)
1211 colSel.hideSelectedColumns();
1212 setSelectionGroup(null);
1214 hasHiddenColumns = true;
1218 public void hideColumns(int start, int end)
1221 colSel.hideColumns(start);
1223 colSel.hideColumns(start, end);
1225 hasHiddenColumns = true;
1228 public void hideAllSelectedSeqs()
1230 if (selectionGroup == null)
1233 SequenceI[] seqs = selectionGroup.getSequencesInOrder(alignment);
1237 setSelectionGroup(null);
1240 public void hideSequence(SequenceI [] seq)
1244 for (int i = 0; i < seq.length; i++)
1245 alignment.getHiddenSequences().hideSequence(seq[i]);
1247 hasHiddenRows = true;
1248 firePropertyChange("alignment", null, alignment.getSequences());
1252 public void showSequence(int index)
1254 Vector tmp = alignment.getHiddenSequences().showSequence(index);
1257 if(selectionGroup==null)
1259 selectionGroup = new SequenceGroup();
1260 selectionGroup.setEndRes(alignment.getWidth()-1);
1263 for (int t = 0; t < tmp.size(); t++)
1265 selectionGroup.addSequence(
1266 (SequenceI) tmp.elementAt(t), false
1269 firePropertyChange("alignment", null, alignment.getSequences());
1272 if(alignment.getHiddenSequences().getSize()<1)
1273 hasHiddenRows = false;
1276 public void showColumn(int col)
1278 colSel.revealHiddenColumns(col);
1279 if(colSel.getHiddenColumns()==null)
1280 hasHiddenColumns = false;
1283 public void showAllHiddenColumns()
1285 colSel.revealAllHiddenColumns();
1286 hasHiddenColumns = false;
1289 public void showAllHiddenSeqs()
1291 if(alignment.getHiddenSequences().getSize()>0)
1293 if(selectionGroup==null)
1295 selectionGroup = new SequenceGroup();
1296 selectionGroup.setEndRes(alignment.getWidth()-1);
1298 Vector tmp = alignment.getHiddenSequences().showAll();
1299 for(int t=0; t<tmp.size(); t++)
1301 selectionGroup.addSequence(
1302 (SequenceI)tmp.elementAt(t), false
1305 firePropertyChange("alignment", null, alignment.getSequences());
1306 hasHiddenRows = false;
1310 public void invertColumnSelection()
1313 for(int i=0; i<alignment.getWidth(); i++)
1317 if(colSel.contains(column))
1318 colSel.removeElement(column);
1320 colSel.addElement(column);
1326 public int adjustForHiddenSeqs(int alignmentIndex)
1328 return alignment.getHiddenSequences().adjustForHiddenSeqs(alignmentIndex);
1332 * This method returns the a new SequenceI [] with
1333 * the selection sequence and start and end points adjusted
1336 public SequenceI[] getSelectionAsNewSequence()
1338 SequenceI[] sequences;
1340 if (selectionGroup == null)
1341 sequences = alignment.getSequencesArray();
1343 sequences = selectionGroup.getSelectionAsNewSequences(alignment);
1349 * This method returns the visible alignment as text, as
1350 * seen on the GUI, ie if columns are hidden they will not
1351 * be returned in the result.
1352 * Use this for calculating trees, PCA, redundancy etc on views
1353 * which contain hidden columns.
1356 public jalview.datamodel.CigarArray getViewAsCigars(boolean selectedRegionOnly)
1358 CigarArray selection=null;
1359 SequenceI [] seqs= null;
1361 int start = 0, end = 0;
1362 if(selectedRegionOnly && selectionGroup!=null)
1364 iSize = selectionGroup.getSize(false);
1365 seqs = selectionGroup.getSequencesInOrder(alignment);
1366 start = selectionGroup.getStartRes();
1367 end = selectionGroup.getEndRes(); // inclusive for start and end in SeqCigar constructor
1371 iSize = alignment.getHeight();
1372 seqs = alignment.getSequencesArray();
1373 end = alignment.getWidth()-1;
1375 SeqCigar[] selseqs = new SeqCigar[iSize];
1376 for(i=0; i<iSize; i++)
1378 selseqs[i] = new SeqCigar(seqs[i], start, end);
1380 selection=new CigarArray(selseqs);
1381 // now construct the CigarArray operations
1382 if (hasHiddenColumns) {
1383 Vector regions = colSel.getHiddenColumns();
1385 int hideStart, hideEnd;
1387 for (int j = 0; last<end & j < regions.size(); j++)
1389 region = (int[]) regions.elementAt(j);
1390 hideStart = region[0];
1391 hideEnd = region[1];
1392 // edit hidden regions to selection range
1393 if(hideStart<last) {
1407 if (hideStart>hideEnd)
1410 * form operations...
1413 selection.addOperation(CigarArray.M, hideStart-last);
1414 selection.addOperation(CigarArray.D, 1+hideEnd-hideStart);
1417 // Final match if necessary.
1419 selection.addOperation(CigarArray.M, end-last+1);
1421 selection.addOperation(CigarArray.M, end-start+1);
1426 * return a compact representation of the current alignment selection to
1427 * pass to an analysis function
1428 * @param selectedOnly boolean true to just return the selected view
1429 * @return AlignmentView
1431 jalview.datamodel.AlignmentView getAlignmentView(boolean selectedOnly) {
1433 // this is here because the AlignmentView constructor modifies the CigarArray
1434 // object. Refactoring of Cigar and alignment view representation should
1435 // be done to remove redundancy.
1436 CigarArray aligview = getViewAsCigars(selectedOnly);
1437 if (aligview!=null) {
1438 return new AlignmentView(aligview,
1439 (selectedOnly && selectionGroup!=null) ? selectionGroup.getStartRes() : 0);
1444 * This method returns the visible alignment as text, as
1445 * seen on the GUI, ie if columns are hidden they will not
1446 * be returned in the result.
1447 * Use this for calculating trees, PCA, redundancy etc on views
1448 * which contain hidden columns.
1451 public String [] getViewAsString(boolean selectedRegionOnly)
1453 String [] selection = null;
1454 SequenceI [] seqs= null;
1456 int start = 0, end = 0;
1457 if(selectedRegionOnly && selectionGroup!=null)
1459 iSize = selectionGroup.getSize(false);
1460 seqs = selectionGroup.getSequencesInOrder(alignment);
1461 start = selectionGroup.getStartRes();
1462 end = selectionGroup.getEndRes()+1;
1466 iSize = alignment.getHeight();
1467 seqs = alignment.getSequencesArray();
1468 end = alignment.getWidth();
1471 selection = new String[iSize];
1472 if (hasHiddenColumns) {
1473 selection = colSel.getVisibleSequenceStrings(start, end, seqs);
1475 for(i=0; i<iSize; i++)
1477 selection[i] = seqs[i].getSequence(start, end);
1484 public boolean getShowHiddenMarkers()
1486 return showHiddenMarkers;
1489 public void setShowHiddenMarkers(boolean show)
1491 showHiddenMarkers = show;
1494 public String getSequenceSetId()
1496 if(sequenceSetID==null)
1497 sequenceSetID = alignment.hashCode()+"";
1499 return sequenceSetID;