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())
244 throw new Error(MessageManager.getString("error.implementation_error_can_only_make_alignmnet_from_cigararray"));
246 // contigs = seqcigararray.applyDeletions();
247 contigs = seqcigararray.getDeletedRegions();
248 sequences = seqcigararray.getSeqCigarArray();
249 width = seqcigararray.getWidth(); // visible width
253 * Create an alignmentView where the first column corresponds with the
254 * 'firstcol' column of some reference alignment
259 public AlignmentView(CigarArray sdata, int firstcol)
265 public void setSequences(SeqCigar[] sequences)
267 this.sequences = sequences;
270 public void setContigs(int[] contigs)
272 this.contigs = contigs;
275 public SeqCigar[] getSequences()
281 * @see CigarArray.getDeletedRegions
282 * @return int[] { vis_start, sym_start, length }
284 public int[] getContigs()
290 * get the full alignment and a columnselection object marking the hidden
293 * @param gapCharacter
295 * @return Object[] { SequenceI[], ColumnSelection}
297 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
299 ColumnSelection colsel = new ColumnSelection();
303 SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel,
308 * return the visible alignment corresponding to this view. Sequences in this
309 * alignment are edited versions of the parent sequences - where hidden
310 * regions have been removed. NOTE: the sequence data in this alignment is not
316 public AlignmentI getVisibleAlignment(char c)
318 SequenceI[] aln = getVisibleSeqs(c);
320 AlignmentI vcal = new Alignment(aln);
321 addPrunedGroupsInOrder(vcal, -1, -1, true);
326 * add groups from view to the given alignment
332 * -1 or gstart to width-1
334 * - true if vcal is alignment of the visible regions of the view
335 * (e.g. as returned from getVisibleAlignment)
337 private void addPrunedGroupsInOrder(AlignmentI vcal, int gstart,
338 int gend, boolean viscontigs)
341 if (gstart > -1 && gstart <= gend)
346 SequenceI[] aln = vcal.getSequencesArray();
349 * prune any groups to the visible coordinates of the alignment.
352 int nvg = (scGroups != null) ? scGroups.size() : 0;
355 SequenceGroup[] nsg = new SequenceGroup[nvg];
356 for (int g = 0; g < nvg; g++)
358 SequenceGroup sg = scGroups.get(g).sg;
361 if (sg.getStartRes() > gend || sg.getEndRes() < gstart)
369 // clone group properties
370 nsg[g] = new SequenceGroup(sg);
372 // may need to shift/trim start and end ?
373 if (r && !viscontigs)
375 // Not fully tested code - routine not yet called with
377 if (nsg[g].getStartRes() < gstart)
379 nsg[g].setStartRes(0);
383 nsg[g].setStartRes(nsg[g].getStartRes() - gstart);
384 nsg[g].setEndRes(nsg[g].getEndRes() - gstart);
386 if (nsg[g].getEndRes() > (gend - gstart))
388 nsg[g].setEndRes(gend - gstart);
394 // prune groups to cover just the visible positions between
399 ShiftList prune = new ShiftList();
402 // adjust for start of alignment within visible window.
403 prune.addShift(gstart, -gstart); //
405 for (int h = 0; h < contigs.length; h += 3)
408 prune.addShift(p + contigs[h + 1], contigs[h + 2]
411 p = contigs[h + 1] + contigs[h + 2];
413 for (int g = 0; g < nsg.length; g++)
417 int s = nsg[g].getStartRes(), t = nsg[g].getEndRes();
432 nsg[g].setStartRes(s);
439 for (int nsq = 0; nsq < aln.length; nsq++)
441 for (int g = 0; g < nvg; g++)
444 && sequences[nsq].isMemberOf(scGroups.get(g)))
446 nsg[g].addSequence(aln[nsq], false);
450 for (int g = 0; g < nvg; g++)
452 if (nsg[g] != null && nsg[g].getSize() > 0)
454 vcal.addGroup(nsg[g]);
464 * generate sequence array corresponding to the visible parts of the
470 private SequenceI[] getVisibleSeqs(char c)
472 SequenceI[] aln = new SequenceI[sequences.length];
473 for (int i = 0, j = sequences.length; i < j; i++)
475 aln[i] = sequences[i].getSeq('-');
477 // Remove hidden regions from sequence objects.
478 String seqs[] = getSequenceStrings('-');
479 for (int i = 0, j = aln.length; i < j; i++)
481 aln[i].setSequence(seqs[i]);
487 * creates new alignment objects for all contiguous visible segments
492 * @param regionOfInterest
493 * specify which sequences to include (or null to include all
495 * @return AlignmentI[] - all alignments where each sequence is a subsequence
496 * constructed from visible contig regions of view
498 public AlignmentI[] getVisibleContigAlignments(char c)
501 int[] vcontigs = getVisibleContigs();
502 SequenceI[][] contigviews = getVisibleContigs(c);
503 AlignmentI[] vcals = new AlignmentI[contigviews.length];
504 for (nvc = 0; nvc < contigviews.length; nvc++)
506 vcals[nvc] = new Alignment(contigviews[nvc]);
507 if (scGroups != null && scGroups.size() > 0)
509 addPrunedGroupsInOrder(vcals[nvc], vcontigs[nvc * 2],
510 vcontigs[nvc * 2 + 1], true);
517 * get an array of visible sequence strings for a view on an alignment using
518 * the given gap character
524 public String[] getSequenceStrings(char c)
526 String[] seqs = new String[sequences.length];
527 for (int n = 0; n < sequences.length; n++)
529 String fullseq = sequences[n].getSequenceString(c);
534 for (int h = 0; h < contigs.length; h += 3)
536 seqs[n] += fullseq.substring(p, contigs[h + 1]);
537 p = contigs[h + 1] + contigs[h + 2];
539 seqs[n] += fullseq.substring(p);
551 * @return visible number of columns in alignment view
553 public int getWidth()
558 protected void setWidth(int width)
564 * get the contiguous subalignments in an alignment view.
566 * @param gapCharacter
568 * @return SequenceI[][]
570 public SequenceI[][] getVisibleContigs(char gapCharacter)
574 if (sequences == null || width <= 0)
578 if (contigs != null && contigs.length > 0)
583 for (int contig = 0; contig < contigs.length; contig += 3)
585 if ((contigs[contig + 1] - start) > 0)
589 fwidth += contigs[contig + 2]; // end up with full region width
590 // (including hidden regions)
591 start = contigs[contig + 1] + contigs[contig + 2];
597 smsa = new SequenceI[njobs][];
600 for (int contig = 0; contig < contigs.length; contig += 3)
602 if (contigs[contig + 1] - start > 0)
604 SequenceI mseq[] = new SequenceI[sequences.length];
605 for (int s = 0; s < mseq.length; s++)
607 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
608 start, contigs[contig + 1]);
613 start = contigs[contig + 1] + contigs[contig + 2];
617 SequenceI mseq[] = new SequenceI[sequences.length];
618 for (int s = 0; s < mseq.length; s++)
620 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
629 smsa = new SequenceI[1][];
630 smsa[0] = new SequenceI[sequences.length];
631 for (int s = 0; s < sequences.length; s++)
633 smsa[0][s] = sequences[s].getSeq(gapCharacter);
640 * return full msa and hidden regions with visible blocks replaced with new
646 * AlignmentOrder[] corresponding to each SequenceI[] block.
649 public Object[] getUpdatedView(SequenceI[][] nvismsa,
650 AlignmentOrder[] orders, char gapCharacter)
652 if (sequences == null || width <= 0)
654 throw new Error(MessageManager.getString("error.empty_view_cannot_be_updated"));
659 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
661 if (contigs != null && contigs.length > 0)
663 SequenceI[] alignment = new SequenceI[sequences.length];
664 ColumnSelection columnselection = new ColumnSelection();
665 if (contigs != null && contigs.length > 0)
671 for (int contig = 0; contig < contigs.length; contig += 3)
673 owidth += contigs[contig + 2]; // recover final column width
674 if (contigs[contig + 1] - start > 0)
676 int swidth = 0; // subalignment width
677 if (nvismsa[j] != null)
679 SequenceI mseq[] = nvismsa[j];
680 AlignmentOrder order = (orders == null) ? null : orders[j];
682 if (mseq.length != sequences.length)
684 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() }));
686 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
688 for (int s = 0; s < mseq.length; s++)
690 if (alignment[s] == null)
692 alignment[s] = mseq[s];
696 alignment[s].setSequence(alignment[s]
697 .getSequenceAsString()
698 + mseq[s].getSequenceAsString());
699 if (mseq[s].getStart() <= mseq[s].getEnd())
701 alignment[s].setEnd(mseq[s].getEnd());
705 order.updateSequence(mseq[s], alignment[s]);
712 // recover original alignment block or place gaps
715 // recover input data
716 for (int s = 0; s < sequences.length; s++)
718 SequenceI oseq = sequences[s].getSeq(gapCharacter)
719 .getSubSequence(start, contigs[contig + 1]);
720 if (swidth < oseq.getLength())
722 swidth = oseq.getLength();
724 if (alignment[s] == null)
730 alignment[s].setSequence(alignment[s]
731 .getSequenceAsString()
732 + oseq.getSequenceAsString());
733 if (oseq.getEnd() >= oseq.getStart())
735 alignment[s].setEnd(oseq.getEnd());
745 // advance to begining of visible region
746 start = contigs[contig + 1] + contigs[contig + 2];
747 // add hidden segment to right of next region
748 for (int s = 0; s < sequences.length; s++)
750 SequenceI hseq = sequences[s].getSeq(gapCharacter)
751 .getSubSequence(contigs[contig + 1], start);
752 if (alignment[s] == null)
758 alignment[s].setSequence(alignment[s].getSequenceAsString()
759 + hseq.getSequenceAsString());
760 if (hseq.getEnd() >= hseq.getStart())
762 alignment[s].setEnd(hseq.getEnd());
766 // mark hidden segment as hidden in the new alignment
767 columnselection.hideColumns(nwidth, nwidth + contigs[contig + 2]
769 nwidth += contigs[contig + 2];
771 // Do final segment - if it exists
772 if (j < nvismsa.length)
775 if (nvismsa[j] != null)
777 SequenceI mseq[] = nvismsa[j];
778 AlignmentOrder order = (orders != null) ? orders[j] : null;
779 swidth = mseq[0].getLength();
780 for (int s = 0; s < mseq.length; s++)
782 if (alignment[s] == null)
784 alignment[s] = mseq[s];
788 alignment[s].setSequence(alignment[s].getSequenceAsString()
789 + mseq[s].getSequenceAsString());
790 if (mseq[s].getEnd() >= mseq[s].getStart())
792 alignment[s].setEnd(mseq[s].getEnd());
796 order.updateSequence(mseq[s], alignment[s]);
805 // recover input data or place gaps
808 // recover input data
809 for (int s = 0; s < sequences.length; s++)
811 SequenceI oseq = sequences[s].getSeq(gapCharacter)
812 .getSubSequence(start, owidth + 1);
813 if (swidth < oseq.getLength())
815 swidth = oseq.getLength();
817 if (alignment[s] == null)
823 alignment[s].setSequence(alignment[s]
824 .getSequenceAsString()
825 + oseq.getSequenceAsString());
826 if (oseq.getEnd() >= oseq.getStart())
828 alignment[s].setEnd(oseq.getEnd());
837 throw new Error(MessageManager.getString("error.padding_not_yet_implemented"));
844 { alignment, columnselection };
848 if (nvismsa.length != 1)
850 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()}));
852 if (nvismsa[0] != null)
855 { nvismsa[0], new ColumnSelection() };
859 return getAlignmentAndColumnSelection(gapCharacter);
865 * returns simple array of start end positions of visible range on alignment.
866 * vis_start and vis_end are inclusive - use
867 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
868 * from underlying alignment.
870 * @return int[] { start_i, end_i } for 1<i<n visible regions.
872 public int[] getVisibleContigs()
874 if (contigs != null && contigs.length > 0)
879 for (int contig = 0; contig < contigs.length; contig += 3)
881 if ((contigs[contig + 1] - start) > 0)
885 fwidth += contigs[contig + 2]; // end up with full region width
886 // (including hidden regions)
887 start = contigs[contig + 1] + contigs[contig + 2];
893 int viscontigs[] = new int[nvis * 2];
896 for (int contig = 0; contig < contigs.length; contig += 3)
898 if ((contigs[contig + 1] - start) > 0)
900 viscontigs[nvis] = start;
901 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
904 start = contigs[contig + 1] + contigs[contig + 2];
908 viscontigs[nvis] = start;
909 viscontigs[nvis + 1] = fwidth; // end is inclusive
923 * @return position of first visible column of AlignmentView within its
924 * parent's alignment reference frame
926 public int getAlignmentOrigin()
932 * compute a deletion map for the current view according to the given
936 * (as returned from SequenceI.gapMap())
937 * @return int[] {intersection of visible regions with gapMap)
939 public int[] getVisibleContigMapFor(int[] gapMap)
942 int[] viscontigs = getVisibleContigs();
945 if (viscontigs != null)
947 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
948 // always be equal to or shorter than gapMap
949 delMap = new int[gapMap.length];
950 for (int contig = 0; contig < viscontigs.length; contig += 2)
953 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
957 while (spos < gapMap.length
958 && gapMap[spos] <= viscontigs[contig + 1])
960 delMap[i++] = spos++;
963 int tmap[] = new int[i];
964 System.arraycopy(delMap, 0, tmap, 0, i);
971 * apply the getSeq(gc) method to each sequence cigar, and return the array of
972 * edited sequences, optionally with hidden regions removed.
975 * gap character to use for insertions
977 * remove hidden regions from sequences. Note: currently implemented
978 * in a memory inefficient way - space needed is 2*result set for
981 * @return SequenceI[]
983 public SequenceI[] getEditedSequences(char gc, boolean delete)
985 SeqCigar[] msf = getSequences();
986 SequenceI[] aln = new SequenceI[msf.length];
987 for (int i = 0, j = msf.length; i < j; i++)
989 aln[i] = msf[i].getSeq(gc);
993 String[] sqs = getSequenceStrings(gc);
994 for (int i = 0; i < sqs.length; i++)
996 aln[i].setSequence(sqs[i]);
1003 public static void summariseAlignmentView(AlignmentView view,
1006 os.print("View has " + view.sequences.length + " of which ");
1007 if (view.selected == null)
1013 os.print(" " + view.selected.size());
1015 os.println(" are selected.");
1016 os.print("View is " + view.getWidth() + " columns wide");
1018 int[] contigs = view.getContigs();
1019 if (contigs != null)
1021 viswid = view.width;
1022 for (int i = 0; i < contigs.length; i += 3)
1024 viswid += contigs[i + 2];
1026 os.println("with " + viswid + " visible columns spread over "
1027 + contigs.length / 3 + " regions.");
1031 viswid = view.width;
1034 if (view.scGroups != null)
1036 os.println("There are " + view.scGroups.size()
1037 + " groups defined on the view.");
1038 for (int g = 0; g < view.scGroups.size(); g++)
1040 ScGroup sgr = view.scGroups.get(g);
1041 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1042 + " Contains " + sgr.seqs.size() + " Seqs.");
1043 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1044 + sgr.sg.getEndRes());
1045 for (int s = 0; s < sgr.seqs.size(); s++)
1047 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1049 os.println("** WARNING: sequence "
1050 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1051 + " is not marked as member of group.");
1055 AlignmentI visal = view.getVisibleAlignment('-');
1058 os.println("Vis. alignment is " + visal.getWidth()
1059 + " wide and has " + visal.getHeight() + " seqs.");
1060 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1064 for (SequenceGroup sg : visal.getGroups())
1066 os.println("Group " + (i++) + " begins at column "
1067 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1074 public static void testSelectionViews(AlignmentI alignment,
1075 ColumnSelection csel, SequenceGroup selection)
1077 System.out.println("Testing standard view creation:\n");
1078 AlignmentView view = null;
1082 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1083 view = new AlignmentView(alignment, csel, selection, false, false,
1085 summariseAlignmentView(view, System.out);
1087 } catch (Exception e)
1089 e.printStackTrace();
1091 .println("Failed to generate alignment with selection but no groups marked.");
1096 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1097 view = new AlignmentView(alignment, csel, selection, false, false,
1099 summariseAlignmentView(view, System.out);
1100 } catch (Exception e)
1102 e.printStackTrace();
1104 .println("Failed to generate alignment with selection marked but no groups marked.");
1109 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1110 view = new AlignmentView(alignment, csel, selection, false, true,
1112 summariseAlignmentView(view, System.out);
1113 } catch (Exception e)
1115 e.printStackTrace();
1117 .println("Failed to generate alignment with selection restricted but no groups marked.");
1122 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1123 view = new AlignmentView(alignment, csel, selection, false, true,
1125 summariseAlignmentView(view, System.out);
1126 } catch (Exception e)
1128 e.printStackTrace();
1130 .println("Failed to generate alignment with selection restricted and groups marked.");
1135 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1136 view = new AlignmentView(alignment, csel, selection, true, false,
1138 summariseAlignmentView(view, System.out);
1139 } catch (Exception e)
1141 e.printStackTrace();
1143 .println("Failed to generate alignment with selection but no groups marked.");
1148 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1149 view = new AlignmentView(alignment, csel, selection, true, false,
1151 summariseAlignmentView(view, System.out);
1152 } catch (Exception e)
1154 e.printStackTrace();
1156 .println("Failed to generate alignment with selection marked but no groups marked.");
1161 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1162 view = new AlignmentView(alignment, csel, selection, true, true,
1164 summariseAlignmentView(view, System.out);
1165 } catch (Exception e)
1167 e.printStackTrace();
1169 .println("Failed to generate alignment with selection restricted but no groups marked.");
1174 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1175 view = new AlignmentView(alignment, csel, selection, true, true, true);
1176 summariseAlignmentView(view, System.out);
1177 } catch (Exception e)
1179 e.printStackTrace();
1181 .println("Failed to generate alignment with selection restricted and groups marked.");