2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
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;
49 private boolean isNa=false;
51 * false if the view concerns peptides
60 * Group defined over SeqCigars. Unlike AlignmentI associated groups, each
61 * SequenceGroup hold just the essential properties for the group, but no
62 * references to the sequences involved. SeqCigars hold references to the
63 * seuqenceGroup entities themselves.
69 public SequenceGroup sg;
78 * vector of selected seqCigars. This vector is also referenced by each
79 * seqCigar contained in it.
81 private Vector selected;
84 * Construct an alignmentView from a live jalview alignment view. Note -
85 * hidden rows will be excluded from alignmentView Note: JAL-1179
88 * - alignment as referenced by an AlignViewport
89 * @param columnSelection
92 * @param hasHiddenColumns
93 * - mark the hidden columns in columnSelection as hidden in the view
94 * @param selectedRegionOnly
95 * - when set, only include the selected region in the view,
96 * otherwise just mark the selected region on the constructed view.
98 * - when set, any groups on the given alignment will be marked on
101 public AlignmentView(AlignmentI alignment,
102 ColumnSelection columnSelection, SequenceGroup selection,
103 boolean hasHiddenColumns, boolean selectedRegionOnly,
104 boolean recordGroups)
106 // refactored from AlignViewport.getAlignmentView(selectedOnly);
107 this(new jalview.datamodel.CigarArray(alignment,
108 (hasHiddenColumns ? columnSelection : null),
109 (selectedRegionOnly ? selection : null)),
110 (selectedRegionOnly && selection != null) ? selection
112 isNa = alignment.isNucleotide();
113 // walk down SeqCigar array and Alignment Array - optionally restricted by
115 // test group membership for each sequence in each group, store membership
116 // and record non-empty groups in group list.
117 // record / sub-select selected region on the alignment view
119 if (selection != null && selection.getSize() > 0)
121 List<SequenceI> sel = selection.getSequences(null);
122 this.selected = new Vector();
124 .getSequencesInOrder(alignment, selectedRegionOnly);
128 selseqs = alignment.getSequencesArray();
131 // get the alignment's group list and make a copy
132 Vector grps = new Vector();
133 List<SequenceGroup> gg = alignment.getGroups();
135 ScGroup[] sgrps = null;
136 boolean addedgps[] = null;
140 if (selection != null && selectedRegionOnly)
142 // trim annotation to the region being stored.
143 // strip out any groups that do not actually intersect with the
144 // visible and selected region
145 int ssel = selection.getStartRes(), esel = selection.getEndRes();
146 Vector isg = new Vector();
147 Enumeration en = grps.elements();
148 while (en.hasMoreElements())
150 sg = (SequenceGroup) en.nextElement();
152 if (!(sg.getStartRes() > esel || sg.getEndRes() < ssel))
154 // adjust bounds of new group, if necessary.
155 if (sg.getStartRes() < ssel)
157 sg.setStartRes(ssel);
159 if (sg.getEndRes() > esel)
163 sg.setStartRes(sg.getStartRes() - ssel + 1);
164 sg.setEndRes(sg.getEndRes() - ssel + 1);
172 sgrps = new ScGroup[grps.size()];
173 addedgps = new boolean[grps.size()];
174 for (int g = 0; g < sgrps.length; g++)
176 sg = (SequenceGroup) grps.elementAt(g);
177 sgrps[g] = new ScGroup();
178 sgrps[g].sg = new SequenceGroup(sg);
180 grps.setElementAt(sg.getSequences(null), g);
182 // grps now contains vectors (should be sets) for each group, so we can
183 // track when we've done with the group
186 for (int i = 0; i < selseqs.length; i++)
188 if (selseqs[i] != null)
190 if (selection != null && selection.getSize() > 0
191 && !selectedRegionOnly)
193 sequences[csi].setGroupMembership(selected);
194 selected.addElement(sequences[csi]);
198 for (int sg = 0; sg < sgrps.length; sg++)
200 if (((Vector) grps.elementAt(sg)).contains(selseqs[i]))
202 sequences[csi].setGroupMembership(sgrps[sg]);
203 sgrps[sg].sg.deleteSequence(selseqs[i], false);
204 sgrps[sg].seqs.addElement(sequences[csi]);
207 if (scGroups == null)
209 scGroups = new Vector();
212 scGroups.addElement(sgrps[sg]);
220 // finally, delete the remaining sequences (if any) not selected
221 for (int sg = 0; sg < sgrps.length; sg++)
223 SequenceI[] sqs = sgrps[sg].sg.getSequencesAsArray(null);
224 for (int si = 0; si < sqs.length; si++)
226 sgrps[sg].sg.deleteSequence(sqs[si], false);
233 * construct an alignmentView from a SeqCigarArray. Errors are thrown if the
234 * seqcigararray.isSeqCigarArray() flag is not set.
236 public AlignmentView(CigarArray seqcigararray)
238 if (!seqcigararray.isSeqCigarArray())
241 "Implementation Error - can only make an alignment view from a CigarArray of sequences.");
243 // contigs = seqcigararray.applyDeletions();
244 contigs = seqcigararray.getDeletedRegions();
245 sequences = seqcigararray.getSeqCigarArray();
246 width = seqcigararray.getWidth(); // visible width
250 * Create an alignmentView where the first column corresponds with the
251 * 'firstcol' column of some reference alignment
256 public AlignmentView(CigarArray sdata, int firstcol)
262 public void setSequences(SeqCigar[] sequences)
264 this.sequences = sequences;
267 public void setContigs(int[] contigs)
269 this.contigs = contigs;
272 public SeqCigar[] getSequences()
278 * @see CigarArray.getDeletedRegions
279 * @return int[] { vis_start, sym_start, length }
281 public int[] getContigs()
287 * get the full alignment and a columnselection object marking the hidden
290 * @param gapCharacter
292 * @return Object[] { SequenceI[], ColumnSelection}
294 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
296 ColumnSelection colsel = new ColumnSelection();
300 SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel,
305 * return the visible alignment corresponding to this view. Sequences in this
306 * alignment are edited versions of the parent sequences - where hidden
307 * regions have been removed. NOTE: the sequence data in this alignment is not
313 public AlignmentI getVisibleAlignment(char c)
315 SequenceI[] aln = getVisibleSeqs(c);
317 AlignmentI vcal = new Alignment(aln);
318 addPrunedGroupsInOrder(vcal, -1, -1, true);
323 * add groups from view to the given alignment
329 * -1 or gstart to width-1
331 * - true if vcal is alignment of the visible regions of the view
332 * (e.g. as returned from getVisibleAlignment)
334 private void addPrunedGroupsInOrder(AlignmentI vcal, int gstart,
335 int gend, boolean viscontigs)
338 if (gstart > -1 && gstart <= gend)
343 SequenceI[] aln = vcal.getSequencesArray();
346 * prune any groups to the visible coordinates of the alignment.
349 int nvg = (scGroups != null) ? scGroups.size() : 0;
352 SequenceGroup[] nsg = new SequenceGroup[nvg];
353 for (int g = 0; g < nvg; g++)
355 SequenceGroup sg = ((ScGroup) scGroups.elementAt(g)).sg;
358 if (sg.getStartRes() > gend || sg.getEndRes() < gstart)
366 // clone group properties
367 nsg[g] = new SequenceGroup(sg);
369 // may need to shift/trim start and end ?
370 if (r && !viscontigs)
372 // Not fully tested code - routine not yet called with
374 if (nsg[g].getStartRes() < gstart)
376 nsg[g].setStartRes(0);
380 nsg[g].setStartRes(nsg[g].getStartRes() - gstart);
381 nsg[g].setEndRes(nsg[g].getEndRes() - gstart);
383 if (nsg[g].getEndRes() > (gend - gstart))
385 nsg[g].setEndRes(gend - gstart);
391 // prune groups to cover just the visible positions between
396 ShiftList prune = new ShiftList();
399 // adjust for start of alignment within visible window.
400 prune.addShift(gstart, -gstart); //
402 for (int h = 0; h < contigs.length; h += 3)
405 prune.addShift(p + contigs[h + 1], contigs[h + 2]
408 p = contigs[h + 1] + contigs[h + 2];
410 for (int g = 0; g < nsg.length; g++)
414 int s = nsg[g].getStartRes(), t = nsg[g].getEndRes();
429 nsg[g].setStartRes(s);
436 for (int nsq = 0; nsq < aln.length; nsq++)
438 for (int g = 0; g < nvg; g++)
441 && sequences[nsq].isMemberOf(scGroups.elementAt(g)))
443 nsg[g].addSequence(aln[nsq], false);
447 for (int g = 0; g < nvg; g++)
449 if (nsg[g] != null && nsg[g].getSize() > 0)
451 vcal.addGroup(nsg[g]);
461 * generate sequence array corresponding to the visible parts of the
467 private SequenceI[] getVisibleSeqs(char c)
469 SequenceI[] aln = new SequenceI[sequences.length];
470 for (int i = 0, j = sequences.length; i < j; i++)
472 aln[i] = sequences[i].getSeq('-');
474 // Remove hidden regions from sequence objects.
475 String seqs[] = getSequenceStrings('-');
476 for (int i = 0, j = aln.length; i < j; i++)
478 aln[i].setSequence(seqs[i]);
484 * creates new alignment objects for all contiguous visible segments
489 * @param regionOfInterest
490 * specify which sequences to include (or null to include all
492 * @return AlignmentI[] - all alignments where each sequence is a subsequence
493 * constructed from visible contig regions of view
495 public AlignmentI[] getVisibleContigAlignments(char c)
498 int[] vcontigs = getVisibleContigs();
499 SequenceI[][] contigviews = getVisibleContigs(c);
500 AlignmentI[] vcals = new AlignmentI[contigviews.length];
501 for (nvc = 0; nvc < contigviews.length; nvc++)
503 vcals[nvc] = new Alignment(contigviews[nvc]);
504 if (scGroups != null && scGroups.size() > 0)
506 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
507 vcontigs[nvc * 2 + 1], true);
514 * get an array of visible sequence strings for a view on an alignment using
515 * the given gap character
521 public String[] getSequenceStrings(char c)
523 String[] seqs = new String[sequences.length];
524 for (int n = 0; n < sequences.length; n++)
526 String fullseq = sequences[n].getSequenceString(c);
531 for (int h = 0; h < contigs.length; h += 3)
533 seqs[n] += fullseq.substring(p, contigs[h + 1]);
534 p = contigs[h + 1] + contigs[h + 2];
536 seqs[n] += fullseq.substring(p);
548 * @return visible number of columns in alignment view
550 public int getWidth()
555 protected void setWidth(int width)
561 * get the contiguous subalignments in an alignment view.
563 * @param gapCharacter
565 * @return SequenceI[][]
567 public SequenceI[][] getVisibleContigs(char gapCharacter)
571 if (sequences == null || width <= 0)
575 if (contigs != null && contigs.length > 0)
580 for (int contig = 0; contig < contigs.length; contig += 3)
582 if ((contigs[contig + 1] - start) > 0)
586 fwidth += contigs[contig + 2]; // end up with full region width
587 // (including hidden regions)
588 start = contigs[contig + 1] + contigs[contig + 2];
594 smsa = new SequenceI[njobs][];
597 for (int contig = 0; contig < contigs.length; contig += 3)
599 if (contigs[contig + 1] - start > 0)
601 SequenceI mseq[] = new SequenceI[sequences.length];
602 for (int s = 0; s < mseq.length; s++)
604 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
605 start, contigs[contig + 1]);
610 start = contigs[contig + 1] + contigs[contig + 2];
614 SequenceI mseq[] = new SequenceI[sequences.length];
615 for (int s = 0; s < mseq.length; s++)
617 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
626 smsa = new SequenceI[1][];
627 smsa[0] = new SequenceI[sequences.length];
628 for (int s = 0; s < sequences.length; s++)
630 smsa[0][s] = sequences[s].getSeq(gapCharacter);
637 * return full msa and hidden regions with visible blocks replaced with new
643 * AlignmentOrder[] corresponding to each SequenceI[] block.
646 public Object[] getUpdatedView(SequenceI[][] nvismsa,
647 AlignmentOrder[] orders, char gapCharacter)
649 if (sequences == null || width <= 0)
651 throw new Error("empty view cannot be updated.");
656 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
658 if (contigs != null && contigs.length > 0)
660 SequenceI[] alignment = new SequenceI[sequences.length];
661 ColumnSelection columnselection = new ColumnSelection();
662 if (contigs != null && contigs.length > 0)
668 for (int contig = 0; contig < contigs.length; contig += 3)
670 owidth += contigs[contig + 2]; // recover final column width
671 if (contigs[contig + 1] - start > 0)
673 int swidth = 0; // subalignment width
674 if (nvismsa[j] != null)
676 SequenceI mseq[] = nvismsa[j];
677 AlignmentOrder order = (orders == null) ? null : orders[j];
679 if (mseq.length != sequences.length)
682 "Mismatch between number of sequences in block "
683 + j + " (" + mseq.length
684 + ") and the original view ("
685 + sequences.length + ")");
687 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
689 for (int s = 0; s < mseq.length; s++)
691 if (alignment[s] == null)
693 alignment[s] = mseq[s];
697 alignment[s].setSequence(alignment[s]
698 .getSequenceAsString()
699 + mseq[s].getSequenceAsString());
700 if (mseq[s].getStart() <= mseq[s].getEnd())
702 alignment[s].setEnd(mseq[s].getEnd());
706 order.updateSequence(mseq[s], alignment[s]);
713 // recover original alignment block or place gaps
716 // recover input data
717 for (int s = 0; s < sequences.length; s++)
719 SequenceI oseq = sequences[s].getSeq(gapCharacter)
720 .getSubSequence(start, contigs[contig + 1]);
721 if (swidth < oseq.getLength())
723 swidth = oseq.getLength();
725 if (alignment[s] == null)
731 alignment[s].setSequence(alignment[s]
732 .getSequenceAsString()
733 + oseq.getSequenceAsString());
734 if (oseq.getEnd() >= oseq.getStart())
736 alignment[s].setEnd(oseq.getEnd());
746 // advance to begining of visible region
747 start = contigs[contig + 1] + contigs[contig + 2];
748 // add hidden segment to right of next region
749 for (int s = 0; s < sequences.length; s++)
751 SequenceI hseq = sequences[s].getSeq(gapCharacter)
752 .getSubSequence(contigs[contig + 1], start);
753 if (alignment[s] == null)
759 alignment[s].setSequence(alignment[s].getSequenceAsString()
760 + hseq.getSequenceAsString());
761 if (hseq.getEnd() >= hseq.getStart())
763 alignment[s].setEnd(hseq.getEnd());
767 // mark hidden segment as hidden in the new alignment
768 columnselection.hideColumns(nwidth, nwidth + contigs[contig + 2]
770 nwidth += contigs[contig + 2];
772 // Do final segment - if it exists
773 if (j < nvismsa.length)
776 if (nvismsa[j] != null)
778 SequenceI mseq[] = nvismsa[j];
779 AlignmentOrder order = (orders != null) ? orders[j] : null;
780 swidth = mseq[0].getLength();
781 for (int s = 0; s < mseq.length; s++)
783 if (alignment[s] == null)
785 alignment[s] = mseq[s];
789 alignment[s].setSequence(alignment[s].getSequenceAsString()
790 + mseq[s].getSequenceAsString());
791 if (mseq[s].getEnd() >= mseq[s].getStart())
793 alignment[s].setEnd(mseq[s].getEnd());
797 order.updateSequence(mseq[s], alignment[s]);
806 // recover input data or place gaps
809 // recover input data
810 for (int s = 0; s < sequences.length; s++)
812 SequenceI oseq = sequences[s].getSeq(gapCharacter)
813 .getSubSequence(start, owidth + 1);
814 if (swidth < oseq.getLength())
816 swidth = oseq.getLength();
818 if (alignment[s] == null)
824 alignment[s].setSequence(alignment[s]
825 .getSequenceAsString()
826 + oseq.getSequenceAsString());
827 if (oseq.getEnd() >= oseq.getStart())
829 alignment[s].setEnd(oseq.getEnd());
838 throw new Error("Padding not yet implemented.");
845 { alignment, columnselection };
849 if (nvismsa.length != 1)
852 "Mismatch between visible blocks to update and number of contigs in view (contigs=0,blocks="
855 if (nvismsa[0] != null)
858 { nvismsa[0], new ColumnSelection() };
862 return getAlignmentAndColumnSelection(gapCharacter);
868 * returns simple array of start end positions of visible range on alignment.
869 * vis_start and vis_end are inclusive - use
870 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
871 * from underlying alignment.
873 * @return int[] { start_i, end_i } for 1<i<n visible regions.
875 public int[] getVisibleContigs()
877 if (contigs != null && contigs.length > 0)
882 for (int contig = 0; contig < contigs.length; contig += 3)
884 if ((contigs[contig + 1] - start) > 0)
888 fwidth += contigs[contig + 2]; // end up with full region width
889 // (including hidden regions)
890 start = contigs[contig + 1] + contigs[contig + 2];
896 int viscontigs[] = new int[nvis * 2];
899 for (int contig = 0; contig < contigs.length; contig += 3)
901 if ((contigs[contig + 1] - start) > 0)
903 viscontigs[nvis] = start;
904 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
907 start = contigs[contig + 1] + contigs[contig + 2];
911 viscontigs[nvis] = start;
912 viscontigs[nvis + 1] = fwidth; // end is inclusive
926 * @return position of first visible column of AlignmentView within its
927 * parent's alignment reference frame
929 public int getAlignmentOrigin()
935 * compute a deletion map for the current view according to the given
939 * (as returned from SequenceI.gapMap())
940 * @return int[] {intersection of visible regions with gapMap)
942 public int[] getVisibleContigMapFor(int[] gapMap)
945 int[] viscontigs = getVisibleContigs();
948 if (viscontigs != null)
950 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
951 // always be equal to or shorter than gapMap
952 delMap = new int[gapMap.length];
953 for (int contig = 0; contig < viscontigs.length; contig += 2)
956 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
960 while (spos < gapMap.length
961 && gapMap[spos] <= viscontigs[contig + 1])
963 delMap[i++] = spos++;
966 int tmap[] = new int[i];
967 System.arraycopy(delMap, 0, tmap, 0, i);
974 * apply the getSeq(gc) method to each sequence cigar, and return the array of
975 * edited sequences, optionally with hidden regions removed.
978 * gap character to use for insertions
980 * remove hidden regions from sequences. Note: currently implemented
981 * in a memory inefficient way - space needed is 2*result set for
984 * @return SequenceI[]
986 public SequenceI[] getEditedSequences(char gc, boolean delete)
988 SeqCigar[] msf = getSequences();
989 SequenceI[] aln = new SequenceI[msf.length];
990 for (int i = 0, j = msf.length; i < j; i++)
992 aln[i] = msf[i].getSeq(gc);
996 String[] sqs = getSequenceStrings(gc);
997 for (int i = 0; i < sqs.length; i++)
999 aln[i].setSequence(sqs[i]);
1006 public static void summariseAlignmentView(AlignmentView view,
1009 os.print("View has " + view.sequences.length + " of which ");
1010 if (view.selected == null)
1016 os.print(" " + view.selected.size());
1018 os.println(" are selected.");
1019 os.print("View is " + view.getWidth() + " columns wide");
1021 int[] contigs = view.getContigs();
1022 if (contigs != null)
1024 viswid = view.width;
1025 for (int i = 0; i < contigs.length; i += 3)
1027 viswid += contigs[i + 2];
1029 os.println("with " + viswid + " visible columns spread over "
1030 + contigs.length / 3 + " regions.");
1034 viswid = view.width;
1037 if (view.scGroups != null)
1039 os.println("There are " + view.scGroups.size()
1040 + " groups defined on the view.");
1041 for (int g = 0; g < view.scGroups.size(); g++)
1043 ScGroup sgr = (ScGroup) view.scGroups.elementAt(g);
1044 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1045 + " Contains " + sgr.seqs.size() + " Seqs.");
1046 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1047 + sgr.sg.getEndRes());
1048 for (int s = 0; s < sgr.seqs.size(); s++)
1050 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1052 os.println("** WARNING: sequence "
1053 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1054 + " is not marked as member of group.");
1058 AlignmentI visal = view.getVisibleAlignment('-');
1061 os.println("Vis. alignment is " + visal.getWidth()
1062 + " wide and has " + visal.getHeight() + " seqs.");
1063 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1067 for (SequenceGroup sg : visal.getGroups())
1069 os.println("Group " + (i++) + " begins at column "
1070 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1077 public static void testSelectionViews(AlignmentI alignment,
1078 ColumnSelection csel, SequenceGroup selection)
1080 System.out.println("Testing standard view creation:\n");
1081 AlignmentView view = null;
1085 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1086 view = new AlignmentView(alignment, csel, selection, false, false,
1088 summariseAlignmentView(view, System.out);
1090 } catch (Exception e)
1092 e.printStackTrace();
1094 .println("Failed to generate alignment with selection but no groups marked.");
1099 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1100 view = new AlignmentView(alignment, csel, selection, false, false,
1102 summariseAlignmentView(view, System.out);
1103 } catch (Exception e)
1105 e.printStackTrace();
1107 .println("Failed to generate alignment with selection marked but no groups marked.");
1112 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1113 view = new AlignmentView(alignment, csel, selection, false, true,
1115 summariseAlignmentView(view, System.out);
1116 } catch (Exception e)
1118 e.printStackTrace();
1120 .println("Failed to generate alignment with selection restricted but no groups marked.");
1125 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1126 view = new AlignmentView(alignment, csel, selection, false, true,
1128 summariseAlignmentView(view, System.out);
1129 } catch (Exception e)
1131 e.printStackTrace();
1133 .println("Failed to generate alignment with selection restricted and groups marked.");
1138 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1139 view = new AlignmentView(alignment, csel, selection, true, false,
1141 summariseAlignmentView(view, System.out);
1142 } catch (Exception e)
1144 e.printStackTrace();
1146 .println("Failed to generate alignment with selection but no groups marked.");
1151 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1152 view = new AlignmentView(alignment, csel, selection, true, false,
1154 summariseAlignmentView(view, System.out);
1155 } catch (Exception e)
1157 e.printStackTrace();
1159 .println("Failed to generate alignment with selection marked but no groups marked.");
1164 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1165 view = new AlignmentView(alignment, csel, selection, true, true,
1167 summariseAlignmentView(view, System.out);
1168 } catch (Exception e)
1170 e.printStackTrace();
1172 .println("Failed to generate alignment with selection restricted but no groups marked.");
1177 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1178 view = new AlignmentView(alignment, csel, selection, true, true, true);
1179 summariseAlignmentView(view, System.out);
1180 } catch (Exception e)
1182 e.printStackTrace();
1184 .println("Failed to generate alignment with selection restricted and groups marked.");