2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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/>.
18 package jalview.datamodel;
20 import jalview.util.ShiftList;
22 import java.io.PrintStream;
23 import java.util.Enumeration;
24 import java.util.List;
25 import java.util.Vector;
28 * Transient object compactly representing a 'view' of an alignment - with
29 * discontinuities marked. Extended in Jalview 2.7 to optionally record sequence
30 * groups and specific selected regions on the alignment.
32 public class AlignmentView
34 private SeqCigar[] sequences = null;
36 private int[] contigs = null;
38 private int width = 0;
40 private int firstCol = 0;
43 * one or more ScGroup objects, which are referenced by each seqCigar's group
46 private Vector scGroups;
49 * Group defined over SeqCigars. Unlike AlignmentI associated groups, each
50 * SequenceGroup hold just the essential properties for the group, but no
51 * references to the sequences involved. SeqCigars hold references to the
52 * seuqenceGroup entities themselves.
58 public SequenceGroup sg;
67 * vector of selected seqCigars. This vector is also referenced by each
68 * seqCigar contained in it.
70 private Vector selected;
73 * Construct an alignmentView from a live jalview alignment view. Note -
74 * hidden rows will be excluded from alignmentView Note: JAL-1179
77 * - alignment as referenced by an AlignViewport
78 * @param columnSelection
81 * @param hasHiddenColumns
82 * - mark the hidden columns in columnSelection as hidden in the view
83 * @param selectedRegionOnly
84 * - when set, only include the selected region in the view,
85 * otherwise just mark the selected region on the constructed view.
87 * - when set, any groups on the given alignment will be marked on
90 public AlignmentView(AlignmentI alignment,
91 ColumnSelection columnSelection, SequenceGroup selection,
92 boolean hasHiddenColumns, boolean selectedRegionOnly,
95 // refactored from AlignViewport.getAlignmentView(selectedOnly);
96 this(new jalview.datamodel.CigarArray(alignment,
97 (hasHiddenColumns ? columnSelection : null),
98 (selectedRegionOnly ? selection : null)),
99 (selectedRegionOnly && selection != null) ? selection
101 // walk down SeqCigar array and Alignment Array - optionally restricted by
103 // test group membership for each sequence in each group, store membership
104 // and record non-empty groups in group list.
105 // record / sub-select selected region on the alignment view
107 if (selection != null && selection.getSize() > 0)
109 List<SequenceI> sel = selection.getSequences(null);
110 this.selected = new Vector();
112 .getSequencesInOrder(alignment, selectedRegionOnly);
116 selseqs = alignment.getSequencesArray();
119 // get the alignment's group list and make a copy
120 Vector grps = new Vector();
121 List<SequenceGroup> gg = alignment.getGroups();
123 ScGroup[] sgrps = null;
124 boolean addedgps[] = null;
128 if (selection != null && selectedRegionOnly)
130 // trim annotation to the region being stored.
131 // strip out any groups that do not actually intersect with the
132 // visible and selected region
133 int ssel = selection.getStartRes(), esel = selection.getEndRes();
134 Vector isg = new Vector();
135 Enumeration en = grps.elements();
136 while (en.hasMoreElements())
138 sg = (SequenceGroup) en.nextElement();
140 if (!(sg.getStartRes() > esel || sg.getEndRes() < ssel))
142 // adjust bounds of new group, if necessary.
143 if (sg.getStartRes() < ssel)
145 sg.setStartRes(ssel);
147 if (sg.getEndRes() > esel)
151 sg.setStartRes(sg.getStartRes() - ssel + 1);
152 sg.setEndRes(sg.getEndRes() - ssel + 1);
160 sgrps = new ScGroup[grps.size()];
161 addedgps = new boolean[grps.size()];
162 for (int g = 0; g < sgrps.length; g++)
164 sg = (SequenceGroup) grps.elementAt(g);
165 sgrps[g] = new ScGroup();
166 sgrps[g].sg = new SequenceGroup(sg);
168 grps.setElementAt(sg.getSequences(null), g);
170 // grps now contains vectors (should be sets) for each group, so we can
171 // track when we've done with the group
174 for (int i = 0; i < selseqs.length; i++)
176 if (selseqs[i] != null)
178 if (selection != null && selection.getSize() > 0
179 && !selectedRegionOnly)
181 sequences[csi].setGroupMembership(selected);
182 selected.addElement(sequences[csi]);
186 for (int sg = 0; sg < sgrps.length; sg++)
188 if (((Vector) grps.elementAt(sg)).contains(selseqs[i]))
190 sequences[csi].setGroupMembership(sgrps[sg]);
191 sgrps[sg].sg.deleteSequence(selseqs[i], false);
192 sgrps[sg].seqs.addElement(sequences[csi]);
195 if (scGroups == null)
197 scGroups = new Vector();
200 scGroups.addElement(sgrps[sg]);
208 // finally, delete the remaining sequences (if any) not selected
209 for (int sg = 0; sg < sgrps.length; sg++)
211 SequenceI[] sqs = sgrps[sg].sg.getSequencesAsArray(null);
212 for (int si = 0; si < sqs.length; si++)
214 sgrps[sg].sg.deleteSequence(sqs[si], false);
221 * construct an alignmentView from a SeqCigarArray. Errors are thrown if the
222 * seqcigararray.isSeqCigarArray() flag is not set.
224 public AlignmentView(CigarArray seqcigararray)
226 if (!seqcigararray.isSeqCigarArray())
229 "Implementation Error - can only make an alignment view from a CigarArray of sequences.");
231 // contigs = seqcigararray.applyDeletions();
232 contigs = seqcigararray.getDeletedRegions();
233 sequences = seqcigararray.getSeqCigarArray();
234 width = seqcigararray.getWidth(); // visible width
238 * Create an alignmentView where the first column corresponds with the
239 * 'firstcol' column of some reference alignment
244 public AlignmentView(CigarArray sdata, int firstcol)
250 public void setSequences(SeqCigar[] sequences)
252 this.sequences = sequences;
255 public void setContigs(int[] contigs)
257 this.contigs = contigs;
260 public SeqCigar[] getSequences()
266 * @see CigarArray.getDeletedRegions
267 * @return int[] { vis_start, sym_start, length }
269 public int[] getContigs()
275 * get the full alignment and a columnselection object marking the hidden
278 * @param gapCharacter
280 * @return Object[] { SequenceI[], ColumnSelection}
282 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
284 ColumnSelection colsel = new ColumnSelection();
288 SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel,
293 * return the visible alignment corresponding to this view. Sequences in this
294 * alignment are edited versions of the parent sequences - where hidden
295 * regions have been removed. NOTE: the sequence data in this alignment is not
301 public AlignmentI getVisibleAlignment(char c)
303 SequenceI[] aln = getVisibleSeqs(c);
305 AlignmentI vcal = new Alignment(aln);
306 addPrunedGroupsInOrder(vcal, -1, -1, true);
311 * add groups from view to the given alignment
317 * -1 or gstart to width-1
319 * - true if vcal is alignment of the visible regions of the view
320 * (e.g. as returned from getVisibleAlignment)
322 private void addPrunedGroupsInOrder(AlignmentI vcal, int gstart,
323 int gend, boolean viscontigs)
326 if (gstart > -1 && gstart <= gend)
331 SequenceI[] aln = vcal.getSequencesArray();
334 * prune any groups to the visible coordinates of the alignment.
337 int nvg = (scGroups != null) ? scGroups.size() : 0;
340 SequenceGroup[] nsg = new SequenceGroup[nvg];
341 for (int g = 0; g < nvg; g++)
343 SequenceGroup sg = ((ScGroup) scGroups.elementAt(g)).sg;
346 if (sg.getStartRes() > gend || sg.getEndRes() < gstart)
354 // clone group properties
355 nsg[g] = new SequenceGroup(sg);
357 // may need to shift/trim start and end ?
358 if (r && !viscontigs)
360 // Not fully tested code - routine not yet called with
362 if (nsg[g].getStartRes() < gstart)
364 nsg[g].setStartRes(0);
368 nsg[g].setStartRes(nsg[g].getStartRes() - gstart);
369 nsg[g].setEndRes(nsg[g].getEndRes() - gstart);
371 if (nsg[g].getEndRes() > (gend - gstart))
373 nsg[g].setEndRes(gend - gstart);
379 // prune groups to cover just the visible positions between
384 ShiftList prune = new ShiftList();
387 // adjust for start of alignment within visible window.
388 prune.addShift(gstart, -gstart); //
390 for (int h = 0; h < contigs.length; h += 3)
393 prune.addShift(p + contigs[h + 1], contigs[h + 2]
396 p = contigs[h + 1] + contigs[h + 2];
398 for (int g = 0; g < nsg.length; g++)
402 int s = nsg[g].getStartRes(), t = nsg[g].getEndRes();
417 nsg[g].setStartRes(s);
424 for (int nsq = 0; nsq < aln.length; nsq++)
426 for (int g = 0; g < nvg; g++)
429 && sequences[nsq].isMemberOf(scGroups.elementAt(g)))
431 nsg[g].addSequence(aln[nsq], false);
435 for (int g = 0; g < nvg; g++)
437 if (nsg[g] != null && nsg[g].getSize() > 0)
439 vcal.addGroup(nsg[g]);
449 * generate sequence array corresponding to the visible parts of the
455 private SequenceI[] getVisibleSeqs(char c)
457 SequenceI[] aln = new SequenceI[sequences.length];
458 for (int i = 0, j = sequences.length; i < j; i++)
460 aln[i] = sequences[i].getSeq('-');
462 // Remove hidden regions from sequence objects.
463 String seqs[] = getSequenceStrings('-');
464 for (int i = 0, j = aln.length; i < j; i++)
466 aln[i].setSequence(seqs[i]);
472 * creates new alignment objects for all contiguous visible segments
477 * @param regionOfInterest
478 * specify which sequences to include (or null to include all
480 * @return AlignmentI[] - all alignments where each sequence is a subsequence
481 * constructed from visible contig regions of view
483 public AlignmentI[] getVisibleContigAlignments(char c)
486 int[] vcontigs = getVisibleContigs();
487 SequenceI[][] contigviews = getVisibleContigs(c);
488 AlignmentI[] vcals = new AlignmentI[contigviews.length];
489 for (nvc = 0; nvc < contigviews.length; nvc++)
491 vcals[nvc] = new Alignment(contigviews[nvc]);
492 if (scGroups != null && scGroups.size() > 0)
494 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
495 vcontigs[nvc * 2 + 1], true);
502 * get an array of visible sequence strings for a view on an alignment using
503 * the given gap character
509 public String[] getSequenceStrings(char c)
511 String[] seqs = new String[sequences.length];
512 for (int n = 0; n < sequences.length; n++)
514 String fullseq = sequences[n].getSequenceString(c);
519 for (int h = 0; h < contigs.length; h += 3)
521 seqs[n] += fullseq.substring(p, contigs[h + 1]);
522 p = contigs[h + 1] + contigs[h + 2];
524 seqs[n] += fullseq.substring(p);
536 * @return visible number of columns in alignment view
538 public int getWidth()
543 protected void setWidth(int width)
549 * get the contiguous subalignments in an alignment view.
551 * @param gapCharacter
553 * @return SequenceI[][]
555 public SequenceI[][] getVisibleContigs(char gapCharacter)
559 if (sequences == null || width <= 0)
563 if (contigs != null && contigs.length > 0)
568 for (int contig = 0; contig < contigs.length; contig += 3)
570 if ((contigs[contig + 1] - start) > 0)
574 fwidth += contigs[contig + 2]; // end up with full region width
575 // (including hidden regions)
576 start = contigs[contig + 1] + contigs[contig + 2];
582 smsa = new SequenceI[njobs][];
585 for (int contig = 0; contig < contigs.length; contig += 3)
587 if (contigs[contig + 1] - start > 0)
589 SequenceI mseq[] = new SequenceI[sequences.length];
590 for (int s = 0; s < mseq.length; s++)
592 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
593 start, contigs[contig + 1]);
598 start = contigs[contig + 1] + contigs[contig + 2];
602 SequenceI mseq[] = new SequenceI[sequences.length];
603 for (int s = 0; s < mseq.length; s++)
605 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
614 smsa = new SequenceI[1][];
615 smsa[0] = new SequenceI[sequences.length];
616 for (int s = 0; s < sequences.length; s++)
618 smsa[0][s] = sequences[s].getSeq(gapCharacter);
625 * return full msa and hidden regions with visible blocks replaced with new
631 * AlignmentOrder[] corresponding to each SequenceI[] block.
634 public Object[] getUpdatedView(SequenceI[][] nvismsa,
635 AlignmentOrder[] orders, char gapCharacter)
637 if (sequences == null || width <= 0)
639 throw new Error("empty view cannot be updated.");
644 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
646 if (contigs != null && contigs.length > 0)
648 SequenceI[] alignment = new SequenceI[sequences.length];
649 ColumnSelection columnselection = new ColumnSelection();
650 if (contigs != null && contigs.length > 0)
656 for (int contig = 0; contig < contigs.length; contig += 3)
658 owidth += contigs[contig + 2]; // recover final column width
659 if (contigs[contig + 1] - start > 0)
661 int swidth = 0; // subalignment width
662 if (nvismsa[j] != null)
664 SequenceI mseq[] = nvismsa[j];
665 AlignmentOrder order = (orders == null) ? null : orders[j];
667 if (mseq.length != sequences.length)
670 "Mismatch between number of sequences in block "
671 + j + " (" + mseq.length
672 + ") and the original view ("
673 + sequences.length + ")");
675 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
677 for (int s = 0; s < mseq.length; s++)
679 if (alignment[s] == null)
681 alignment[s] = mseq[s];
685 alignment[s].setSequence(alignment[s]
686 .getSequenceAsString()
687 + mseq[s].getSequenceAsString());
688 if (mseq[s].getStart() <= mseq[s].getEnd())
690 alignment[s].setEnd(mseq[s].getEnd());
694 order.updateSequence(mseq[s], alignment[s]);
701 // recover original alignment block or place gaps
704 // recover input data
705 for (int s = 0; s < sequences.length; s++)
707 SequenceI oseq = sequences[s].getSeq(gapCharacter)
708 .getSubSequence(start, contigs[contig + 1]);
709 if (swidth < oseq.getLength())
711 swidth = oseq.getLength();
713 if (alignment[s] == null)
719 alignment[s].setSequence(alignment[s]
720 .getSequenceAsString()
721 + oseq.getSequenceAsString());
722 if (oseq.getEnd() >= oseq.getStart())
724 alignment[s].setEnd(oseq.getEnd());
734 // advance to begining of visible region
735 start = contigs[contig + 1] + contigs[contig + 2];
736 // add hidden segment to right of next region
737 for (int s = 0; s < sequences.length; s++)
739 SequenceI hseq = sequences[s].getSeq(gapCharacter)
740 .getSubSequence(contigs[contig + 1], start);
741 if (alignment[s] == null)
747 alignment[s].setSequence(alignment[s].getSequenceAsString()
748 + hseq.getSequenceAsString());
749 if (hseq.getEnd() >= hseq.getStart())
751 alignment[s].setEnd(hseq.getEnd());
755 // mark hidden segment as hidden in the new alignment
756 columnselection.hideColumns(nwidth, nwidth + contigs[contig + 2]
758 nwidth += contigs[contig + 2];
760 // Do final segment - if it exists
761 if (j < nvismsa.length)
764 if (nvismsa[j] != null)
766 SequenceI mseq[] = nvismsa[j];
767 AlignmentOrder order = (orders != null) ? orders[j] : null;
768 swidth = mseq[0].getLength();
769 for (int s = 0; s < mseq.length; s++)
771 if (alignment[s] == null)
773 alignment[s] = mseq[s];
777 alignment[s].setSequence(alignment[s].getSequenceAsString()
778 + mseq[s].getSequenceAsString());
779 if (mseq[s].getEnd() >= mseq[s].getStart())
781 alignment[s].setEnd(mseq[s].getEnd());
785 order.updateSequence(mseq[s], alignment[s]);
794 // recover input data or place gaps
797 // recover input data
798 for (int s = 0; s < sequences.length; s++)
800 SequenceI oseq = sequences[s].getSeq(gapCharacter)
801 .getSubSequence(start, owidth + 1);
802 if (swidth < oseq.getLength())
804 swidth = oseq.getLength();
806 if (alignment[s] == null)
812 alignment[s].setSequence(alignment[s]
813 .getSequenceAsString()
814 + oseq.getSequenceAsString());
815 if (oseq.getEnd() >= oseq.getStart())
817 alignment[s].setEnd(oseq.getEnd());
826 throw new Error("Padding not yet implemented.");
833 { alignment, columnselection };
837 if (nvismsa.length != 1)
840 "Mismatch between visible blocks to update and number of contigs in view (contigs=0,blocks="
843 if (nvismsa[0] != null)
846 { nvismsa[0], new ColumnSelection() };
850 return getAlignmentAndColumnSelection(gapCharacter);
856 * returns simple array of start end positions of visible range on alignment.
857 * vis_start and vis_end are inclusive - use
858 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
859 * from underlying alignment.
861 * @return int[] { start_i, end_i } for 1<i<n visible regions.
863 public int[] getVisibleContigs()
865 if (contigs != null && contigs.length > 0)
870 for (int contig = 0; contig < contigs.length; contig += 3)
872 if ((contigs[contig + 1] - start) > 0)
876 fwidth += contigs[contig + 2]; // end up with full region width
877 // (including hidden regions)
878 start = contigs[contig + 1] + contigs[contig + 2];
884 int viscontigs[] = new int[nvis * 2];
887 for (int contig = 0; contig < contigs.length; contig += 3)
889 if ((contigs[contig + 1] - start) > 0)
891 viscontigs[nvis] = start;
892 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
895 start = contigs[contig + 1] + contigs[contig + 2];
899 viscontigs[nvis] = start;
900 viscontigs[nvis + 1] = fwidth; // end is inclusive
914 * @return position of first visible column of AlignmentView within its
915 * parent's alignment reference frame
917 public int getAlignmentOrigin()
923 * compute a deletion map for the current view according to the given
927 * (as returned from SequenceI.gapMap())
928 * @return int[] {intersection of visible regions with gapMap)
930 public int[] getVisibleContigMapFor(int[] gapMap)
933 int[] viscontigs = getVisibleContigs();
936 if (viscontigs != null)
938 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
939 // always be equal to or shorter than gapMap
940 delMap = new int[gapMap.length];
941 for (int contig = 0; contig < viscontigs.length; contig += 2)
944 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
948 while (spos < gapMap.length
949 && gapMap[spos] <= viscontigs[contig + 1])
951 delMap[i++] = spos++;
954 int tmap[] = new int[i];
955 System.arraycopy(delMap, 0, tmap, 0, i);
962 * apply the getSeq(gc) method to each sequence cigar, and return the array of
963 * edited sequences, optionally with hidden regions removed.
966 * gap character to use for insertions
968 * remove hidden regions from sequences. Note: currently implemented
969 * in a memory inefficient way - space needed is 2*result set for
972 * @return SequenceI[]
974 public SequenceI[] getEditedSequences(char gc, boolean delete)
976 SeqCigar[] msf = getSequences();
977 SequenceI[] aln = new SequenceI[msf.length];
978 for (int i = 0, j = msf.length; i < j; i++)
980 aln[i] = msf[i].getSeq(gc);
984 String[] sqs = getSequenceStrings(gc);
985 for (int i = 0; i < sqs.length; i++)
987 aln[i].setSequence(sqs[i]);
994 public static void summariseAlignmentView(AlignmentView view,
997 os.print("View has " + view.sequences.length + " of which ");
998 if (view.selected == null)
1004 os.print(" " + view.selected.size());
1006 os.println(" are selected.");
1007 os.print("View is " + view.getWidth() + " columns wide");
1009 int[] contigs = view.getContigs();
1010 if (contigs != null)
1012 viswid = view.width;
1013 for (int i = 0; i < contigs.length; i += 3)
1015 viswid += contigs[i + 2];
1017 os.println("with " + viswid + " visible columns spread over "
1018 + contigs.length / 3 + " regions.");
1022 viswid = view.width;
1025 if (view.scGroups != null)
1027 os.println("There are " + view.scGroups.size()
1028 + " groups defined on the view.");
1029 for (int g = 0; g < view.scGroups.size(); g++)
1031 ScGroup sgr = (ScGroup) view.scGroups.elementAt(g);
1032 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1033 + " Contains " + sgr.seqs.size() + " Seqs.");
1034 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1035 + sgr.sg.getEndRes());
1036 for (int s = 0; s < sgr.seqs.size(); s++)
1038 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1040 os.println("** WARNING: sequence "
1041 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1042 + " is not marked as member of group.");
1046 AlignmentI visal = view.getVisibleAlignment('-');
1049 os.println("Vis. alignment is " + visal.getWidth()
1050 + " wide and has " + visal.getHeight() + " seqs.");
1051 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1055 for (SequenceGroup sg : visal.getGroups())
1057 os.println("Group " + (i++) + " begins at column "
1058 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1065 public static void testSelectionViews(AlignmentI alignment,
1066 ColumnSelection csel, SequenceGroup selection)
1068 System.out.println("Testing standard view creation:\n");
1069 AlignmentView view = null;
1073 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1074 view = new AlignmentView(alignment, csel, selection, false, false,
1076 summariseAlignmentView(view, System.out);
1078 } catch (Exception e)
1080 e.printStackTrace();
1082 .println("Failed to generate alignment with selection but no groups marked.");
1087 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1088 view = new AlignmentView(alignment, csel, selection, false, false,
1090 summariseAlignmentView(view, System.out);
1091 } catch (Exception e)
1093 e.printStackTrace();
1095 .println("Failed to generate alignment with selection marked but no groups marked.");
1100 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1101 view = new AlignmentView(alignment, csel, selection, false, true,
1103 summariseAlignmentView(view, System.out);
1104 } catch (Exception e)
1106 e.printStackTrace();
1108 .println("Failed to generate alignment with selection restricted but no groups marked.");
1113 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1114 view = new AlignmentView(alignment, csel, selection, false, true,
1116 summariseAlignmentView(view, System.out);
1117 } catch (Exception e)
1119 e.printStackTrace();
1121 .println("Failed to generate alignment with selection restricted and groups marked.");
1126 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1127 view = new AlignmentView(alignment, csel, selection, true, false,
1129 summariseAlignmentView(view, System.out);
1130 } catch (Exception e)
1132 e.printStackTrace();
1134 .println("Failed to generate alignment with selection but no groups marked.");
1139 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1140 view = new AlignmentView(alignment, csel, selection, true, false,
1142 summariseAlignmentView(view, System.out);
1143 } catch (Exception e)
1145 e.printStackTrace();
1147 .println("Failed to generate alignment with selection marked but no groups marked.");
1152 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1153 view = new AlignmentView(alignment, csel, selection, true, true,
1155 summariseAlignmentView(view, System.out);
1156 } catch (Exception e)
1158 e.printStackTrace();
1160 .println("Failed to generate alignment with selection restricted but no groups marked.");
1165 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1166 view = new AlignmentView(alignment, csel, selection, true, true, true);
1167 summariseAlignmentView(view, System.out);
1168 } catch (Exception e)
1170 e.printStackTrace();
1172 .println("Failed to generate alignment with selection restricted and groups marked.");