2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
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
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.Enumeration;
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 Vector scGroups;
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 // get the alignment's group list and make a copy
137 Vector grps = new Vector();
138 List<SequenceGroup> gg = alignment.getGroups();
140 ScGroup[] sgrps = null;
141 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 Vector isg = new Vector();
152 Enumeration en = grps.elements();
153 while (en.hasMoreElements())
155 sg = (SequenceGroup) en.nextElement();
157 if (!(sg.getStartRes() > esel || sg.getEndRes() < ssel))
159 // adjust bounds of new group, if necessary.
160 if (sg.getStartRes() < ssel)
162 sg.setStartRes(ssel);
164 if (sg.getEndRes() > esel)
168 sg.setStartRes(sg.getStartRes() - ssel + 1);
169 sg.setEndRes(sg.getEndRes() - ssel + 1);
177 sgrps = new ScGroup[grps.size()];
178 addedgps = new boolean[grps.size()];
179 for (int g = 0; g < sgrps.length; g++)
181 sg = (SequenceGroup) grps.elementAt(g);
182 sgrps[g] = new ScGroup();
183 sgrps[g].sg = new SequenceGroup(sg);
185 grps.setElementAt(sg.getSequences(null), g);
187 // grps now contains vectors (should be sets) for each group, so we can
188 // track when we've done with the group
191 for (int i = 0; i < selseqs.length; i++)
193 if (selseqs[i] != null)
195 if (selection != null && selection.getSize() > 0
196 && !selectedRegionOnly)
198 sequences[csi].setGroupMembership(selected);
199 selected.addElement(sequences[csi]);
203 for (int sg = 0; sg < sgrps.length; sg++)
205 if (((Vector) grps.elementAt(sg)).contains(selseqs[i]))
207 sequences[csi].setGroupMembership(sgrps[sg]);
208 sgrps[sg].sg.deleteSequence(selseqs[i], false);
209 sgrps[sg].seqs.addElement(sequences[csi]);
212 if (scGroups == null)
214 scGroups = new Vector();
217 scGroups.addElement(sgrps[sg]);
225 // finally, delete the remaining sequences (if any) not selected
226 for (int sg = 0; sg < sgrps.length; sg++)
228 SequenceI[] sqs = sgrps[sg].sg.getSequencesAsArray(null);
229 for (int si = 0; si < sqs.length; si++)
231 sgrps[sg].sg.deleteSequence(sqs[si], false);
238 * construct an alignmentView from a SeqCigarArray. Errors are thrown if the
239 * seqcigararray.isSeqCigarArray() flag is not set.
241 public AlignmentView(CigarArray seqcigararray)
243 if (!seqcigararray.isSeqCigarArray())
245 throw new Error(MessageManager.getString("error.implementation_error_can_only_make_alignmnet_from_cigararray"));
247 // contigs = seqcigararray.applyDeletions();
248 contigs = seqcigararray.getDeletedRegions();
249 sequences = seqcigararray.getSeqCigarArray();
250 width = seqcigararray.getWidth(); // visible width
254 * Create an alignmentView where the first column corresponds with the
255 * 'firstcol' column of some reference alignment
260 public AlignmentView(CigarArray sdata, int firstcol)
266 public void setSequences(SeqCigar[] sequences)
268 this.sequences = sequences;
271 public void setContigs(int[] contigs)
273 this.contigs = contigs;
276 public SeqCigar[] getSequences()
282 * @see CigarArray.getDeletedRegions
283 * @return int[] { vis_start, sym_start, length }
285 public int[] getContigs()
291 * get the full alignment and a columnselection object marking the hidden
294 * @param gapCharacter
296 * @return Object[] { SequenceI[], ColumnSelection}
298 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
300 ColumnSelection colsel = new ColumnSelection();
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 = ((ScGroup) scGroups.elementAt(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.elementAt(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
471 private SequenceI[] getVisibleSeqs(char c)
473 SequenceI[] aln = new SequenceI[sequences.length];
474 for (int i = 0, j = sequences.length; i < j; i++)
476 aln[i] = sequences[i].getSeq('-');
478 // Remove hidden regions from sequence objects.
479 String seqs[] = getSequenceStrings('-');
480 for (int i = 0, j = aln.length; i < j; i++)
482 aln[i].setSequence(seqs[i]);
488 * creates new alignment objects for all contiguous visible segments
493 * @param regionOfInterest
494 * specify which sequences to include (or null to include all
496 * @return AlignmentI[] - all alignments where each sequence is a subsequence
497 * constructed from visible contig regions of view
499 public AlignmentI[] getVisibleContigAlignments(char c)
502 int[] vcontigs = getVisibleContigs();
503 SequenceI[][] contigviews = getVisibleContigs(c);
504 AlignmentI[] vcals = new AlignmentI[contigviews.length];
505 for (nvc = 0; nvc < contigviews.length; nvc++)
507 vcals[nvc] = new Alignment(contigviews[nvc]);
508 if (scGroups != null && scGroups.size() > 0)
510 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
511 vcontigs[nvc * 2 + 1], true);
518 * get an array of visible sequence strings for a view on an alignment using
519 * the given gap character
525 public String[] getSequenceStrings(char c)
527 String[] seqs = new String[sequences.length];
528 for (int n = 0; n < sequences.length; n++)
530 String fullseq = sequences[n].getSequenceString(c);
535 for (int h = 0; h < contigs.length; h += 3)
537 seqs[n] += fullseq.substring(p, contigs[h + 1]);
538 p = contigs[h + 1] + contigs[h + 2];
540 seqs[n] += fullseq.substring(p);
552 * @return visible number of columns in alignment view
554 public int getWidth()
559 protected void setWidth(int width)
565 * get the contiguous subalignments in an alignment view.
567 * @param gapCharacter
569 * @return SequenceI[][]
571 public SequenceI[][] getVisibleContigs(char gapCharacter)
575 if (sequences == null || width <= 0)
579 if (contigs != null && contigs.length > 0)
584 for (int contig = 0; contig < contigs.length; contig += 3)
586 if ((contigs[contig + 1] - start) > 0)
590 fwidth += contigs[contig + 2]; // end up with full region width
591 // (including hidden regions)
592 start = contigs[contig + 1] + contigs[contig + 2];
598 smsa = new SequenceI[njobs][];
601 for (int contig = 0; contig < contigs.length; contig += 3)
603 if (contigs[contig + 1] - start > 0)
605 SequenceI mseq[] = new SequenceI[sequences.length];
606 for (int s = 0; s < mseq.length; s++)
608 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
609 start, contigs[contig + 1]);
614 start = contigs[contig + 1] + contigs[contig + 2];
618 SequenceI mseq[] = new SequenceI[sequences.length];
619 for (int s = 0; s < mseq.length; s++)
621 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
630 smsa = new SequenceI[1][];
631 smsa[0] = new SequenceI[sequences.length];
632 for (int s = 0; s < sequences.length; s++)
634 smsa[0][s] = sequences[s].getSeq(gapCharacter);
641 * return full msa and hidden regions with visible blocks replaced with new
647 * AlignmentOrder[] corresponding to each SequenceI[] block.
650 public Object[] getUpdatedView(SequenceI[][] nvismsa,
651 AlignmentOrder[] orders, char gapCharacter)
653 if (sequences == null || width <= 0)
655 throw new Error(MessageManager.getString("error.empty_view_cannot_be_updated"));
660 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
662 if (contigs != null && contigs.length > 0)
664 SequenceI[] alignment = new SequenceI[sequences.length];
665 ColumnSelection columnselection = new ColumnSelection();
666 if (contigs != null && contigs.length > 0)
672 for (int contig = 0; contig < contigs.length; contig += 3)
674 owidth += contigs[contig + 2]; // recover final column width
675 if (contigs[contig + 1] - start > 0)
677 int swidth = 0; // subalignment width
678 if (nvismsa[j] != null)
680 SequenceI mseq[] = nvismsa[j];
681 AlignmentOrder order = (orders == null) ? null : orders[j];
683 if (mseq.length != sequences.length)
685 throw new Error(MessageManager.formatMessage("error.mismatch_between_number_of_sequences_in_block", new String[]{Integer.valueOf(j).toString(),Integer.valueOf(mseq.length).toString(),Integer.valueOf(sequences.length).toString() }));
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(MessageManager.getString("error.padding_not_yet_implemented"));
845 { alignment, columnselection };
849 if (nvismsa.length != 1)
851 throw new Error(MessageManager.formatMessage("error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view", new String[]{Integer.valueOf(nvismsa.length).toString()}));
853 if (nvismsa[0] != null)
856 { nvismsa[0], new ColumnSelection() };
860 return getAlignmentAndColumnSelection(gapCharacter);
866 * returns simple array of start end positions of visible range on alignment.
867 * vis_start and vis_end are inclusive - use
868 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
869 * from underlying alignment.
871 * @return int[] { start_i, end_i } for 1<i<n visible regions.
873 public int[] getVisibleContigs()
875 if (contigs != null && contigs.length > 0)
880 for (int contig = 0; contig < contigs.length; contig += 3)
882 if ((contigs[contig + 1] - start) > 0)
886 fwidth += contigs[contig + 2]; // end up with full region width
887 // (including hidden regions)
888 start = contigs[contig + 1] + contigs[contig + 2];
894 int viscontigs[] = new int[nvis * 2];
897 for (int contig = 0; contig < contigs.length; contig += 3)
899 if ((contigs[contig + 1] - start) > 0)
901 viscontigs[nvis] = start;
902 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
905 start = contigs[contig + 1] + contigs[contig + 2];
909 viscontigs[nvis] = start;
910 viscontigs[nvis + 1] = fwidth; // end is inclusive
924 * @return position of first visible column of AlignmentView within its
925 * parent's alignment reference frame
927 public int getAlignmentOrigin()
933 * compute a deletion map for the current view according to the given
937 * (as returned from SequenceI.gapMap())
938 * @return int[] {intersection of visible regions with gapMap)
940 public int[] getVisibleContigMapFor(int[] gapMap)
943 int[] viscontigs = getVisibleContigs();
946 if (viscontigs != null)
948 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
949 // always be equal to or shorter than gapMap
950 delMap = new int[gapMap.length];
951 for (int contig = 0; contig < viscontigs.length; contig += 2)
954 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
958 while (spos < gapMap.length
959 && gapMap[spos] <= viscontigs[contig + 1])
961 delMap[i++] = spos++;
964 int tmap[] = new int[i];
965 System.arraycopy(delMap, 0, tmap, 0, i);
972 * apply the getSeq(gc) method to each sequence cigar, and return the array of
973 * edited sequences, optionally with hidden regions removed.
976 * gap character to use for insertions
978 * remove hidden regions from sequences. Note: currently implemented
979 * in a memory inefficient way - space needed is 2*result set for
982 * @return SequenceI[]
984 public SequenceI[] getEditedSequences(char gc, boolean delete)
986 SeqCigar[] msf = getSequences();
987 SequenceI[] aln = new SequenceI[msf.length];
988 for (int i = 0, j = msf.length; i < j; i++)
990 aln[i] = msf[i].getSeq(gc);
994 String[] sqs = getSequenceStrings(gc);
995 for (int i = 0; i < sqs.length; i++)
997 aln[i].setSequence(sqs[i]);
1004 public static void summariseAlignmentView(AlignmentView view,
1007 os.print("View has " + view.sequences.length + " of which ");
1008 if (view.selected == null)
1014 os.print(" " + view.selected.size());
1016 os.println(" are selected.");
1017 os.print("View is " + view.getWidth() + " columns wide");
1019 int[] contigs = view.getContigs();
1020 if (contigs != null)
1022 viswid = view.width;
1023 for (int i = 0; i < contigs.length; i += 3)
1025 viswid += contigs[i + 2];
1027 os.println("with " + viswid + " visible columns spread over "
1028 + contigs.length / 3 + " regions.");
1032 viswid = view.width;
1035 if (view.scGroups != null)
1037 os.println("There are " + view.scGroups.size()
1038 + " groups defined on the view.");
1039 for (int g = 0; g < view.scGroups.size(); g++)
1041 ScGroup sgr = (ScGroup) view.scGroups.elementAt(g);
1042 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1043 + " Contains " + sgr.seqs.size() + " Seqs.");
1044 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1045 + sgr.sg.getEndRes());
1046 for (int s = 0; s < sgr.seqs.size(); s++)
1048 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1050 os.println("** WARNING: sequence "
1051 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1052 + " is not marked as member of group.");
1056 AlignmentI visal = view.getVisibleAlignment('-');
1059 os.println("Vis. alignment is " + visal.getWidth()
1060 + " wide and has " + visal.getHeight() + " seqs.");
1061 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1065 for (SequenceGroup sg : visal.getGroups())
1067 os.println("Group " + (i++) + " begins at column "
1068 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1075 public static void testSelectionViews(AlignmentI alignment,
1076 ColumnSelection csel, SequenceGroup selection)
1078 System.out.println("Testing standard view creation:\n");
1079 AlignmentView view = null;
1083 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1084 view = new AlignmentView(alignment, csel, selection, false, false,
1086 summariseAlignmentView(view, System.out);
1088 } catch (Exception e)
1090 e.printStackTrace();
1092 .println("Failed to generate alignment with selection but no groups marked.");
1097 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1098 view = new AlignmentView(alignment, csel, selection, false, false,
1100 summariseAlignmentView(view, System.out);
1101 } catch (Exception e)
1103 e.printStackTrace();
1105 .println("Failed to generate alignment with selection marked but no groups marked.");
1110 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1111 view = new AlignmentView(alignment, csel, selection, false, true,
1113 summariseAlignmentView(view, System.out);
1114 } catch (Exception e)
1116 e.printStackTrace();
1118 .println("Failed to generate alignment with selection restricted but no groups marked.");
1123 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1124 view = new AlignmentView(alignment, csel, selection, false, true,
1126 summariseAlignmentView(view, System.out);
1127 } catch (Exception e)
1129 e.printStackTrace();
1131 .println("Failed to generate alignment with selection restricted and groups marked.");
1136 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1137 view = new AlignmentView(alignment, csel, selection, true, false,
1139 summariseAlignmentView(view, System.out);
1140 } catch (Exception e)
1142 e.printStackTrace();
1144 .println("Failed to generate alignment with selection but no groups marked.");
1149 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1150 view = new AlignmentView(alignment, csel, selection, true, false,
1152 summariseAlignmentView(view, System.out);
1153 } catch (Exception e)
1155 e.printStackTrace();
1157 .println("Failed to generate alignment with selection marked but no groups marked.");
1162 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1163 view = new AlignmentView(alignment, csel, selection, true, true,
1165 summariseAlignmentView(view, System.out);
1166 } catch (Exception e)
1168 e.printStackTrace();
1170 .println("Failed to generate alignment with selection restricted but no groups marked.");
1175 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1176 view = new AlignmentView(alignment, csel, selection, true, true, true);
1177 summariseAlignmentView(view, System.out);
1178 } catch (Exception e)
1180 e.printStackTrace();
1182 .println("Failed to generate alignment with selection restricted and groups marked.");