2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.datamodel;
21 import jalview.util.ShiftList;
23 import java.io.PrintStream;
24 import java.util.Enumeration;
25 import java.util.List;
26 import java.util.Vector;
29 * Transient object compactly representing a 'view' of an alignment - with
30 * discontinuities marked. Extended in Jalview 2.7 to optionally record sequence
31 * groups and specific selected regions on the alignment.
33 public class AlignmentView
35 private SeqCigar[] sequences = null;
37 private int[] contigs = null;
39 private int width = 0;
41 private int firstCol = 0;
44 * one or more ScGroup objects, which are referenced by each seqCigar's group
47 private Vector scGroups;
50 * Group defined over SeqCigars. Unlike AlignmentI associated groups, each
51 * SequenceGroup hold just the essential properties for the group, but no
52 * references to the sequences involved. SeqCigars hold references to the
53 * seuqenceGroup entities themselves.
59 public SequenceGroup sg;
68 * vector of selected seqCigars. This vector is also referenced by each
69 * seqCigar contained in it.
71 private Vector selected;
74 * Construct an alignmentView from a live jalview alignment view. Note -
75 * hidden rows will be excluded from alignmentView Note: JAL-1179
78 * - alignment as referenced by an AlignViewport
79 * @param columnSelection
82 * @param hasHiddenColumns
83 * - mark the hidden columns in columnSelection as hidden in the view
84 * @param selectedRegionOnly
85 * - when set, only include the selected region in the view,
86 * otherwise just mark the selected region on the constructed view.
88 * - when set, any groups on the given alignment will be marked on
91 public AlignmentView(AlignmentI alignment,
92 ColumnSelection columnSelection, SequenceGroup selection,
93 boolean hasHiddenColumns, boolean selectedRegionOnly,
96 // refactored from AlignViewport.getAlignmentView(selectedOnly);
97 this(new jalview.datamodel.CigarArray(alignment,
98 (hasHiddenColumns ? columnSelection : null),
99 (selectedRegionOnly ? selection : null)),
100 (selectedRegionOnly && selection != null) ? selection
102 // walk down SeqCigar array and Alignment Array - optionally restricted by
104 // test group membership for each sequence in each group, store membership
105 // and record non-empty groups in group list.
106 // record / sub-select selected region on the alignment view
108 if (selection != null && selection.getSize() > 0)
110 List<SequenceI> sel = selection.getSequences(null);
111 this.selected = new Vector();
113 .getSequencesInOrder(alignment, selectedRegionOnly);
117 selseqs = alignment.getSequencesArray();
120 // get the alignment's group list and make a copy
121 Vector grps = new Vector();
122 List<SequenceGroup> gg = alignment.getGroups();
124 ScGroup[] sgrps = null;
125 boolean addedgps[] = null;
129 if (selection != null && selectedRegionOnly)
131 // trim annotation to the region being stored.
132 // strip out any groups that do not actually intersect with the
133 // visible and selected region
134 int ssel = selection.getStartRes(), esel = selection.getEndRes();
135 Vector isg = new Vector();
136 Enumeration en = grps.elements();
137 while (en.hasMoreElements())
139 sg = (SequenceGroup) en.nextElement();
141 if (!(sg.getStartRes() > esel || sg.getEndRes() < ssel))
143 // adjust bounds of new group, if necessary.
144 if (sg.getStartRes() < ssel)
146 sg.setStartRes(ssel);
148 if (sg.getEndRes() > esel)
152 sg.setStartRes(sg.getStartRes() - ssel + 1);
153 sg.setEndRes(sg.getEndRes() - ssel + 1);
161 sgrps = new ScGroup[grps.size()];
162 addedgps = new boolean[grps.size()];
163 for (int g = 0; g < sgrps.length; g++)
165 sg = (SequenceGroup) grps.elementAt(g);
166 sgrps[g] = new ScGroup();
167 sgrps[g].sg = new SequenceGroup(sg);
169 grps.setElementAt(sg.getSequences(null), g);
171 // grps now contains vectors (should be sets) for each group, so we can
172 // track when we've done with the group
175 for (int i = 0; i < selseqs.length; i++)
177 if (selseqs[i] != null)
179 if (selection != null && selection.getSize() > 0
180 && !selectedRegionOnly)
182 sequences[csi].setGroupMembership(selected);
183 selected.addElement(sequences[csi]);
187 for (int sg = 0; sg < sgrps.length; sg++)
189 if (((Vector) grps.elementAt(sg)).contains(selseqs[i]))
191 sequences[csi].setGroupMembership(sgrps[sg]);
192 sgrps[sg].sg.deleteSequence(selseqs[i], false);
193 sgrps[sg].seqs.addElement(sequences[csi]);
196 if (scGroups == null)
198 scGroups = new Vector();
201 scGroups.addElement(sgrps[sg]);
209 // finally, delete the remaining sequences (if any) not selected
210 for (int sg = 0; sg < sgrps.length; sg++)
212 SequenceI[] sqs = sgrps[sg].sg.getSequencesAsArray(null);
213 for (int si = 0; si < sqs.length; si++)
215 sgrps[sg].sg.deleteSequence(sqs[si], false);
222 * construct an alignmentView from a SeqCigarArray. Errors are thrown if the
223 * seqcigararray.isSeqCigarArray() flag is not set.
225 public AlignmentView(CigarArray seqcigararray)
227 if (!seqcigararray.isSeqCigarArray())
230 "Implementation Error - can only make an alignment view from a CigarArray of sequences.");
232 // contigs = seqcigararray.applyDeletions();
233 contigs = seqcigararray.getDeletedRegions();
234 sequences = seqcigararray.getSeqCigarArray();
235 width = seqcigararray.getWidth(); // visible width
239 * Create an alignmentView where the first column corresponds with the
240 * 'firstcol' column of some reference alignment
245 public AlignmentView(CigarArray sdata, int firstcol)
251 public void setSequences(SeqCigar[] sequences)
253 this.sequences = sequences;
256 public void setContigs(int[] contigs)
258 this.contigs = contigs;
261 public SeqCigar[] getSequences()
267 * @see CigarArray.getDeletedRegions
268 * @return int[] { vis_start, sym_start, length }
270 public int[] getContigs()
276 * get the full alignment and a columnselection object marking the hidden
279 * @param gapCharacter
281 * @return Object[] { SequenceI[], ColumnSelection}
283 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
285 ColumnSelection colsel = new ColumnSelection();
289 SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel,
294 * return the visible alignment corresponding to this view. Sequences in this
295 * alignment are edited versions of the parent sequences - where hidden
296 * regions have been removed. NOTE: the sequence data in this alignment is not
302 public AlignmentI getVisibleAlignment(char c)
304 SequenceI[] aln = getVisibleSeqs(c);
306 AlignmentI vcal = new Alignment(aln);
307 addPrunedGroupsInOrder(vcal, -1, -1, true);
312 * add groups from view to the given alignment
318 * -1 or gstart to width-1
320 * - true if vcal is alignment of the visible regions of the view
321 * (e.g. as returned from getVisibleAlignment)
323 private void addPrunedGroupsInOrder(AlignmentI vcal, int gstart,
324 int gend, boolean viscontigs)
327 if (gstart > -1 && gstart <= gend)
332 SequenceI[] aln = vcal.getSequencesArray();
335 * prune any groups to the visible coordinates of the alignment.
338 int nvg = (scGroups != null) ? scGroups.size() : 0;
341 SequenceGroup[] nsg = new SequenceGroup[nvg];
342 for (int g = 0; g < nvg; g++)
344 SequenceGroup sg = ((ScGroup) scGroups.elementAt(g)).sg;
347 if (sg.getStartRes() > gend || sg.getEndRes() < gstart)
355 // clone group properties
356 nsg[g] = new SequenceGroup(sg);
358 // may need to shift/trim start and end ?
359 if (r && !viscontigs)
361 // Not fully tested code - routine not yet called with
363 if (nsg[g].getStartRes() < gstart)
365 nsg[g].setStartRes(0);
369 nsg[g].setStartRes(nsg[g].getStartRes() - gstart);
370 nsg[g].setEndRes(nsg[g].getEndRes() - gstart);
372 if (nsg[g].getEndRes() > (gend - gstart))
374 nsg[g].setEndRes(gend - gstart);
380 // prune groups to cover just the visible positions between
385 ShiftList prune = new ShiftList();
388 // adjust for start of alignment within visible window.
389 prune.addShift(gstart, -gstart); //
391 for (int h = 0; h < contigs.length; h += 3)
394 prune.addShift(p + contigs[h + 1], contigs[h + 2]
397 p = contigs[h + 1] + contigs[h + 2];
399 for (int g = 0; g < nsg.length; g++)
403 int s = nsg[g].getStartRes(), t = nsg[g].getEndRes();
418 nsg[g].setStartRes(s);
425 for (int nsq = 0; nsq < aln.length; nsq++)
427 for (int g = 0; g < nvg; g++)
430 && sequences[nsq].isMemberOf(scGroups.elementAt(g)))
432 nsg[g].addSequence(aln[nsq], false);
436 for (int g = 0; g < nvg; g++)
438 if (nsg[g] != null && nsg[g].getSize() > 0)
440 vcal.addGroup(nsg[g]);
450 * generate sequence array corresponding to the visible parts of the
456 private SequenceI[] getVisibleSeqs(char c)
458 SequenceI[] aln = new SequenceI[sequences.length];
459 for (int i = 0, j = sequences.length; i < j; i++)
461 aln[i] = sequences[i].getSeq('-');
463 // Remove hidden regions from sequence objects.
464 String seqs[] = getSequenceStrings('-');
465 for (int i = 0, j = aln.length; i < j; i++)
467 aln[i].setSequence(seqs[i]);
473 * creates new alignment objects for all contiguous visible segments
478 * @param regionOfInterest
479 * specify which sequences to include (or null to include all
481 * @return AlignmentI[] - all alignments where each sequence is a subsequence
482 * constructed from visible contig regions of view
484 public AlignmentI[] getVisibleContigAlignments(char c)
487 int[] vcontigs = getVisibleContigs();
488 SequenceI[][] contigviews = getVisibleContigs(c);
489 AlignmentI[] vcals = new AlignmentI[contigviews.length];
490 for (nvc = 0; nvc < contigviews.length; nvc++)
492 vcals[nvc] = new Alignment(contigviews[nvc]);
493 if (scGroups != null && scGroups.size() > 0)
495 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
496 vcontigs[nvc * 2 + 1], true);
503 * get an array of visible sequence strings for a view on an alignment using
504 * the given gap character
510 public String[] getSequenceStrings(char c)
512 String[] seqs = new String[sequences.length];
513 for (int n = 0; n < sequences.length; n++)
515 String fullseq = sequences[n].getSequenceString(c);
520 for (int h = 0; h < contigs.length; h += 3)
522 seqs[n] += fullseq.substring(p, contigs[h + 1]);
523 p = contigs[h + 1] + contigs[h + 2];
525 seqs[n] += fullseq.substring(p);
537 * @return visible number of columns in alignment view
539 public int getWidth()
544 protected void setWidth(int width)
550 * get the contiguous subalignments in an alignment view.
552 * @param gapCharacter
554 * @return SequenceI[][]
556 public SequenceI[][] getVisibleContigs(char gapCharacter)
560 if (sequences == null || width <= 0)
564 if (contigs != null && contigs.length > 0)
569 for (int contig = 0; contig < contigs.length; contig += 3)
571 if ((contigs[contig + 1] - start) > 0)
575 fwidth += contigs[contig + 2]; // end up with full region width
576 // (including hidden regions)
577 start = contigs[contig + 1] + contigs[contig + 2];
583 smsa = new SequenceI[njobs][];
586 for (int contig = 0; contig < contigs.length; contig += 3)
588 if (contigs[contig + 1] - start > 0)
590 SequenceI mseq[] = new SequenceI[sequences.length];
591 for (int s = 0; s < mseq.length; s++)
593 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
594 start, contigs[contig + 1]);
599 start = contigs[contig + 1] + contigs[contig + 2];
603 SequenceI mseq[] = new SequenceI[sequences.length];
604 for (int s = 0; s < mseq.length; s++)
606 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
615 smsa = new SequenceI[1][];
616 smsa[0] = new SequenceI[sequences.length];
617 for (int s = 0; s < sequences.length; s++)
619 smsa[0][s] = sequences[s].getSeq(gapCharacter);
626 * return full msa and hidden regions with visible blocks replaced with new
632 * AlignmentOrder[] corresponding to each SequenceI[] block.
635 public Object[] getUpdatedView(SequenceI[][] nvismsa,
636 AlignmentOrder[] orders, char gapCharacter)
638 if (sequences == null || width <= 0)
640 throw new Error("empty view cannot be updated.");
645 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
647 if (contigs != null && contigs.length > 0)
649 SequenceI[] alignment = new SequenceI[sequences.length];
650 ColumnSelection columnselection = new ColumnSelection();
651 if (contigs != null && contigs.length > 0)
657 for (int contig = 0; contig < contigs.length; contig += 3)
659 owidth += contigs[contig + 2]; // recover final column width
660 if (contigs[contig + 1] - start > 0)
662 int swidth = 0; // subalignment width
663 if (nvismsa[j] != null)
665 SequenceI mseq[] = nvismsa[j];
666 AlignmentOrder order = (orders == null) ? null : orders[j];
668 if (mseq.length != sequences.length)
671 "Mismatch between number of sequences in block "
672 + j + " (" + mseq.length
673 + ") and the original view ("
674 + sequences.length + ")");
676 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
678 for (int s = 0; s < mseq.length; s++)
680 if (alignment[s] == null)
682 alignment[s] = mseq[s];
686 alignment[s].setSequence(alignment[s]
687 .getSequenceAsString()
688 + mseq[s].getSequenceAsString());
689 if (mseq[s].getStart() <= mseq[s].getEnd())
691 alignment[s].setEnd(mseq[s].getEnd());
695 order.updateSequence(mseq[s], alignment[s]);
702 // recover original alignment block or place gaps
705 // recover input data
706 for (int s = 0; s < sequences.length; s++)
708 SequenceI oseq = sequences[s].getSeq(gapCharacter)
709 .getSubSequence(start, contigs[contig + 1]);
710 if (swidth < oseq.getLength())
712 swidth = oseq.getLength();
714 if (alignment[s] == null)
720 alignment[s].setSequence(alignment[s]
721 .getSequenceAsString()
722 + oseq.getSequenceAsString());
723 if (oseq.getEnd() >= oseq.getStart())
725 alignment[s].setEnd(oseq.getEnd());
735 // advance to begining of visible region
736 start = contigs[contig + 1] + contigs[contig + 2];
737 // add hidden segment to right of next region
738 for (int s = 0; s < sequences.length; s++)
740 SequenceI hseq = sequences[s].getSeq(gapCharacter)
741 .getSubSequence(contigs[contig + 1], start);
742 if (alignment[s] == null)
748 alignment[s].setSequence(alignment[s].getSequenceAsString()
749 + hseq.getSequenceAsString());
750 if (hseq.getEnd() >= hseq.getStart())
752 alignment[s].setEnd(hseq.getEnd());
756 // mark hidden segment as hidden in the new alignment
757 columnselection.hideColumns(nwidth, nwidth + contigs[contig + 2]
759 nwidth += contigs[contig + 2];
761 // Do final segment - if it exists
762 if (j < nvismsa.length)
765 if (nvismsa[j] != null)
767 SequenceI mseq[] = nvismsa[j];
768 AlignmentOrder order = (orders != null) ? orders[j] : null;
769 swidth = mseq[0].getLength();
770 for (int s = 0; s < mseq.length; s++)
772 if (alignment[s] == null)
774 alignment[s] = mseq[s];
778 alignment[s].setSequence(alignment[s].getSequenceAsString()
779 + mseq[s].getSequenceAsString());
780 if (mseq[s].getEnd() >= mseq[s].getStart())
782 alignment[s].setEnd(mseq[s].getEnd());
786 order.updateSequence(mseq[s], alignment[s]);
795 // recover input data or place gaps
798 // recover input data
799 for (int s = 0; s < sequences.length; s++)
801 SequenceI oseq = sequences[s].getSeq(gapCharacter)
802 .getSubSequence(start, owidth + 1);
803 if (swidth < oseq.getLength())
805 swidth = oseq.getLength();
807 if (alignment[s] == null)
813 alignment[s].setSequence(alignment[s]
814 .getSequenceAsString()
815 + oseq.getSequenceAsString());
816 if (oseq.getEnd() >= oseq.getStart())
818 alignment[s].setEnd(oseq.getEnd());
827 throw new Error("Padding not yet implemented.");
834 { alignment, columnselection };
838 if (nvismsa.length != 1)
841 "Mismatch between visible blocks to update and number of contigs in view (contigs=0,blocks="
844 if (nvismsa[0] != null)
847 { nvismsa[0], new ColumnSelection() };
851 return getAlignmentAndColumnSelection(gapCharacter);
857 * returns simple array of start end positions of visible range on alignment.
858 * vis_start and vis_end are inclusive - use
859 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
860 * from underlying alignment.
862 * @return int[] { start_i, end_i } for 1<i<n visible regions.
864 public int[] getVisibleContigs()
866 if (contigs != null && contigs.length > 0)
871 for (int contig = 0; contig < contigs.length; contig += 3)
873 if ((contigs[contig + 1] - start) > 0)
877 fwidth += contigs[contig + 2]; // end up with full region width
878 // (including hidden regions)
879 start = contigs[contig + 1] + contigs[contig + 2];
885 int viscontigs[] = new int[nvis * 2];
888 for (int contig = 0; contig < contigs.length; contig += 3)
890 if ((contigs[contig + 1] - start) > 0)
892 viscontigs[nvis] = start;
893 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
896 start = contigs[contig + 1] + contigs[contig + 2];
900 viscontigs[nvis] = start;
901 viscontigs[nvis + 1] = fwidth; // end is inclusive
915 * @return position of first visible column of AlignmentView within its
916 * parent's alignment reference frame
918 public int getAlignmentOrigin()
924 * compute a deletion map for the current view according to the given
928 * (as returned from SequenceI.gapMap())
929 * @return int[] {intersection of visible regions with gapMap)
931 public int[] getVisibleContigMapFor(int[] gapMap)
934 int[] viscontigs = getVisibleContigs();
937 if (viscontigs != null)
939 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
940 // always be equal to or shorter than gapMap
941 delMap = new int[gapMap.length];
942 for (int contig = 0; contig < viscontigs.length; contig += 2)
945 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
949 while (spos < gapMap.length
950 && gapMap[spos] <= viscontigs[contig + 1])
952 delMap[i++] = spos++;
955 int tmap[] = new int[i];
956 System.arraycopy(delMap, 0, tmap, 0, i);
963 * apply the getSeq(gc) method to each sequence cigar, and return the array of
964 * edited sequences, optionally with hidden regions removed.
967 * gap character to use for insertions
969 * remove hidden regions from sequences. Note: currently implemented
970 * in a memory inefficient way - space needed is 2*result set for
973 * @return SequenceI[]
975 public SequenceI[] getEditedSequences(char gc, boolean delete)
977 SeqCigar[] msf = getSequences();
978 SequenceI[] aln = new SequenceI[msf.length];
979 for (int i = 0, j = msf.length; i < j; i++)
981 aln[i] = msf[i].getSeq(gc);
985 String[] sqs = getSequenceStrings(gc);
986 for (int i = 0; i < sqs.length; i++)
988 aln[i].setSequence(sqs[i]);
995 public static void summariseAlignmentView(AlignmentView view,
998 os.print("View has " + view.sequences.length + " of which ");
999 if (view.selected == null)
1005 os.print(" " + view.selected.size());
1007 os.println(" are selected.");
1008 os.print("View is " + view.getWidth() + " columns wide");
1010 int[] contigs = view.getContigs();
1011 if (contigs != null)
1013 viswid = view.width;
1014 for (int i = 0; i < contigs.length; i += 3)
1016 viswid += contigs[i + 2];
1018 os.println("with " + viswid + " visible columns spread over "
1019 + contigs.length / 3 + " regions.");
1023 viswid = view.width;
1026 if (view.scGroups != null)
1028 os.println("There are " + view.scGroups.size()
1029 + " groups defined on the view.");
1030 for (int g = 0; g < view.scGroups.size(); g++)
1032 ScGroup sgr = (ScGroup) view.scGroups.elementAt(g);
1033 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1034 + " Contains " + sgr.seqs.size() + " Seqs.");
1035 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1036 + sgr.sg.getEndRes());
1037 for (int s = 0; s < sgr.seqs.size(); s++)
1039 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1041 os.println("** WARNING: sequence "
1042 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1043 + " is not marked as member of group.");
1047 AlignmentI visal = view.getVisibleAlignment('-');
1050 os.println("Vis. alignment is " + visal.getWidth()
1051 + " wide and has " + visal.getHeight() + " seqs.");
1052 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1056 for (SequenceGroup sg : visal.getGroups())
1058 os.println("Group " + (i++) + " begins at column "
1059 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1066 public static void testSelectionViews(AlignmentI alignment,
1067 ColumnSelection csel, SequenceGroup selection)
1069 System.out.println("Testing standard view creation:\n");
1070 AlignmentView view = null;
1074 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1075 view = new AlignmentView(alignment, csel, selection, false, false,
1077 summariseAlignmentView(view, System.out);
1079 } catch (Exception e)
1081 e.printStackTrace();
1083 .println("Failed to generate alignment with selection but no groups marked.");
1088 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1089 view = new AlignmentView(alignment, csel, selection, false, false,
1091 summariseAlignmentView(view, System.out);
1092 } catch (Exception e)
1094 e.printStackTrace();
1096 .println("Failed to generate alignment with selection marked but no groups marked.");
1101 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1102 view = new AlignmentView(alignment, csel, selection, false, true,
1104 summariseAlignmentView(view, System.out);
1105 } catch (Exception e)
1107 e.printStackTrace();
1109 .println("Failed to generate alignment with selection restricted but no groups marked.");
1114 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1115 view = new AlignmentView(alignment, csel, selection, false, true,
1117 summariseAlignmentView(view, System.out);
1118 } catch (Exception e)
1120 e.printStackTrace();
1122 .println("Failed to generate alignment with selection restricted and groups marked.");
1127 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1128 view = new AlignmentView(alignment, csel, selection, true, false,
1130 summariseAlignmentView(view, System.out);
1131 } catch (Exception e)
1133 e.printStackTrace();
1135 .println("Failed to generate alignment with selection but no groups marked.");
1140 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1141 view = new AlignmentView(alignment, csel, selection, true, false,
1143 summariseAlignmentView(view, System.out);
1144 } catch (Exception e)
1146 e.printStackTrace();
1148 .println("Failed to generate alignment with selection marked but no groups marked.");
1153 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1154 view = new AlignmentView(alignment, csel, selection, true, true,
1156 summariseAlignmentView(view, System.out);
1157 } catch (Exception e)
1159 e.printStackTrace();
1161 .println("Failed to generate alignment with selection restricted but no groups marked.");
1166 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1167 view = new AlignmentView(alignment, csel, selection, true, true, true);
1168 summariseAlignmentView(view, System.out);
1169 } catch (Exception e)
1171 e.printStackTrace();
1173 .println("Failed to generate alignment with selection restricted and groups marked.");