2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 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.
21 package jalview.datamodel;
23 import jalview.util.ShiftList;
25 import java.io.PrintStream;
26 import java.util.Enumeration;
27 import java.util.List;
28 import java.util.Vector;
31 * Transient object compactly representing a 'view' of an alignment - with
32 * discontinuities marked. Extended in Jalview 2.7 to optionally record sequence
33 * groups and specific selected regions on the alignment.
35 public class AlignmentView
37 private SeqCigar[] sequences = null;
39 private int[] contigs = null;
41 private int width = 0;
43 private int firstCol = 0;
46 * one or more ScGroup objects, which are referenced by each seqCigar's group
49 private Vector scGroups;
51 private boolean isNa = false;
54 * false if the view concerns peptides
64 * Group defined over SeqCigars. Unlike AlignmentI associated groups, each
65 * SequenceGroup hold just the essential properties for the group, but no
66 * references to the sequences involved. SeqCigars hold references to the
67 * seuqenceGroup entities themselves.
73 public SequenceGroup sg;
82 * vector of selected seqCigars. This vector is also referenced by each
83 * seqCigar contained in it.
85 private Vector selected;
88 * Construct an alignmentView from a live jalview alignment view. Note -
89 * hidden rows will be excluded from alignmentView Note: JAL-1179
92 * - alignment as referenced by an AlignViewport
93 * @param columnSelection
96 * @param hasHiddenColumns
97 * - mark the hidden columns in columnSelection as hidden in the view
98 * @param selectedRegionOnly
99 * - when set, only include the selected region in the view,
100 * otherwise just mark the selected region on the constructed view.
101 * @param recordGroups
102 * - when set, any groups on the given alignment will be marked on
105 public AlignmentView(AlignmentI alignment,
106 ColumnSelection columnSelection, SequenceGroup selection,
107 boolean hasHiddenColumns, boolean selectedRegionOnly,
108 boolean recordGroups)
110 // refactored from AlignViewport.getAlignmentView(selectedOnly);
111 this(new jalview.datamodel.CigarArray(alignment,
112 (hasHiddenColumns ? columnSelection : null),
113 (selectedRegionOnly ? selection : null)),
114 (selectedRegionOnly && selection != null) ? selection
116 isNa = alignment.isNucleotide();
117 // walk down SeqCigar array and Alignment Array - optionally restricted by
119 // test group membership for each sequence in each group, store membership
120 // and record non-empty groups in group list.
121 // record / sub-select selected region on the alignment view
123 if (selection != null && selection.getSize() > 0)
125 List<SequenceI> sel = selection.getSequences(null);
126 this.selected = new Vector();
128 .getSequencesInOrder(alignment, selectedRegionOnly);
132 selseqs = alignment.getSequencesArray();
135 // get the alignment's group list and make a copy
136 Vector grps = new Vector();
137 List<SequenceGroup> gg = alignment.getGroups();
139 ScGroup[] sgrps = null;
140 boolean addedgps[] = null;
144 if (selection != null && selectedRegionOnly)
146 // trim annotation to the region being stored.
147 // strip out any groups that do not actually intersect with the
148 // visible and selected region
149 int ssel = selection.getStartRes(), esel = selection.getEndRes();
150 Vector isg = new Vector();
151 Enumeration en = grps.elements();
152 while (en.hasMoreElements())
154 sg = (SequenceGroup) en.nextElement();
156 if (!(sg.getStartRes() > esel || sg.getEndRes() < ssel))
158 // adjust bounds of new group, if necessary.
159 if (sg.getStartRes() < ssel)
161 sg.setStartRes(ssel);
163 if (sg.getEndRes() > esel)
167 sg.setStartRes(sg.getStartRes() - ssel + 1);
168 sg.setEndRes(sg.getEndRes() - ssel + 1);
176 sgrps = new ScGroup[grps.size()];
177 addedgps = new boolean[grps.size()];
178 for (int g = 0; g < sgrps.length; g++)
180 sg = (SequenceGroup) grps.elementAt(g);
181 sgrps[g] = new ScGroup();
182 sgrps[g].sg = new SequenceGroup(sg);
184 grps.setElementAt(sg.getSequences(null), g);
186 // grps now contains vectors (should be sets) for each group, so we can
187 // track when we've done with the group
190 for (int i = 0; i < selseqs.length; i++)
192 if (selseqs[i] != null)
194 if (selection != null && selection.getSize() > 0
195 && !selectedRegionOnly)
197 sequences[csi].setGroupMembership(selected);
198 selected.addElement(sequences[csi]);
202 for (int sg = 0; sg < sgrps.length; sg++)
204 if (((Vector) grps.elementAt(sg)).contains(selseqs[i]))
206 sequences[csi].setGroupMembership(sgrps[sg]);
207 sgrps[sg].sg.deleteSequence(selseqs[i], false);
208 sgrps[sg].seqs.addElement(sequences[csi]);
211 if (scGroups == null)
213 scGroups = new Vector();
216 scGroups.addElement(sgrps[sg]);
224 // finally, delete the remaining sequences (if any) not selected
225 for (int sg = 0; sg < sgrps.length; sg++)
227 SequenceI[] sqs = sgrps[sg].sg.getSequencesAsArray(null);
228 for (int si = 0; si < sqs.length; si++)
230 sgrps[sg].sg.deleteSequence(sqs[si], false);
237 * construct an alignmentView from a SeqCigarArray. Errors are thrown if the
238 * seqcigararray.isSeqCigarArray() flag is not set.
240 public AlignmentView(CigarArray seqcigararray)
242 if (!seqcigararray.isSeqCigarArray())
245 "Implementation Error - can only make an alignment view from a CigarArray of sequences.");
247 // contigs = seqcigararray.applyDeletions();
248 contigs = seqcigararray.getDeletedRegions();
249 sequences = seqcigararray.getSeqCigarArray();
250 width = seqcigararray.getWidth(); // visible width
254 * Create an alignmentView where the first column corresponds with the
255 * 'firstcol' column of some reference alignment
260 public AlignmentView(CigarArray sdata, int firstcol)
266 public void setSequences(SeqCigar[] sequences)
268 this.sequences = sequences;
271 public void setContigs(int[] contigs)
273 this.contigs = contigs;
276 public SeqCigar[] getSequences()
282 * @see CigarArray.getDeletedRegions
283 * @return int[] { vis_start, sym_start, length }
285 public int[] getContigs()
291 * get the full alignment and a columnselection object marking the hidden
294 * @param gapCharacter
296 * @return Object[] { SequenceI[], ColumnSelection}
298 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
300 ColumnSelection colsel = new ColumnSelection();
304 SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel,
309 * return the visible alignment corresponding to this view. Sequences in this
310 * alignment are edited versions of the parent sequences - where hidden
311 * regions have been removed. NOTE: the sequence data in this alignment is not
317 public AlignmentI getVisibleAlignment(char c)
319 SequenceI[] aln = getVisibleSeqs(c);
321 AlignmentI vcal = new Alignment(aln);
322 addPrunedGroupsInOrder(vcal, -1, -1, true);
327 * add groups from view to the given alignment
333 * -1 or gstart to width-1
335 * - true if vcal is alignment of the visible regions of the view
336 * (e.g. as returned from getVisibleAlignment)
338 private void addPrunedGroupsInOrder(AlignmentI vcal, int gstart,
339 int gend, boolean viscontigs)
342 if (gstart > -1 && gstart <= gend)
347 SequenceI[] aln = vcal.getSequencesArray();
350 * prune any groups to the visible coordinates of the alignment.
353 int nvg = (scGroups != null) ? scGroups.size() : 0;
356 SequenceGroup[] nsg = new SequenceGroup[nvg];
357 for (int g = 0; g < nvg; g++)
359 SequenceGroup sg = ((ScGroup) scGroups.elementAt(g)).sg;
362 if (sg.getStartRes() > gend || sg.getEndRes() < gstart)
370 // clone group properties
371 nsg[g] = new SequenceGroup(sg);
373 // may need to shift/trim start and end ?
374 if (r && !viscontigs)
376 // Not fully tested code - routine not yet called with
378 if (nsg[g].getStartRes() < gstart)
380 nsg[g].setStartRes(0);
384 nsg[g].setStartRes(nsg[g].getStartRes() - gstart);
385 nsg[g].setEndRes(nsg[g].getEndRes() - gstart);
387 if (nsg[g].getEndRes() > (gend - gstart))
389 nsg[g].setEndRes(gend - gstart);
395 // prune groups to cover just the visible positions between
400 ShiftList prune = new ShiftList();
403 // adjust for start of alignment within visible window.
404 prune.addShift(gstart, -gstart); //
406 for (int h = 0; h < contigs.length; h += 3)
409 prune.addShift(p + contigs[h + 1], contigs[h + 2]
412 p = contigs[h + 1] + contigs[h + 2];
414 for (int g = 0; g < nsg.length; g++)
418 int s = nsg[g].getStartRes(), t = nsg[g].getEndRes();
433 nsg[g].setStartRes(s);
440 for (int nsq = 0; nsq < aln.length; nsq++)
442 for (int g = 0; g < nvg; g++)
445 && sequences[nsq].isMemberOf(scGroups.elementAt(g)))
447 nsg[g].addSequence(aln[nsq], false);
451 for (int g = 0; g < nvg; g++)
453 if (nsg[g] != null && nsg[g].getSize() > 0)
455 vcal.addGroup(nsg[g]);
465 * generate sequence array corresponding to the visible parts of the
471 private SequenceI[] getVisibleSeqs(char c)
473 SequenceI[] aln = new SequenceI[sequences.length];
474 for (int i = 0, j = sequences.length; i < j; i++)
476 aln[i] = sequences[i].getSeq('-');
478 // Remove hidden regions from sequence objects.
479 String seqs[] = getSequenceStrings('-');
480 for (int i = 0, j = aln.length; i < j; i++)
482 aln[i].setSequence(seqs[i]);
488 * creates new alignment objects for all contiguous visible segments
493 * @param regionOfInterest
494 * specify which sequences to include (or null to include all
496 * @return AlignmentI[] - all alignments where each sequence is a subsequence
497 * constructed from visible contig regions of view
499 public AlignmentI[] getVisibleContigAlignments(char c)
502 int[] vcontigs = getVisibleContigs();
503 SequenceI[][] contigviews = getVisibleContigs(c);
504 AlignmentI[] vcals = new AlignmentI[contigviews.length];
505 for (nvc = 0; nvc < contigviews.length; nvc++)
507 vcals[nvc] = new Alignment(contigviews[nvc]);
508 if (scGroups != null && scGroups.size() > 0)
510 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
511 vcontigs[nvc * 2 + 1], true);
518 * get an array of visible sequence strings for a view on an alignment using
519 * the given gap character
525 public String[] getSequenceStrings(char c)
527 String[] seqs = new String[sequences.length];
528 for (int n = 0; n < sequences.length; n++)
530 String fullseq = sequences[n].getSequenceString(c);
535 for (int h = 0; h < contigs.length; h += 3)
537 seqs[n] += fullseq.substring(p, contigs[h + 1]);
538 p = contigs[h + 1] + contigs[h + 2];
540 seqs[n] += fullseq.substring(p);
552 * @return visible number of columns in alignment view
554 public int getWidth()
559 protected void setWidth(int width)
565 * get the contiguous subalignments in an alignment view.
567 * @param gapCharacter
569 * @return SequenceI[][]
571 public SequenceI[][] getVisibleContigs(char gapCharacter)
575 if (sequences == null || width <= 0)
579 if (contigs != null && contigs.length > 0)
584 for (int contig = 0; contig < contigs.length; contig += 3)
586 if ((contigs[contig + 1] - start) > 0)
590 fwidth += contigs[contig + 2]; // end up with full region width
591 // (including hidden regions)
592 start = contigs[contig + 1] + contigs[contig + 2];
598 smsa = new SequenceI[njobs][];
601 for (int contig = 0; contig < contigs.length; contig += 3)
603 if (contigs[contig + 1] - start > 0)
605 SequenceI mseq[] = new SequenceI[sequences.length];
606 for (int s = 0; s < mseq.length; s++)
608 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
609 start, contigs[contig + 1]);
614 start = contigs[contig + 1] + contigs[contig + 2];
618 SequenceI mseq[] = new SequenceI[sequences.length];
619 for (int s = 0; s < mseq.length; s++)
621 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
630 smsa = new SequenceI[1][];
631 smsa[0] = new SequenceI[sequences.length];
632 for (int s = 0; s < sequences.length; s++)
634 smsa[0][s] = sequences[s].getSeq(gapCharacter);
641 * return full msa and hidden regions with visible blocks replaced with new
647 * AlignmentOrder[] corresponding to each SequenceI[] block.
650 public Object[] getUpdatedView(SequenceI[][] nvismsa,
651 AlignmentOrder[] orders, char gapCharacter)
653 if (sequences == null || width <= 0)
655 throw new Error("empty view cannot be updated.");
660 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
662 if (contigs != null && contigs.length > 0)
664 SequenceI[] alignment = new SequenceI[sequences.length];
665 ColumnSelection columnselection = new ColumnSelection();
666 if (contigs != null && contigs.length > 0)
672 for (int contig = 0; contig < contigs.length; contig += 3)
674 owidth += contigs[contig + 2]; // recover final column width
675 if (contigs[contig + 1] - start > 0)
677 int swidth = 0; // subalignment width
678 if (nvismsa[j] != null)
680 SequenceI mseq[] = nvismsa[j];
681 AlignmentOrder order = (orders == null) ? null : orders[j];
683 if (mseq.length != sequences.length)
686 "Mismatch between number of sequences in block "
687 + j + " (" + mseq.length
688 + ") and the original view ("
689 + sequences.length + ")");
691 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
693 for (int s = 0; s < mseq.length; s++)
695 if (alignment[s] == null)
697 alignment[s] = mseq[s];
701 alignment[s].setSequence(alignment[s]
702 .getSequenceAsString()
703 + mseq[s].getSequenceAsString());
704 if (mseq[s].getStart() <= mseq[s].getEnd())
706 alignment[s].setEnd(mseq[s].getEnd());
710 order.updateSequence(mseq[s], alignment[s]);
717 // recover original alignment block or place gaps
720 // recover input data
721 for (int s = 0; s < sequences.length; s++)
723 SequenceI oseq = sequences[s].getSeq(gapCharacter)
724 .getSubSequence(start, contigs[contig + 1]);
725 if (swidth < oseq.getLength())
727 swidth = oseq.getLength();
729 if (alignment[s] == null)
735 alignment[s].setSequence(alignment[s]
736 .getSequenceAsString()
737 + oseq.getSequenceAsString());
738 if (oseq.getEnd() >= oseq.getStart())
740 alignment[s].setEnd(oseq.getEnd());
750 // advance to begining of visible region
751 start = contigs[contig + 1] + contigs[contig + 2];
752 // add hidden segment to right of next region
753 for (int s = 0; s < sequences.length; s++)
755 SequenceI hseq = sequences[s].getSeq(gapCharacter)
756 .getSubSequence(contigs[contig + 1], start);
757 if (alignment[s] == null)
763 alignment[s].setSequence(alignment[s].getSequenceAsString()
764 + hseq.getSequenceAsString());
765 if (hseq.getEnd() >= hseq.getStart())
767 alignment[s].setEnd(hseq.getEnd());
771 // mark hidden segment as hidden in the new alignment
772 columnselection.hideColumns(nwidth, nwidth + contigs[contig + 2]
774 nwidth += contigs[contig + 2];
776 // Do final segment - if it exists
777 if (j < nvismsa.length)
780 if (nvismsa[j] != null)
782 SequenceI mseq[] = nvismsa[j];
783 AlignmentOrder order = (orders != null) ? orders[j] : null;
784 swidth = mseq[0].getLength();
785 for (int s = 0; s < mseq.length; s++)
787 if (alignment[s] == null)
789 alignment[s] = mseq[s];
793 alignment[s].setSequence(alignment[s].getSequenceAsString()
794 + mseq[s].getSequenceAsString());
795 if (mseq[s].getEnd() >= mseq[s].getStart())
797 alignment[s].setEnd(mseq[s].getEnd());
801 order.updateSequence(mseq[s], alignment[s]);
810 // recover input data or place gaps
813 // recover input data
814 for (int s = 0; s < sequences.length; s++)
816 SequenceI oseq = sequences[s].getSeq(gapCharacter)
817 .getSubSequence(start, owidth + 1);
818 if (swidth < oseq.getLength())
820 swidth = oseq.getLength();
822 if (alignment[s] == null)
828 alignment[s].setSequence(alignment[s]
829 .getSequenceAsString()
830 + oseq.getSequenceAsString());
831 if (oseq.getEnd() >= oseq.getStart())
833 alignment[s].setEnd(oseq.getEnd());
842 throw new Error("Padding not yet implemented.");
849 { alignment, columnselection };
853 if (nvismsa.length != 1)
856 "Mismatch between visible blocks to update and number of contigs in view (contigs=0,blocks="
859 if (nvismsa[0] != null)
862 { nvismsa[0], new ColumnSelection() };
866 return getAlignmentAndColumnSelection(gapCharacter);
872 * returns simple array of start end positions of visible range on alignment.
873 * vis_start and vis_end are inclusive - use
874 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
875 * from underlying alignment.
877 * @return int[] { start_i, end_i } for 1<i<n visible regions.
879 public int[] getVisibleContigs()
881 if (contigs != null && contigs.length > 0)
886 for (int contig = 0; contig < contigs.length; contig += 3)
888 if ((contigs[contig + 1] - start) > 0)
892 fwidth += contigs[contig + 2]; // end up with full region width
893 // (including hidden regions)
894 start = contigs[contig + 1] + contigs[contig + 2];
900 int viscontigs[] = new int[nvis * 2];
903 for (int contig = 0; contig < contigs.length; contig += 3)
905 if ((contigs[contig + 1] - start) > 0)
907 viscontigs[nvis] = start;
908 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
911 start = contigs[contig + 1] + contigs[contig + 2];
915 viscontigs[nvis] = start;
916 viscontigs[nvis + 1] = fwidth; // end is inclusive
930 * @return position of first visible column of AlignmentView within its
931 * parent's alignment reference frame
933 public int getAlignmentOrigin()
939 * compute a deletion map for the current view according to the given
943 * (as returned from SequenceI.gapMap())
944 * @return int[] {intersection of visible regions with gapMap)
946 public int[] getVisibleContigMapFor(int[] gapMap)
949 int[] viscontigs = getVisibleContigs();
952 if (viscontigs != null)
954 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
955 // always be equal to or shorter than gapMap
956 delMap = new int[gapMap.length];
957 for (int contig = 0; contig < viscontigs.length; contig += 2)
960 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
964 while (spos < gapMap.length
965 && gapMap[spos] <= viscontigs[contig + 1])
967 delMap[i++] = spos++;
970 int tmap[] = new int[i];
971 System.arraycopy(delMap, 0, tmap, 0, i);
978 * apply the getSeq(gc) method to each sequence cigar, and return the array of
979 * edited sequences, optionally with hidden regions removed.
982 * gap character to use for insertions
984 * remove hidden regions from sequences. Note: currently implemented
985 * in a memory inefficient way - space needed is 2*result set for
988 * @return SequenceI[]
990 public SequenceI[] getEditedSequences(char gc, boolean delete)
992 SeqCigar[] msf = getSequences();
993 SequenceI[] aln = new SequenceI[msf.length];
994 for (int i = 0, j = msf.length; i < j; i++)
996 aln[i] = msf[i].getSeq(gc);
1000 String[] sqs = getSequenceStrings(gc);
1001 for (int i = 0; i < sqs.length; i++)
1003 aln[i].setSequence(sqs[i]);
1010 public static void summariseAlignmentView(AlignmentView view,
1013 os.print("View has " + view.sequences.length + " of which ");
1014 if (view.selected == null)
1020 os.print(" " + view.selected.size());
1022 os.println(" are selected.");
1023 os.print("View is " + view.getWidth() + " columns wide");
1025 int[] contigs = view.getContigs();
1026 if (contigs != null)
1028 viswid = view.width;
1029 for (int i = 0; i < contigs.length; i += 3)
1031 viswid += contigs[i + 2];
1033 os.println("with " + viswid + " visible columns spread over "
1034 + contigs.length / 3 + " regions.");
1038 viswid = view.width;
1041 if (view.scGroups != null)
1043 os.println("There are " + view.scGroups.size()
1044 + " groups defined on the view.");
1045 for (int g = 0; g < view.scGroups.size(); g++)
1047 ScGroup sgr = (ScGroup) view.scGroups.elementAt(g);
1048 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1049 + " Contains " + sgr.seqs.size() + " Seqs.");
1050 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1051 + sgr.sg.getEndRes());
1052 for (int s = 0; s < sgr.seqs.size(); s++)
1054 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1056 os.println("** WARNING: sequence "
1057 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1058 + " is not marked as member of group.");
1062 AlignmentI visal = view.getVisibleAlignment('-');
1065 os.println("Vis. alignment is " + visal.getWidth()
1066 + " wide and has " + visal.getHeight() + " seqs.");
1067 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1071 for (SequenceGroup sg : visal.getGroups())
1073 os.println("Group " + (i++) + " begins at column "
1074 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1081 public static void testSelectionViews(AlignmentI alignment,
1082 ColumnSelection csel, SequenceGroup selection)
1084 System.out.println("Testing standard view creation:\n");
1085 AlignmentView view = null;
1089 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1090 view = new AlignmentView(alignment, csel, selection, false, false,
1092 summariseAlignmentView(view, System.out);
1094 } catch (Exception e)
1096 e.printStackTrace();
1098 .println("Failed to generate alignment with selection but no groups marked.");
1103 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1104 view = new AlignmentView(alignment, csel, selection, false, false,
1106 summariseAlignmentView(view, System.out);
1107 } catch (Exception e)
1109 e.printStackTrace();
1111 .println("Failed to generate alignment with selection marked but no groups marked.");
1116 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1117 view = new AlignmentView(alignment, csel, selection, false, true,
1119 summariseAlignmentView(view, System.out);
1120 } catch (Exception e)
1122 e.printStackTrace();
1124 .println("Failed to generate alignment with selection restricted but no groups marked.");
1129 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1130 view = new AlignmentView(alignment, csel, selection, false, true,
1132 summariseAlignmentView(view, System.out);
1133 } catch (Exception e)
1135 e.printStackTrace();
1137 .println("Failed to generate alignment with selection restricted and groups marked.");
1142 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1143 view = new AlignmentView(alignment, csel, selection, true, false,
1145 summariseAlignmentView(view, System.out);
1146 } catch (Exception e)
1148 e.printStackTrace();
1150 .println("Failed to generate alignment with selection but no groups marked.");
1155 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1156 view = new AlignmentView(alignment, csel, selection, true, false,
1158 summariseAlignmentView(view, System.out);
1159 } catch (Exception e)
1161 e.printStackTrace();
1163 .println("Failed to generate alignment with selection marked but no groups marked.");
1168 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1169 view = new AlignmentView(alignment, csel, selection, true, true,
1171 summariseAlignmentView(view, System.out);
1172 } catch (Exception e)
1174 e.printStackTrace();
1176 .println("Failed to generate alignment with selection restricted but no groups marked.");
1181 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1182 view = new AlignmentView(alignment, csel, selection, true, true, true);
1183 summariseAlignmentView(view, System.out);
1184 } catch (Exception e)
1186 e.printStackTrace();
1188 .println("Failed to generate alignment with selection restricted and groups marked.");