1 package jalview.datamodel;
8 * <p>Copyright: Copyright (c) 2004</p>
10 * <p>Company: Dundee University</p>
12 * @author not attributable
15 public class AlignmentView
18 * Transient object compactly representing a 'view' of an alignment - with discontinuities marked.
20 private SeqCigar[] sequences = null;
21 private int[] contigs = null;
23 public AlignmentView(CigarArray seqcigararray)
25 if (!seqcigararray.isSeqCigarArray())
26 throw new Error("Implementation Error - can only make an alignment view from a CigarArray of sequences.");
27 //contigs = seqcigararray.applyDeletions();
28 contigs = seqcigararray.getDeletedRegions();
29 sequences = seqcigararray.getSeqCigarArray();
30 width = seqcigararray.getWidth(); // visible width
33 public void setSequences(SeqCigar[] sequences)
35 this.sequences = sequences;
38 public void setContigs(int[] contigs)
40 this.contigs = contigs;
43 public SeqCigar[] getSequences()
48 public int[] getContigs()
52 public Object[] getAlignmentAndColumnSelection(char gapCharacter) {
53 ColumnSelection colsel = new ColumnSelection();
55 return new Object[] { SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel, contigs), colsel};
63 public String[] getSequenceStrings(char c)
65 String[] seqs=new String[sequences.length];
66 for (int n=0; n<sequences.length; n++) {
67 seqs[n] = sequences[n].getSequenceString(c);
73 * @return visible number of columns in alignment view
75 public int getWidth() {
79 protected void setWidth(int width) {