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;
31 * Transient object compactly representing a 'view' of an alignment - with
32 * discontinuities marked. Extended in Jalview 2.7 to optionally record sequence
33 * groups and specific selected regions on the alignment.
35 public class AlignmentView
37 private SeqCigar[] sequences = null;
39 private int[] contigs = null;
41 private int width = 0;
43 private int firstCol = 0;
46 * one or more ScGroup objects, which are referenced by each seqCigar's group
49 private List<ScGroup> scGroups = null;
51 private boolean isNa = false;
54 * false if the view concerns peptides
64 * Group defined over SeqCigars. Unlike AlignmentI associated groups, each
65 * SequenceGroup hold just the essential properties for the group, but no
66 * references to the sequences involved. SeqCigars hold references to the
67 * seuqenceGroup entities themselves.
71 public List<SeqCigar> seqs;
73 public SequenceGroup sg;
77 seqs = new ArrayList<>();
82 * @return true if seq was not a member before and was added to group
84 public boolean add(SeqCigar seq)
86 if (!seq.isMemberOf(this))
89 seq.setGroupMembership(this);
101 * @return true if seq was a member and was removed from group
103 public boolean remove(SeqCigar seq)
105 if (seq.removeGroupMembership(this))
120 * vector of selected seqCigars. This vector is also referenced by each
121 * seqCigar contained in it.
123 private ScGroup selected;
126 * Construct an alignmentView from a live jalview alignment view. Note -
127 * hidden rows will be excluded from alignmentView Note: JAL-1179
130 * - alignment as referenced by an AlignViewport
131 * @param columnSelection
134 * @param hasHiddenColumns
135 * - mark the hidden columns in columnSelection as hidden in the view
136 * @param selectedRegionOnly
137 * - when set, only include the selected region in the view,
138 * otherwise just mark the selected region on the constructed view.
139 * @param recordGroups
140 * - when set, any groups on the given alignment will be marked on
143 public AlignmentView(AlignmentI alignment, HiddenColumns hidden,
144 SequenceGroup selection, boolean hasHiddenColumns,
145 boolean selectedRegionOnly, boolean recordGroups)
147 // refactored from AlignViewport.getAlignmentView(selectedOnly);
148 this(new jalview.datamodel.CigarArray(alignment,
149 (hasHiddenColumns ? hidden : null),
150 (selectedRegionOnly ? selection : null)),
151 (selectedRegionOnly && selection != null)
152 ? selection.getStartRes()
154 isNa = alignment.isNucleotide();
155 // walk down SeqCigar array and Alignment Array - optionally restricted by
157 // test group membership for each sequence in each group, store membership
158 // and record non-empty groups in group list.
159 // record / sub-select selected region on the alignment view
161 if (selection != null && selection.getSize() > 0)
163 this.selected = new ScGroup();
164 selseqs = selection.getSequencesInOrder(alignment,
169 selseqs = alignment.getSequencesArray();
172 List<List<SequenceI>> seqsets = new ArrayList<>();
173 // get the alignment's group list and make a copy
174 List<SequenceGroup> grps = new ArrayList<>();
175 List<SequenceGroup> gg = alignment.getGroups();
177 ScGroup[] sgrps = null;
178 boolean addedgps[] = null;
181 if (selection != null && selectedRegionOnly)
183 // trim annotation to the region being stored.
184 // strip out any groups that do not actually intersect with the
185 // visible and selected region
186 int ssel = selection.getStartRes(), esel = selection.getEndRes();
187 List<SequenceGroup> isg = new ArrayList<>();
188 for (SequenceGroup sg : grps)
190 if (!(sg.getStartRes() > esel || sg.getEndRes() < ssel))
192 // adjust bounds of new group, if necessary.
193 if (sg.getStartRes() < ssel)
195 sg.setStartRes(ssel);
197 if (sg.getEndRes() > esel)
201 sg.setStartRes(sg.getStartRes() - ssel + 1);
202 sg.setEndRes(sg.getEndRes() - ssel + 1);
210 sgrps = new ScGroup[grps.size()];
211 addedgps = new boolean[grps.size()];
212 for (int g = 0; g < sgrps.length; g++)
214 SequenceGroup sg = grps.get(g);
215 sgrps[g] = new ScGroup();
216 sgrps[g].sg = new SequenceGroup(sg);
218 // can't set entry 0 in an empty list
219 // seqsets.set(g, sg.getSequences(null));
220 seqsets.add(sg.getSequences());
222 // seqsets now contains vectors (should be sets) for each group, so we can
223 // track when we've done with the group
226 for (int i = 0; i < selseqs.length; i++)
228 if (selseqs[i] != null)
230 if (selection != null && selection.getSize() > 0
231 && !selectedRegionOnly)
233 selected.add(sequences[csi]);
237 for (int sg = 0; sg < sgrps.length; sg++)
239 if ((seqsets.get(sg)).contains(selseqs[i]))
241 sgrps[sg].sg.deleteSequence(selseqs[i], false);
242 sgrps[sg].add(sequences[csi]);
245 if (scGroups == null)
247 scGroups = new ArrayList<>();
250 scGroups.add(sgrps[sg]);
258 // finally, delete the remaining sequences (if any) not selected
259 for (int sg = 0; sg < sgrps.length; sg++)
261 SequenceI[] sqs = sgrps[sg].sg.getSequencesAsArray(null);
262 for (int si = 0; si < sqs.length; si++)
264 sgrps[sg].sg.deleteSequence(sqs[si], false);
271 * construct an alignmentView from a SeqCigarArray. Errors are thrown if the
272 * seqcigararray.isSeqCigarArray() flag is not set.
274 public AlignmentView(CigarArray seqcigararray)
276 if (!seqcigararray.isSeqCigarArray())
279 "Implementation Error - can only make an alignment view from a CigarArray of sequences.");
281 // contigs = seqcigararray.applyDeletions();
282 contigs = seqcigararray.getDeletedRegions();
283 sequences = seqcigararray.getSeqCigarArray();
284 width = seqcigararray.getWidth(); // visible width
288 * Create an alignmentView where the first column corresponds with the
289 * 'firstcol' column of some reference alignment
294 public AlignmentView(CigarArray sdata, int firstcol)
300 public void setSequences(SeqCigar[] sequences)
302 this.sequences = sequences;
305 public void setContigs(int[] contigs)
307 this.contigs = contigs;
310 public SeqCigar[] getSequences()
316 * @see CigarArray.getDeletedRegions
317 * @return int[] { vis_start, sym_start, length }
319 public int[] getContigs()
325 * get the full alignment and a columnselection object marking the hidden
328 * @param gapCharacter
330 * @return Object[] { SequenceI[], ColumnSelection}
332 public Object[] getAlignmentAndHiddenColumns(char gapCharacter)
334 HiddenColumns hidden = new HiddenColumns();
336 return new Object[] { SeqCigar.createAlignmentSequences(sequences,
337 gapCharacter, hidden, contigs),
342 * return the visible alignment corresponding to this view. Sequences in this
343 * alignment are edited versions of the parent sequences - where hidden
344 * regions have been removed. NOTE: the sequence data in this alignment is not
350 public AlignmentI getVisibleAlignment(char c)
352 SequenceI[] aln = getVisibleSeqs(c);
354 AlignmentI vcal = new Alignment(aln);
355 addPrunedGroupsInOrder(vcal, -1, -1, true);
360 * add groups from view to the given alignment
366 * -1 or gstart to width-1
368 * - true if vcal is alignment of the visible regions of the view
369 * (e.g. as returned from getVisibleAlignment)
371 private void addPrunedGroupsInOrder(AlignmentI vcal, int gstart, int gend,
375 if (gstart > -1 && gstart <= gend)
380 SequenceI[] aln = vcal.getSequencesArray();
383 * prune any groups to the visible coordinates of the alignment.
386 int nvg = (scGroups != null) ? scGroups.size() : 0;
389 SequenceGroup[] nsg = new SequenceGroup[nvg];
390 for (int g = 0; g < nvg; g++)
392 SequenceGroup sg = scGroups.get(g).sg;
395 if (sg.getStartRes() > gend || sg.getEndRes() < gstart)
403 // clone group properties
404 nsg[g] = new SequenceGroup(sg);
406 // may need to shift/trim start and end ?
407 if (r && !viscontigs)
409 // Not fully tested code - routine not yet called with
411 if (nsg[g].getStartRes() < gstart)
413 nsg[g].setStartRes(0);
417 nsg[g].setStartRes(nsg[g].getStartRes() - gstart);
418 nsg[g].setEndRes(nsg[g].getEndRes() - gstart);
420 if (nsg[g].getEndRes() > (gend - gstart))
422 nsg[g].setEndRes(gend - gstart);
428 // prune groups to cover just the visible positions between
433 ShiftList prune = new ShiftList();
436 // adjust for start of alignment within visible window.
437 prune.addShift(gstart, -gstart); //
439 for (int h = 0; h < contigs.length; h += 3)
442 prune.addShift(p + contigs[h + 1],
443 contigs[h + 2] - contigs[h + 1]);
445 p = contigs[h + 1] + contigs[h + 2];
447 for (int g = 0; g < nsg.length; g++)
451 int s = nsg[g].getStartRes(), t = nsg[g].getEndRes();
466 nsg[g].setStartRes(s);
473 for (int nsq = 0; nsq < aln.length; nsq++)
475 for (int g = 0; g < nvg; g++)
478 && sequences[nsq].isMemberOf(scGroups.get(g)))
480 nsg[g].addSequence(aln[nsq], false);
484 for (int g = 0; g < nvg; g++)
486 if (nsg[g] != null && nsg[g].getSize() > 0)
488 vcal.addGroup(nsg[g]);
498 * generate sequence array corresponding to the visible parts of the
502 * gap character to use to recreate the alignment
505 private SequenceI[] getVisibleSeqs(char c)
507 SequenceI[] aln = new SequenceI[sequences.length];
508 for (int i = 0, j = sequences.length; i < j; i++)
510 aln[i] = sequences[i].getSeq(c);
511 // Remove hidden regions from sequence
512 aln[i].setSequence(getASequenceString(c, i));
518 * creates new alignment objects for all contiguous visible segments
523 * @param regionOfInterest
524 * specify which sequences to include (or null to include all
526 * @return AlignmentI[] - all alignments where each sequence is a subsequence
527 * constructed from visible contig regions of view
529 public AlignmentI[] getVisibleContigAlignments(char c)
532 int[] vcontigs = getVisibleContigs();
533 SequenceI[][] contigviews = getVisibleContigs(c);
534 AlignmentI[] vcals = new AlignmentI[contigviews.length];
535 for (nvc = 0; nvc < contigviews.length; nvc++)
537 vcals[nvc] = new Alignment(contigviews[nvc]);
538 if (scGroups != null && scGroups.size() > 0)
540 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
541 vcontigs[nvc * 2 + 1], true);
548 * build a string excluding hidden regions from a particular sequence in the
555 private String getASequenceString(char c, int n)
558 String fullseq = sequences[n].getSequenceString(c);
563 for (int h = 0; h < contigs.length; h += 3)
565 sqn += fullseq.substring(p, contigs[h + 1]);
566 p = contigs[h + 1] + contigs[h + 2];
568 sqn += fullseq.substring(p);
578 * get an array of visible sequence strings for a view on an alignment using
579 * the given gap character uses getASequenceString
585 public String[] getSequenceStrings(char c)
587 String[] seqs = new String[sequences.length];
588 for (int n = 0; n < sequences.length; n++)
590 seqs[n] = getASequenceString(c, n);
597 * @return visible number of columns in alignment view
599 public int getWidth()
604 protected void setWidth(int width)
610 * get the contiguous subalignments in an alignment view.
612 * @param gapCharacter
614 * @return SequenceI[][]
616 public SequenceI[][] getVisibleContigs(char gapCharacter)
620 if (sequences == null || width <= 0)
624 if (contigs != null && contigs.length > 0)
629 for (int contig = 0; contig < contigs.length; contig += 3)
631 if ((contigs[contig + 1] - start) > 0)
635 fwidth += contigs[contig + 2]; // end up with full region width
636 // (including hidden regions)
637 start = contigs[contig + 1] + contigs[contig + 2];
643 smsa = new SequenceI[njobs][];
646 for (int contig = 0; contig < contigs.length; contig += 3)
648 if (contigs[contig + 1] - start > 0)
650 SequenceI mseq[] = new SequenceI[sequences.length];
651 for (int s = 0; s < mseq.length; s++)
653 mseq[s] = sequences[s].getSeq(gapCharacter)
654 .getSubSequence(start, contigs[contig + 1]);
659 start = contigs[contig + 1] + contigs[contig + 2];
663 SequenceI mseq[] = new SequenceI[sequences.length];
664 for (int s = 0; s < mseq.length; s++)
666 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
675 smsa = new SequenceI[1][];
676 smsa[0] = new SequenceI[sequences.length];
677 for (int s = 0; s < sequences.length; s++)
679 smsa[0][s] = sequences[s].getSeq(gapCharacter);
686 * return full msa and hidden regions with visible blocks replaced with new
692 * AlignmentOrder[] corresponding to each SequenceI[] block.
695 public Object[] getUpdatedView(SequenceI[][] nvismsa,
696 AlignmentOrder[] orders, char gapCharacter)
698 if (sequences == null || width <= 0)
700 throw new Error(MessageManager
701 .getString("error.empty_view_cannot_be_updated"));
706 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
708 if (contigs != null && contigs.length > 0)
710 SequenceI[] alignment = new SequenceI[sequences.length];
711 // ColumnSelection columnselection = new ColumnSelection();
712 HiddenColumns hidden = new HiddenColumns();
713 if (contigs != null && contigs.length > 0)
719 for (int contig = 0; contig < contigs.length; contig += 3)
721 owidth += contigs[contig + 2]; // recover final column width
722 if (contigs[contig + 1] - start > 0)
724 int swidth = 0; // subalignment width
725 if (nvismsa[j] != null)
727 SequenceI mseq[] = nvismsa[j];
728 AlignmentOrder order = (orders == null) ? null : orders[j];
730 if (mseq.length != sequences.length)
732 throw new Error(MessageManager.formatMessage(
733 "error.mismatch_between_number_of_sequences_in_block",
735 { Integer.valueOf(j).toString(),
736 Integer.valueOf(mseq.length).toString(),
737 Integer.valueOf(sequences.length)
740 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
742 for (int s = 0; s < mseq.length; s++)
744 if (alignment[s] == null)
746 alignment[s] = mseq[s];
751 .setSequence(alignment[s].getSequenceAsString()
752 + mseq[s].getSequenceAsString());
753 if (mseq[s].getStart() <= mseq[s].getEnd())
755 alignment[s].setEnd(mseq[s].getEnd());
759 order.updateSequence(mseq[s], alignment[s]);
766 // recover original alignment block or place gaps
769 // recover input data
770 for (int s = 0; s < sequences.length; s++)
772 SequenceI oseq = sequences[s].getSeq(gapCharacter)
773 .getSubSequence(start, contigs[contig + 1]);
774 if (swidth < oseq.getLength())
776 swidth = oseq.getLength();
778 if (alignment[s] == null)
785 .setSequence(alignment[s].getSequenceAsString()
786 + oseq.getSequenceAsString());
787 if (oseq.getEnd() >= oseq.getStart())
789 alignment[s].setEnd(oseq.getEnd());
799 // advance to begining of visible region
800 start = contigs[contig + 1] + contigs[contig + 2];
801 // add hidden segment to right of next region
802 for (int s = 0; s < sequences.length; s++)
804 SequenceI hseq = sequences[s].getSeq(gapCharacter)
805 .getSubSequence(contigs[contig + 1], start);
806 if (alignment[s] == null)
812 alignment[s].setSequence(alignment[s].getSequenceAsString()
813 + hseq.getSequenceAsString());
814 if (hseq.getEnd() >= hseq.getStart())
816 alignment[s].setEnd(hseq.getEnd());
820 // mark hidden segment as hidden in the new alignment
821 hidden.hideColumns(nwidth, nwidth + contigs[contig + 2] - 1);
822 nwidth += contigs[contig + 2];
824 // Do final segment - if it exists
825 if (j < nvismsa.length)
828 if (nvismsa[j] != null)
830 SequenceI mseq[] = nvismsa[j];
831 AlignmentOrder order = (orders != null) ? orders[j] : null;
832 swidth = mseq[0].getLength();
833 for (int s = 0; s < mseq.length; s++)
835 if (alignment[s] == null)
837 alignment[s] = mseq[s];
841 alignment[s].setSequence(alignment[s].getSequenceAsString()
842 + mseq[s].getSequenceAsString());
843 if (mseq[s].getEnd() >= mseq[s].getStart())
845 alignment[s].setEnd(mseq[s].getEnd());
849 order.updateSequence(mseq[s], alignment[s]);
858 // recover input data or place gaps
861 // recover input data
862 for (int s = 0; s < sequences.length; s++)
864 SequenceI oseq = sequences[s].getSeq(gapCharacter)
865 .getSubSequence(start, owidth + 1);
866 if (swidth < oseq.getLength())
868 swidth = oseq.getLength();
870 if (alignment[s] == null)
877 .setSequence(alignment[s].getSequenceAsString()
878 + oseq.getSequenceAsString());
879 if (oseq.getEnd() >= oseq.getStart())
881 alignment[s].setEnd(oseq.getEnd());
890 throw new Error(MessageManager
891 .getString("error.padding_not_yet_implemented"));
897 return new Object[] { alignment, hidden };
901 if (nvismsa.length != 1)
903 throw new Error(MessageManager.formatMessage(
904 "error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view",
906 { Integer.valueOf(nvismsa.length).toString() }));
908 if (nvismsa[0] != null)
910 return new Object[] { nvismsa[0], new HiddenColumns() };
914 return getAlignmentAndHiddenColumns(gapCharacter);
920 * returns simple array of start end positions of visible range on alignment.
921 * vis_start and vis_end are inclusive - use
922 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
923 * from underlying alignment.
925 * @return int[] { start_i, end_i } for 1<i<n visible regions.
927 public int[] getVisibleContigs()
929 if (contigs != null && contigs.length > 0)
934 for (int contig = 0; contig < contigs.length; contig += 3)
936 if ((contigs[contig + 1] - start) > 0)
940 fwidth += contigs[contig + 2]; // end up with full region width
941 // (including hidden regions)
942 start = contigs[contig + 1] + contigs[contig + 2];
948 int viscontigs[] = new int[nvis * 2];
951 for (int contig = 0; contig < contigs.length; contig += 3)
953 if ((contigs[contig + 1] - start) > 0)
955 viscontigs[nvis] = start;
956 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
959 start = contigs[contig + 1] + contigs[contig + 2];
963 viscontigs[nvis] = start;
964 viscontigs[nvis + 1] = fwidth - 1; // end is inclusive
971 return new int[] { 0, width - 1 };
977 * @return position of first visible column of AlignmentView within its
978 * parent's alignment reference frame
980 public int getAlignmentOrigin()
986 * compute a deletion map for the current view according to the given
990 * (as returned from SequenceI.gapMap())
991 * @return int[] {intersection of visible regions with gapMap)
993 public int[] getVisibleContigMapFor(int[] gapMap)
996 int[] viscontigs = getVisibleContigs();
999 if (viscontigs != null)
1001 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
1002 // always be equal to or shorter than gapMap
1003 delMap = new int[gapMap.length];
1004 for (int contig = 0; contig < viscontigs.length; contig += 2)
1007 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
1011 while (spos < gapMap.length
1012 && gapMap[spos] <= viscontigs[contig + 1])
1014 delMap[i++] = spos++;
1017 int tmap[] = new int[i];
1018 System.arraycopy(delMap, 0, tmap, 0, i);
1025 * apply the getSeq(gc) method to each sequence cigar, and return the array of
1026 * edited sequences, optionally with hidden regions removed.
1029 * gap character to use for insertions
1031 * remove hidden regions from sequences. Note: currently implemented
1032 * in a memory inefficient way - space needed is 2*result set for
1035 * @return SequenceI[]
1037 public SequenceI[] getEditedSequences(char gc, boolean delete)
1039 SeqCigar[] msf = getSequences();
1040 SequenceI[] aln = new SequenceI[msf.length];
1041 for (int i = 0, j = msf.length; i < j; i++)
1043 aln[i] = msf[i].getSeq(gc);
1047 String[] sqs = getSequenceStrings(gc);
1048 for (int i = 0; i < sqs.length; i++)
1050 aln[i].setSequence(sqs[i]);
1057 public static void summariseAlignmentView(AlignmentView view,
1060 os.print("View has " + view.sequences.length + " of which ");
1061 if (view.selected == null)
1067 os.print(" " + view.selected.size());
1069 os.println(" are selected.");
1070 os.print("View is " + view.getWidth() + " columns wide");
1072 int[] contigs = view.getContigs();
1073 if (contigs != null)
1075 viswid = view.width;
1076 for (int i = 0; i < contigs.length; i += 3)
1078 viswid += contigs[i + 2];
1080 os.println("with " + viswid + " visible columns spread over "
1081 + contigs.length / 3 + " regions.");
1085 viswid = view.width;
1088 if (view.scGroups != null)
1090 os.println("There are " + view.scGroups.size()
1091 + " groups defined on the view.");
1092 for (int g = 0; g < view.scGroups.size(); g++)
1094 ScGroup sgr = view.scGroups.get(g);
1095 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1096 + " Contains " + sgr.seqs.size() + " Seqs.");
1097 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1098 + sgr.sg.getEndRes());
1099 for (int s = 0; s < sgr.seqs.size(); s++)
1101 // JBPnote this should be a unit test for ScGroup
1102 if (!sgr.seqs.get(s).isMemberOf(sgr))
1104 os.println("** WARNING: sequence " + sgr.seqs.get(s).toString()
1105 + " is not marked as member of group.");
1109 AlignmentI visal = view.getVisibleAlignment('-');
1112 os.println("Vis. alignment is " + visal.getWidth()
1113 + " wide and has " + visal.getHeight() + " seqs.");
1114 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1118 for (SequenceGroup sg : visal.getGroups())
1120 os.println("Group " + (i++) + " begins at column "
1121 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1128 public static void testSelectionViews(AlignmentI alignment,
1129 HiddenColumns hidden, SequenceGroup selection)
1131 System.out.println("Testing standard view creation:\n");
1132 AlignmentView view = null;
1136 "View with no hidden columns, no limit to selection, no groups to be collected:");
1137 view = new AlignmentView(alignment, hidden, selection, false, false,
1139 summariseAlignmentView(view, System.out);
1141 } catch (Exception e)
1143 e.printStackTrace();
1145 "Failed to generate alignment with selection but no groups marked.");
1150 "View with no hidden columns, no limit to selection, and all groups to be collected:");
1151 view = new AlignmentView(alignment, hidden, selection, false, false,
1153 summariseAlignmentView(view, System.out);
1154 } catch (Exception e)
1156 e.printStackTrace();
1158 "Failed to generate alignment with selection marked but no groups marked.");
1163 "View with no hidden columns, limited to selection and no groups to be collected:");
1164 view = new AlignmentView(alignment, hidden, selection, false, true,
1166 summariseAlignmentView(view, System.out);
1167 } catch (Exception e)
1169 e.printStackTrace();
1171 "Failed to generate alignment with selection restricted but no groups marked.");
1176 "View with no hidden columns, limited to selection, and all groups to be collected:");
1177 view = new AlignmentView(alignment, hidden, selection, false, true,
1179 summariseAlignmentView(view, System.out);
1180 } catch (Exception e)
1182 e.printStackTrace();
1184 "Failed to generate alignment with selection restricted and groups marked.");
1189 "View *with* hidden columns, no limit to selection, no groups to be collected:");
1190 view = new AlignmentView(alignment, hidden, selection, true, false,
1192 summariseAlignmentView(view, System.out);
1193 } catch (Exception e)
1195 e.printStackTrace();
1197 "Failed to generate alignment with selection but no groups marked.");
1202 "View *with* hidden columns, no limit to selection, and all groups to be collected:");
1203 view = new AlignmentView(alignment, hidden, selection, true, false,
1205 summariseAlignmentView(view, System.out);
1206 } catch (Exception e)
1208 e.printStackTrace();
1210 "Failed to generate alignment with selection marked but no groups marked.");
1215 "View *with* hidden columns, limited to selection and no groups to be collected:");
1216 view = new AlignmentView(alignment, hidden, selection, true, true,
1218 summariseAlignmentView(view, System.out);
1219 } catch (Exception e)
1221 e.printStackTrace();
1223 "Failed to generate alignment with selection restricted but no groups marked.");
1228 "View *with* hidden columns, limited to selection, and all groups to be collected:");
1229 view = new AlignmentView(alignment, hidden, selection, true, true,
1231 summariseAlignmentView(view, System.out);
1232 } catch (Exception e)
1234 e.printStackTrace();
1236 "Failed to generate alignment with selection restricted and groups marked.");