2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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.MessageManager;
24 import jalview.util.ShiftList;
26 import java.io.PrintStream;
27 import java.util.ArrayList;
28 import java.util.List;
29 import java.util.Vector;
32 * Transient object compactly representing a 'view' of an alignment - with
33 * discontinuities marked. Extended in Jalview 2.7 to optionally record sequence
34 * groups and specific selected regions on the alignment.
36 public class AlignmentView
38 private SeqCigar[] sequences = null;
40 private int[] contigs = null;
42 private int width = 0;
44 private int firstCol = 0;
47 * one or more ScGroup objects, which are referenced by each seqCigar's group
50 private List<ScGroup> scGroups = null;
52 private boolean isNa = false;
55 * false if the view concerns peptides
65 * Group defined over SeqCigars. Unlike AlignmentI associated groups, each
66 * SequenceGroup hold just the essential properties for the group, but no
67 * references to the sequences involved. SeqCigars hold references to the
68 * seuqenceGroup entities themselves.
74 public SequenceGroup sg;
83 * vector of selected seqCigars. This vector is also referenced by each
84 * seqCigar contained in it.
86 private Vector selected;
89 * Construct an alignmentView from a live jalview alignment view. Note -
90 * hidden rows will be excluded from alignmentView Note: JAL-1179
93 * - alignment as referenced by an AlignViewport
94 * @param columnSelection
97 * @param hasHiddenColumns
98 * - mark the hidden columns in columnSelection as hidden in the view
99 * @param selectedRegionOnly
100 * - when set, only include the selected region in the view,
101 * otherwise just mark the selected region on the constructed view.
102 * @param recordGroups
103 * - when set, any groups on the given alignment will be marked on
106 public AlignmentView(AlignmentI alignment,
107 ColumnSelection columnSelection, SequenceGroup selection,
108 boolean hasHiddenColumns, boolean selectedRegionOnly,
109 boolean recordGroups)
111 // refactored from AlignViewport.getAlignmentView(selectedOnly);
112 this(new jalview.datamodel.CigarArray(alignment,
113 (hasHiddenColumns ? columnSelection : null),
114 (selectedRegionOnly ? selection : null)),
115 (selectedRegionOnly && selection != null) ? selection
117 isNa = alignment.isNucleotide();
118 // walk down SeqCigar array and Alignment Array - optionally restricted by
120 // test group membership for each sequence in each group, store membership
121 // and record non-empty groups in group list.
122 // record / sub-select selected region on the alignment view
124 if (selection != null && selection.getSize() > 0)
126 List<SequenceI> sel = selection.getSequences(null);
127 this.selected = new Vector();
129 .getSequencesInOrder(alignment, selectedRegionOnly);
133 selseqs = alignment.getSequencesArray();
136 List<List<SequenceI>> seqsets = new ArrayList<List<SequenceI>>();
137 // get the alignment's group list and make a copy
138 List<SequenceGroup> grps = new ArrayList<SequenceGroup>();
139 List<SequenceGroup> gg = alignment.getGroups();
141 ScGroup[] sgrps = null;
142 boolean addedgps[] = null;
145 if (selection != null && selectedRegionOnly)
147 // trim annotation to the region being stored.
148 // strip out any groups that do not actually intersect with the
149 // visible and selected region
150 int ssel = selection.getStartRes(), esel = selection.getEndRes();
151 List<SequenceGroup> isg = new ArrayList<SequenceGroup>();
152 for (SequenceGroup sg : grps)
154 if (!(sg.getStartRes() > esel || sg.getEndRes() < ssel))
156 // adjust bounds of new group, if necessary.
157 if (sg.getStartRes() < ssel)
159 sg.setStartRes(ssel);
161 if (sg.getEndRes() > esel)
165 sg.setStartRes(sg.getStartRes() - ssel + 1);
166 sg.setEndRes(sg.getEndRes() - ssel + 1);
174 sgrps = new ScGroup[grps.size()];
175 addedgps = new boolean[grps.size()];
176 for (int g = 0; g < sgrps.length; g++)
178 SequenceGroup sg = grps.get(g);
179 sgrps[g] = new ScGroup();
180 sgrps[g].sg = new SequenceGroup(sg);
182 // can't set entry 0 in an empty list
183 // seqsets.set(g, sg.getSequences(null));
184 seqsets.add(sg.getSequences());
186 // seqsets 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 ((seqsets.get(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 ArrayList<ScGroup>();
216 scGroups.add(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())
246 .getString("error.implementation_error_can_only_make_alignmnet_from_cigararray"));
248 // contigs = seqcigararray.applyDeletions();
249 contigs = seqcigararray.getDeletedRegions();
250 sequences = seqcigararray.getSeqCigarArray();
251 width = seqcigararray.getWidth(); // visible width
255 * Create an alignmentView where the first column corresponds with the
256 * 'firstcol' column of some reference alignment
261 public AlignmentView(CigarArray sdata, int firstcol)
267 public void setSequences(SeqCigar[] sequences)
269 this.sequences = sequences;
272 public void setContigs(int[] contigs)
274 this.contigs = contigs;
277 public SeqCigar[] getSequences()
283 * @see CigarArray.getDeletedRegions
284 * @return int[] { vis_start, sym_start, length }
286 public int[] getContigs()
292 * get the full alignment and a columnselection object marking the hidden
295 * @param gapCharacter
297 * @return Object[] { SequenceI[], ColumnSelection}
299 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
301 ColumnSelection colsel = new ColumnSelection();
303 return new Object[] {
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 = scGroups.get(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.get(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
469 * gap character to use to recreate the alignment
472 private SequenceI[] getVisibleSeqs(char c)
474 SequenceI[] aln = new SequenceI[sequences.length];
475 for (int i = 0, j = sequences.length; i < j; i++)
477 aln[i] = sequences[i].getSeq(c);
478 // Remove hidden regions from sequence
479 aln[i].setSequence(getASequenceString(c, i));
485 * creates new alignment objects for all contiguous visible segments
490 * @param regionOfInterest
491 * specify which sequences to include (or null to include all
493 * @return AlignmentI[] - all alignments where each sequence is a subsequence
494 * constructed from visible contig regions of view
496 public AlignmentI[] getVisibleContigAlignments(char c)
499 int[] vcontigs = getVisibleContigs();
500 SequenceI[][] contigviews = getVisibleContigs(c);
501 AlignmentI[] vcals = new AlignmentI[contigviews.length];
502 for (nvc = 0; nvc < contigviews.length; nvc++)
504 vcals[nvc] = new Alignment(contigviews[nvc]);
505 if (scGroups != null && scGroups.size() > 0)
507 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
508 vcontigs[nvc * 2 + 1], true);
515 * build a string excluding hidden regions from a particular sequence in the
522 private String getASequenceString(char c, int n)
525 String fullseq = sequences[n].getSequenceString(c);
530 for (int h = 0; h < contigs.length; h += 3)
532 sqn += fullseq.substring(p, contigs[h + 1]);
533 p = contigs[h + 1] + contigs[h + 2];
535 sqn += fullseq.substring(p);
545 * get an array of visible sequence strings for a view on an alignment using
546 * the given gap character uses getASequenceString
552 public String[] getSequenceStrings(char c)
554 String[] seqs = new String[sequences.length];
555 for (int n = 0; n < sequences.length; n++)
557 seqs[n] = getASequenceString(c, n);
564 * @return visible number of columns in alignment view
566 public int getWidth()
571 protected void setWidth(int width)
577 * get the contiguous subalignments in an alignment view.
579 * @param gapCharacter
581 * @return SequenceI[][]
583 public SequenceI[][] getVisibleContigs(char gapCharacter)
587 if (sequences == null || width <= 0)
591 if (contigs != null && contigs.length > 0)
596 for (int contig = 0; contig < contigs.length; contig += 3)
598 if ((contigs[contig + 1] - start) > 0)
602 fwidth += contigs[contig + 2]; // end up with full region width
603 // (including hidden regions)
604 start = contigs[contig + 1] + contigs[contig + 2];
610 smsa = new SequenceI[njobs][];
613 for (int contig = 0; contig < contigs.length; contig += 3)
615 if (contigs[contig + 1] - start > 0)
617 SequenceI mseq[] = new SequenceI[sequences.length];
618 for (int s = 0; s < mseq.length; s++)
620 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
621 start, contigs[contig + 1]);
626 start = contigs[contig + 1] + contigs[contig + 2];
630 SequenceI mseq[] = new SequenceI[sequences.length];
631 for (int s = 0; s < mseq.length; s++)
633 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
642 smsa = new SequenceI[1][];
643 smsa[0] = new SequenceI[sequences.length];
644 for (int s = 0; s < sequences.length; s++)
646 smsa[0][s] = sequences[s].getSeq(gapCharacter);
653 * return full msa and hidden regions with visible blocks replaced with new
659 * AlignmentOrder[] corresponding to each SequenceI[] block.
662 public Object[] getUpdatedView(SequenceI[][] nvismsa,
663 AlignmentOrder[] orders, char gapCharacter)
665 if (sequences == null || width <= 0)
669 .getString("error.empty_view_cannot_be_updated"));
674 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
676 if (contigs != null && contigs.length > 0)
678 SequenceI[] alignment = new SequenceI[sequences.length];
679 ColumnSelection columnselection = new ColumnSelection();
680 if (contigs != null && contigs.length > 0)
686 for (int contig = 0; contig < contigs.length; contig += 3)
688 owidth += contigs[contig + 2]; // recover final column width
689 if (contigs[contig + 1] - start > 0)
691 int swidth = 0; // subalignment width
692 if (nvismsa[j] != null)
694 SequenceI mseq[] = nvismsa[j];
695 AlignmentOrder order = (orders == null) ? null : orders[j];
697 if (mseq.length != sequences.length)
702 "error.mismatch_between_number_of_sequences_in_block",
704 Integer.valueOf(j).toString(),
705 Integer.valueOf(mseq.length)
711 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
713 for (int s = 0; s < mseq.length; s++)
715 if (alignment[s] == null)
717 alignment[s] = mseq[s];
721 alignment[s].setSequence(alignment[s]
722 .getSequenceAsString()
723 + mseq[s].getSequenceAsString());
724 if (mseq[s].getStart() <= mseq[s].getEnd())
726 alignment[s].setEnd(mseq[s].getEnd());
730 order.updateSequence(mseq[s], alignment[s]);
737 // recover original alignment block or place gaps
740 // recover input data
741 for (int s = 0; s < sequences.length; s++)
743 SequenceI oseq = sequences[s].getSeq(gapCharacter)
744 .getSubSequence(start, contigs[contig + 1]);
745 if (swidth < oseq.getLength())
747 swidth = oseq.getLength();
749 if (alignment[s] == null)
755 alignment[s].setSequence(alignment[s]
756 .getSequenceAsString()
757 + oseq.getSequenceAsString());
758 if (oseq.getEnd() >= oseq.getStart())
760 alignment[s].setEnd(oseq.getEnd());
770 // advance to begining of visible region
771 start = contigs[contig + 1] + contigs[contig + 2];
772 // add hidden segment to right of next region
773 for (int s = 0; s < sequences.length; s++)
775 SequenceI hseq = sequences[s].getSeq(gapCharacter)
776 .getSubSequence(contigs[contig + 1], start);
777 if (alignment[s] == null)
783 alignment[s].setSequence(alignment[s].getSequenceAsString()
784 + hseq.getSequenceAsString());
785 if (hseq.getEnd() >= hseq.getStart())
787 alignment[s].setEnd(hseq.getEnd());
791 // mark hidden segment as hidden in the new alignment
792 columnselection.hideColumns(nwidth, nwidth + contigs[contig + 2]
794 nwidth += contigs[contig + 2];
796 // Do final segment - if it exists
797 if (j < nvismsa.length)
800 if (nvismsa[j] != null)
802 SequenceI mseq[] = nvismsa[j];
803 AlignmentOrder order = (orders != null) ? orders[j] : null;
804 swidth = mseq[0].getLength();
805 for (int s = 0; s < mseq.length; s++)
807 if (alignment[s] == null)
809 alignment[s] = mseq[s];
813 alignment[s].setSequence(alignment[s].getSequenceAsString()
814 + mseq[s].getSequenceAsString());
815 if (mseq[s].getEnd() >= mseq[s].getStart())
817 alignment[s].setEnd(mseq[s].getEnd());
821 order.updateSequence(mseq[s], alignment[s]);
830 // recover input data or place gaps
833 // recover input data
834 for (int s = 0; s < sequences.length; s++)
836 SequenceI oseq = sequences[s].getSeq(gapCharacter)
837 .getSubSequence(start, owidth + 1);
838 if (swidth < oseq.getLength())
840 swidth = oseq.getLength();
842 if (alignment[s] == null)
848 alignment[s].setSequence(alignment[s]
849 .getSequenceAsString()
850 + oseq.getSequenceAsString());
851 if (oseq.getEnd() >= oseq.getStart())
853 alignment[s].setEnd(oseq.getEnd());
864 .getString("error.padding_not_yet_implemented"));
870 return new Object[] { alignment, columnselection };
874 if (nvismsa.length != 1)
879 "error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view",
880 new String[] { Integer.valueOf(
881 nvismsa.length).toString() }));
883 if (nvismsa[0] != null)
885 return new Object[] { nvismsa[0], new ColumnSelection() };
889 return getAlignmentAndColumnSelection(gapCharacter);
895 * returns simple array of start end positions of visible range on alignment.
896 * vis_start and vis_end are inclusive - use
897 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
898 * from underlying alignment.
900 * @return int[] { start_i, end_i } for 1<i<n visible regions.
902 public int[] getVisibleContigs()
904 if (contigs != null && contigs.length > 0)
909 for (int contig = 0; contig < contigs.length; contig += 3)
911 if ((contigs[contig + 1] - start) > 0)
915 fwidth += contigs[contig + 2]; // end up with full region width
916 // (including hidden regions)
917 start = contigs[contig + 1] + contigs[contig + 2];
923 int viscontigs[] = new int[nvis * 2];
926 for (int contig = 0; contig < contigs.length; contig += 3)
928 if ((contigs[contig + 1] - start) > 0)
930 viscontigs[nvis] = start;
931 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
934 start = contigs[contig + 1] + contigs[contig + 2];
938 viscontigs[nvis] = start;
939 viscontigs[nvis + 1] = fwidth; // end is inclusive
946 return new int[] { 0, width };
952 * @return position of first visible column of AlignmentView within its
953 * parent's alignment reference frame
955 public int getAlignmentOrigin()
961 * compute a deletion map for the current view according to the given
965 * (as returned from SequenceI.gapMap())
966 * @return int[] {intersection of visible regions with gapMap)
968 public int[] getVisibleContigMapFor(int[] gapMap)
971 int[] viscontigs = getVisibleContigs();
974 if (viscontigs != null)
976 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
977 // always be equal to or shorter than gapMap
978 delMap = new int[gapMap.length];
979 for (int contig = 0; contig < viscontigs.length; contig += 2)
982 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
986 while (spos < gapMap.length
987 && gapMap[spos] <= viscontigs[contig + 1])
989 delMap[i++] = spos++;
992 int tmap[] = new int[i];
993 System.arraycopy(delMap, 0, tmap, 0, i);
1000 * apply the getSeq(gc) method to each sequence cigar, and return the array of
1001 * edited sequences, optionally with hidden regions removed.
1004 * gap character to use for insertions
1006 * remove hidden regions from sequences. Note: currently implemented
1007 * in a memory inefficient way - space needed is 2*result set for
1010 * @return SequenceI[]
1012 public SequenceI[] getEditedSequences(char gc, boolean delete)
1014 SeqCigar[] msf = getSequences();
1015 SequenceI[] aln = new SequenceI[msf.length];
1016 for (int i = 0, j = msf.length; i < j; i++)
1018 aln[i] = msf[i].getSeq(gc);
1022 String[] sqs = getSequenceStrings(gc);
1023 for (int i = 0; i < sqs.length; i++)
1025 aln[i].setSequence(sqs[i]);
1032 public static void summariseAlignmentView(AlignmentView view,
1035 os.print("View has " + view.sequences.length + " of which ");
1036 if (view.selected == null)
1042 os.print(" " + view.selected.size());
1044 os.println(" are selected.");
1045 os.print("View is " + view.getWidth() + " columns wide");
1047 int[] contigs = view.getContigs();
1048 if (contigs != null)
1050 viswid = view.width;
1051 for (int i = 0; i < contigs.length; i += 3)
1053 viswid += contigs[i + 2];
1055 os.println("with " + viswid + " visible columns spread over "
1056 + contigs.length / 3 + " regions.");
1060 viswid = view.width;
1063 if (view.scGroups != null)
1065 os.println("There are " + view.scGroups.size()
1066 + " groups defined on the view.");
1067 for (int g = 0; g < view.scGroups.size(); g++)
1069 ScGroup sgr = view.scGroups.get(g);
1070 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1071 + " Contains " + sgr.seqs.size() + " Seqs.");
1072 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1073 + sgr.sg.getEndRes());
1074 for (int s = 0; s < sgr.seqs.size(); s++)
1076 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1078 os.println("** WARNING: sequence "
1079 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1080 + " is not marked as member of group.");
1084 AlignmentI visal = view.getVisibleAlignment('-');
1087 os.println("Vis. alignment is " + visal.getWidth()
1088 + " wide and has " + visal.getHeight() + " seqs.");
1089 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1093 for (SequenceGroup sg : visal.getGroups())
1095 os.println("Group " + (i++) + " begins at column "
1096 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1103 public static void testSelectionViews(AlignmentI alignment,
1104 ColumnSelection csel, SequenceGroup selection)
1106 System.out.println("Testing standard view creation:\n");
1107 AlignmentView view = null;
1111 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1112 view = new AlignmentView(alignment, csel, selection, false, false,
1114 summariseAlignmentView(view, System.out);
1116 } catch (Exception e)
1118 e.printStackTrace();
1120 .println("Failed to generate alignment with selection but no groups marked.");
1125 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1126 view = new AlignmentView(alignment, csel, selection, false, false,
1128 summariseAlignmentView(view, System.out);
1129 } catch (Exception e)
1131 e.printStackTrace();
1133 .println("Failed to generate alignment with selection marked but no groups marked.");
1138 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1139 view = new AlignmentView(alignment, csel, selection, false, true,
1141 summariseAlignmentView(view, System.out);
1142 } catch (Exception e)
1144 e.printStackTrace();
1146 .println("Failed to generate alignment with selection restricted but no groups marked.");
1151 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1152 view = new AlignmentView(alignment, csel, selection, false, true,
1154 summariseAlignmentView(view, System.out);
1155 } catch (Exception e)
1157 e.printStackTrace();
1159 .println("Failed to generate alignment with selection restricted and groups marked.");
1164 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1165 view = new AlignmentView(alignment, csel, selection, true, false,
1167 summariseAlignmentView(view, System.out);
1168 } catch (Exception e)
1170 e.printStackTrace();
1172 .println("Failed to generate alignment with selection but no groups marked.");
1177 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1178 view = new AlignmentView(alignment, csel, selection, true, false,
1180 summariseAlignmentView(view, System.out);
1181 } catch (Exception e)
1183 e.printStackTrace();
1185 .println("Failed to generate alignment with selection marked but no groups marked.");
1190 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1191 view = new AlignmentView(alignment, csel, selection, true, true,
1193 summariseAlignmentView(view, System.out);
1194 } catch (Exception e)
1196 e.printStackTrace();
1198 .println("Failed to generate alignment with selection restricted but no groups marked.");
1203 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1204 view = new AlignmentView(alignment, csel, selection, true, true, true);
1205 summariseAlignmentView(view, System.out);
1206 } catch (Exception e)
1208 e.printStackTrace();
1210 .println("Failed to generate alignment with selection restricted and groups marked.");