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.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 seqsets.set(g, sg.getSequences(null));
184 // seqsets now contains vectors (should be sets) for each group, so we can
185 // track when we've done with the group
188 for (int i = 0; i < selseqs.length; i++)
190 if (selseqs[i] != null)
192 if (selection != null && selection.getSize() > 0
193 && !selectedRegionOnly)
195 sequences[csi].setGroupMembership(selected);
196 selected.addElement(sequences[csi]);
200 for (int sg = 0; sg < sgrps.length; sg++)
202 if ((seqsets.get(sg)).contains(selseqs[i]))
204 sequences[csi].setGroupMembership(sgrps[sg]);
205 sgrps[sg].sg.deleteSequence(selseqs[i], false);
206 sgrps[sg].seqs.addElement(sequences[csi]);
209 if (scGroups == null)
211 scGroups = new ArrayList<ScGroup>();
214 scGroups.add(sgrps[sg]);
222 // finally, delete the remaining sequences (if any) not selected
223 for (int sg = 0; sg < sgrps.length; sg++)
225 SequenceI[] sqs = sgrps[sg].sg.getSequencesAsArray(null);
226 for (int si = 0; si < sqs.length; si++)
228 sgrps[sg].sg.deleteSequence(sqs[si], false);
235 * construct an alignmentView from a SeqCigarArray. Errors are thrown if the
236 * seqcigararray.isSeqCigarArray() flag is not set.
238 public AlignmentView(CigarArray seqcigararray)
240 if (!seqcigararray.isSeqCigarArray())
242 throw new Error(MessageManager.getString("error.implementation_error_can_only_make_alignmnet_from_cigararray"));
244 // contigs = seqcigararray.applyDeletions();
245 contigs = seqcigararray.getDeletedRegions();
246 sequences = seqcigararray.getSeqCigarArray();
247 width = seqcigararray.getWidth(); // visible width
251 * Create an alignmentView where the first column corresponds with the
252 * 'firstcol' column of some reference alignment
257 public AlignmentView(CigarArray sdata, int firstcol)
263 public void setSequences(SeqCigar[] sequences)
265 this.sequences = sequences;
268 public void setContigs(int[] contigs)
270 this.contigs = contigs;
273 public SeqCigar[] getSequences()
279 * @see CigarArray.getDeletedRegions
280 * @return int[] { vis_start, sym_start, length }
282 public int[] getContigs()
288 * get the full alignment and a columnselection object marking the hidden
291 * @param gapCharacter
293 * @return Object[] { SequenceI[], ColumnSelection}
295 public Object[] getAlignmentAndColumnSelection(char gapCharacter)
297 ColumnSelection colsel = new ColumnSelection();
301 SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel,
306 * return the visible alignment corresponding to this view. Sequences in this
307 * alignment are edited versions of the parent sequences - where hidden
308 * regions have been removed. NOTE: the sequence data in this alignment is not
314 public AlignmentI getVisibleAlignment(char c)
316 SequenceI[] aln = getVisibleSeqs(c);
318 AlignmentI vcal = new Alignment(aln);
319 addPrunedGroupsInOrder(vcal, -1, -1, true);
324 * add groups from view to the given alignment
330 * -1 or gstart to width-1
332 * - true if vcal is alignment of the visible regions of the view
333 * (e.g. as returned from getVisibleAlignment)
335 private void addPrunedGroupsInOrder(AlignmentI vcal, int gstart,
336 int gend, boolean viscontigs)
339 if (gstart > -1 && gstart <= gend)
344 SequenceI[] aln = vcal.getSequencesArray();
347 * prune any groups to the visible coordinates of the alignment.
350 int nvg = (scGroups != null) ? scGroups.size() : 0;
353 SequenceGroup[] nsg = new SequenceGroup[nvg];
354 for (int g = 0; g < nvg; g++)
356 SequenceGroup sg = scGroups.get(g).sg;
359 if (sg.getStartRes() > gend || sg.getEndRes() < gstart)
367 // clone group properties
368 nsg[g] = new SequenceGroup(sg);
370 // may need to shift/trim start and end ?
371 if (r && !viscontigs)
373 // Not fully tested code - routine not yet called with
375 if (nsg[g].getStartRes() < gstart)
377 nsg[g].setStartRes(0);
381 nsg[g].setStartRes(nsg[g].getStartRes() - gstart);
382 nsg[g].setEndRes(nsg[g].getEndRes() - gstart);
384 if (nsg[g].getEndRes() > (gend - gstart))
386 nsg[g].setEndRes(gend - gstart);
392 // prune groups to cover just the visible positions between
397 ShiftList prune = new ShiftList();
400 // adjust for start of alignment within visible window.
401 prune.addShift(gstart, -gstart); //
403 for (int h = 0; h < contigs.length; h += 3)
406 prune.addShift(p + contigs[h + 1], contigs[h + 2]
409 p = contigs[h + 1] + contigs[h + 2];
411 for (int g = 0; g < nsg.length; g++)
415 int s = nsg[g].getStartRes(), t = nsg[g].getEndRes();
430 nsg[g].setStartRes(s);
437 for (int nsq = 0; nsq < aln.length; nsq++)
439 for (int g = 0; g < nvg; g++)
442 && sequences[nsq].isMemberOf(scGroups.get(g)))
444 nsg[g].addSequence(aln[nsq], false);
448 for (int g = 0; g < nvg; g++)
450 if (nsg[g] != null && nsg[g].getSize() > 0)
452 vcal.addGroup(nsg[g]);
462 * generate sequence array corresponding to the visible parts of the
468 private SequenceI[] getVisibleSeqs(char c)
470 SequenceI[] aln = new SequenceI[sequences.length];
471 for (int i = 0, j = sequences.length; i < j; i++)
473 aln[i] = sequences[i].getSeq('-');
475 // Remove hidden regions from sequence objects.
476 String seqs[] = getSequenceStrings('-');
477 for (int i = 0, j = aln.length; i < j; i++)
479 aln[i].setSequence(seqs[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 * get an array of visible sequence strings for a view on an alignment using
516 * the given gap character
522 public String[] getSequenceStrings(char c)
524 String[] seqs = new String[sequences.length];
525 for (int n = 0; n < sequences.length; n++)
527 String fullseq = sequences[n].getSequenceString(c);
532 for (int h = 0; h < contigs.length; h += 3)
534 seqs[n] += fullseq.substring(p, contigs[h + 1]);
535 p = contigs[h + 1] + contigs[h + 2];
537 seqs[n] += fullseq.substring(p);
549 * @return visible number of columns in alignment view
551 public int getWidth()
556 protected void setWidth(int width)
562 * get the contiguous subalignments in an alignment view.
564 * @param gapCharacter
566 * @return SequenceI[][]
568 public SequenceI[][] getVisibleContigs(char gapCharacter)
572 if (sequences == null || width <= 0)
576 if (contigs != null && contigs.length > 0)
581 for (int contig = 0; contig < contigs.length; contig += 3)
583 if ((contigs[contig + 1] - start) > 0)
587 fwidth += contigs[contig + 2]; // end up with full region width
588 // (including hidden regions)
589 start = contigs[contig + 1] + contigs[contig + 2];
595 smsa = new SequenceI[njobs][];
598 for (int contig = 0; contig < contigs.length; contig += 3)
600 if (contigs[contig + 1] - start > 0)
602 SequenceI mseq[] = new SequenceI[sequences.length];
603 for (int s = 0; s < mseq.length; s++)
605 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(
606 start, contigs[contig + 1]);
611 start = contigs[contig + 1] + contigs[contig + 2];
615 SequenceI mseq[] = new SequenceI[sequences.length];
616 for (int s = 0; s < mseq.length; s++)
618 mseq[s] = sequences[s].getSeq(gapCharacter).getSubSequence(start,
627 smsa = new SequenceI[1][];
628 smsa[0] = new SequenceI[sequences.length];
629 for (int s = 0; s < sequences.length; s++)
631 smsa[0][s] = sequences[s].getSeq(gapCharacter);
638 * return full msa and hidden regions with visible blocks replaced with new
644 * AlignmentOrder[] corresponding to each SequenceI[] block.
647 public Object[] getUpdatedView(SequenceI[][] nvismsa,
648 AlignmentOrder[] orders, char gapCharacter)
650 if (sequences == null || width <= 0)
652 throw new Error(MessageManager.getString("error.empty_view_cannot_be_updated"));
657 "nvismsa==null. use getAlignmentAndColumnSelection() instead.");
659 if (contigs != null && contigs.length > 0)
661 SequenceI[] alignment = new SequenceI[sequences.length];
662 ColumnSelection columnselection = new ColumnSelection();
663 if (contigs != null && contigs.length > 0)
669 for (int contig = 0; contig < contigs.length; contig += 3)
671 owidth += contigs[contig + 2]; // recover final column width
672 if (contigs[contig + 1] - start > 0)
674 int swidth = 0; // subalignment width
675 if (nvismsa[j] != null)
677 SequenceI mseq[] = nvismsa[j];
678 AlignmentOrder order = (orders == null) ? null : orders[j];
680 if (mseq.length != sequences.length)
682 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() }));
684 swidth = mseq[0].getLength(); // JBPNote: could ensure padded
686 for (int s = 0; s < mseq.length; s++)
688 if (alignment[s] == null)
690 alignment[s] = mseq[s];
694 alignment[s].setSequence(alignment[s]
695 .getSequenceAsString()
696 + mseq[s].getSequenceAsString());
697 if (mseq[s].getStart() <= mseq[s].getEnd())
699 alignment[s].setEnd(mseq[s].getEnd());
703 order.updateSequence(mseq[s], alignment[s]);
710 // recover original alignment block or place gaps
713 // recover input data
714 for (int s = 0; s < sequences.length; s++)
716 SequenceI oseq = sequences[s].getSeq(gapCharacter)
717 .getSubSequence(start, contigs[contig + 1]);
718 if (swidth < oseq.getLength())
720 swidth = oseq.getLength();
722 if (alignment[s] == null)
728 alignment[s].setSequence(alignment[s]
729 .getSequenceAsString()
730 + oseq.getSequenceAsString());
731 if (oseq.getEnd() >= oseq.getStart())
733 alignment[s].setEnd(oseq.getEnd());
743 // advance to begining of visible region
744 start = contigs[contig + 1] + contigs[contig + 2];
745 // add hidden segment to right of next region
746 for (int s = 0; s < sequences.length; s++)
748 SequenceI hseq = sequences[s].getSeq(gapCharacter)
749 .getSubSequence(contigs[contig + 1], start);
750 if (alignment[s] == null)
756 alignment[s].setSequence(alignment[s].getSequenceAsString()
757 + hseq.getSequenceAsString());
758 if (hseq.getEnd() >= hseq.getStart())
760 alignment[s].setEnd(hseq.getEnd());
764 // mark hidden segment as hidden in the new alignment
765 columnselection.hideColumns(nwidth, nwidth + contigs[contig + 2]
767 nwidth += contigs[contig + 2];
769 // Do final segment - if it exists
770 if (j < nvismsa.length)
773 if (nvismsa[j] != null)
775 SequenceI mseq[] = nvismsa[j];
776 AlignmentOrder order = (orders != null) ? orders[j] : null;
777 swidth = mseq[0].getLength();
778 for (int s = 0; s < mseq.length; s++)
780 if (alignment[s] == null)
782 alignment[s] = mseq[s];
786 alignment[s].setSequence(alignment[s].getSequenceAsString()
787 + mseq[s].getSequenceAsString());
788 if (mseq[s].getEnd() >= mseq[s].getStart())
790 alignment[s].setEnd(mseq[s].getEnd());
794 order.updateSequence(mseq[s], alignment[s]);
803 // recover input data or place gaps
806 // recover input data
807 for (int s = 0; s < sequences.length; s++)
809 SequenceI oseq = sequences[s].getSeq(gapCharacter)
810 .getSubSequence(start, owidth + 1);
811 if (swidth < oseq.getLength())
813 swidth = oseq.getLength();
815 if (alignment[s] == null)
821 alignment[s].setSequence(alignment[s]
822 .getSequenceAsString()
823 + oseq.getSequenceAsString());
824 if (oseq.getEnd() >= oseq.getStart())
826 alignment[s].setEnd(oseq.getEnd());
835 throw new Error(MessageManager.getString("error.padding_not_yet_implemented"));
842 { alignment, columnselection };
846 if (nvismsa.length != 1)
848 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()}));
850 if (nvismsa[0] != null)
853 { nvismsa[0], new ColumnSelection() };
857 return getAlignmentAndColumnSelection(gapCharacter);
863 * returns simple array of start end positions of visible range on alignment.
864 * vis_start and vis_end are inclusive - use
865 * SequenceI.getSubSequence(vis_start, vis_end+1) to recover visible sequence
866 * from underlying alignment.
868 * @return int[] { start_i, end_i } for 1<i<n visible regions.
870 public int[] getVisibleContigs()
872 if (contigs != null && contigs.length > 0)
877 for (int contig = 0; contig < contigs.length; contig += 3)
879 if ((contigs[contig + 1] - start) > 0)
883 fwidth += contigs[contig + 2]; // end up with full region width
884 // (including hidden regions)
885 start = contigs[contig + 1] + contigs[contig + 2];
891 int viscontigs[] = new int[nvis * 2];
894 for (int contig = 0; contig < contigs.length; contig += 3)
896 if ((contigs[contig + 1] - start) > 0)
898 viscontigs[nvis] = start;
899 viscontigs[nvis + 1] = contigs[contig + 1] - 1; // end is inclusive
902 start = contigs[contig + 1] + contigs[contig + 2];
906 viscontigs[nvis] = start;
907 viscontigs[nvis + 1] = fwidth; // end is inclusive
921 * @return position of first visible column of AlignmentView within its
922 * parent's alignment reference frame
924 public int getAlignmentOrigin()
930 * compute a deletion map for the current view according to the given
934 * (as returned from SequenceI.gapMap())
935 * @return int[] {intersection of visible regions with gapMap)
937 public int[] getVisibleContigMapFor(int[] gapMap)
940 int[] viscontigs = getVisibleContigs();
943 if (viscontigs != null)
945 // viscontigs maps from a subset of the gapMap to the gapMap, so it will
946 // always be equal to or shorter than gapMap
947 delMap = new int[gapMap.length];
948 for (int contig = 0; contig < viscontigs.length; contig += 2)
951 while (spos < gapMap.length && gapMap[spos] < viscontigs[contig])
955 while (spos < gapMap.length
956 && gapMap[spos] <= viscontigs[contig + 1])
958 delMap[i++] = spos++;
961 int tmap[] = new int[i];
962 System.arraycopy(delMap, 0, tmap, 0, i);
969 * apply the getSeq(gc) method to each sequence cigar, and return the array of
970 * edited sequences, optionally with hidden regions removed.
973 * gap character to use for insertions
975 * remove hidden regions from sequences. Note: currently implemented
976 * in a memory inefficient way - space needed is 2*result set for
979 * @return SequenceI[]
981 public SequenceI[] getEditedSequences(char gc, boolean delete)
983 SeqCigar[] msf = getSequences();
984 SequenceI[] aln = new SequenceI[msf.length];
985 for (int i = 0, j = msf.length; i < j; i++)
987 aln[i] = msf[i].getSeq(gc);
991 String[] sqs = getSequenceStrings(gc);
992 for (int i = 0; i < sqs.length; i++)
994 aln[i].setSequence(sqs[i]);
1001 public static void summariseAlignmentView(AlignmentView view,
1004 os.print("View has " + view.sequences.length + " of which ");
1005 if (view.selected == null)
1011 os.print(" " + view.selected.size());
1013 os.println(" are selected.");
1014 os.print("View is " + view.getWidth() + " columns wide");
1016 int[] contigs = view.getContigs();
1017 if (contigs != null)
1019 viswid = view.width;
1020 for (int i = 0; i < contigs.length; i += 3)
1022 viswid += contigs[i + 2];
1024 os.println("with " + viswid + " visible columns spread over "
1025 + contigs.length / 3 + " regions.");
1029 viswid = view.width;
1032 if (view.scGroups != null)
1034 os.println("There are " + view.scGroups.size()
1035 + " groups defined on the view.");
1036 for (int g = 0; g < view.scGroups.size(); g++)
1038 ScGroup sgr = view.scGroups.get(g);
1039 os.println("Group " + g + ": Name = " + sgr.sg.getName()
1040 + " Contains " + sgr.seqs.size() + " Seqs.");
1041 os.println("This group runs from " + sgr.sg.getStartRes() + " to "
1042 + sgr.sg.getEndRes());
1043 for (int s = 0; s < sgr.seqs.size(); s++)
1045 if (!((SeqCigar) sgr.seqs.elementAt(s)).isMemberOf(sgr))
1047 os.println("** WARNING: sequence "
1048 + ((SeqCigar) sgr.seqs.elementAt(s)).toString()
1049 + " is not marked as member of group.");
1053 AlignmentI visal = view.getVisibleAlignment('-');
1056 os.println("Vis. alignment is " + visal.getWidth()
1057 + " wide and has " + visal.getHeight() + " seqs.");
1058 if (visal.getGroups() != null && visal.getGroups().size() > 0)
1062 for (SequenceGroup sg : visal.getGroups())
1064 os.println("Group " + (i++) + " begins at column "
1065 + sg.getStartRes() + " and ends at " + sg.getEndRes());
1072 public static void testSelectionViews(AlignmentI alignment,
1073 ColumnSelection csel, SequenceGroup selection)
1075 System.out.println("Testing standard view creation:\n");
1076 AlignmentView view = null;
1080 .println("View with no hidden columns, no limit to selection, no groups to be collected:");
1081 view = new AlignmentView(alignment, csel, selection, false, false,
1083 summariseAlignmentView(view, System.out);
1085 } catch (Exception e)
1087 e.printStackTrace();
1089 .println("Failed to generate alignment with selection but no groups marked.");
1094 .println("View with no hidden columns, no limit to selection, and all groups to be collected:");
1095 view = new AlignmentView(alignment, csel, selection, false, false,
1097 summariseAlignmentView(view, System.out);
1098 } catch (Exception e)
1100 e.printStackTrace();
1102 .println("Failed to generate alignment with selection marked but no groups marked.");
1107 .println("View with no hidden columns, limited to selection and no groups to be collected:");
1108 view = new AlignmentView(alignment, csel, selection, false, true,
1110 summariseAlignmentView(view, System.out);
1111 } catch (Exception e)
1113 e.printStackTrace();
1115 .println("Failed to generate alignment with selection restricted but no groups marked.");
1120 .println("View with no hidden columns, limited to selection, and all groups to be collected:");
1121 view = new AlignmentView(alignment, csel, selection, false, true,
1123 summariseAlignmentView(view, System.out);
1124 } catch (Exception e)
1126 e.printStackTrace();
1128 .println("Failed to generate alignment with selection restricted and groups marked.");
1133 .println("View *with* hidden columns, no limit to selection, no groups to be collected:");
1134 view = new AlignmentView(alignment, csel, selection, true, false,
1136 summariseAlignmentView(view, System.out);
1137 } catch (Exception e)
1139 e.printStackTrace();
1141 .println("Failed to generate alignment with selection but no groups marked.");
1146 .println("View *with* hidden columns, no limit to selection, and all groups to be collected:");
1147 view = new AlignmentView(alignment, csel, selection, true, false,
1149 summariseAlignmentView(view, System.out);
1150 } catch (Exception e)
1152 e.printStackTrace();
1154 .println("Failed to generate alignment with selection marked but no groups marked.");
1159 .println("View *with* hidden columns, limited to selection and no groups to be collected:");
1160 view = new AlignmentView(alignment, csel, selection, true, true,
1162 summariseAlignmentView(view, System.out);
1163 } catch (Exception e)
1165 e.printStackTrace();
1167 .println("Failed to generate alignment with selection restricted but no groups marked.");
1172 .println("View *with* hidden columns, limited to selection, and all groups to be collected:");
1173 view = new AlignmentView(alignment, csel, selection, true, true, true);
1174 summariseAlignmentView(view, System.out);
1175 } catch (Exception e)
1177 e.printStackTrace();
1179 .println("Failed to generate alignment with selection restricted and groups marked.");