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;
22 public AlignmentView(CigarArray seqcigararray)
24 if (!seqcigararray.isSeqCigarArray())
25 throw new Error("Implementation Error - can only make an alignment view from a CigarArray of sequences.");
26 //contigs = seqcigararray.applyDeletions();
27 contigs = seqcigararray.getDeletedRegions();
28 sequences = seqcigararray.getSeqCigarArray();
31 public void setSequences(SeqCigar[] sequences)
33 this.sequences = sequences;
36 public void setContigs(int[] contigs)
38 this.contigs = contigs;
41 public SeqCigar[] getSequences()
46 public int[] getContigs()
50 public Object[] getAlignmentAndColumnSelection(char gapCharacter) {
51 ColumnSelection colsel = new ColumnSelection();
53 return new Object[] { SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel, contigs), colsel};
61 public String[] getSequenceStrings(char c)
63 String[] seqs=new String[sequences.length];
64 for (int n=0; n<sequences.length; n++) {
65 seqs[n] = sequences[n].getSequenceString(c);