uk.ac.man.bioinf.sequence.alignment
Class AlignmentColumn

java.lang.Object
  |
  +--uk.ac.man.bioinf.sequence.alignment.AlignmentColumn

public class AlignmentColumn
extends Object

AlignmentColumn.java The Sequence and SequenceAlignment classes have been created to be fail-fast. They throw exceptions if attempts are made to access and element outside of the range of the sequence. Additionally the alignment allows sequences to start at any place within the alignment which is very nice, but has the disadvantage of being a little fiddly to use in some circumstances. This class addresses this problem. Essentially it is a mask over a sequence alignment. It can be moved to any column of the alignment, and will then return the elements down that column. It takes care of the offsets, and returns a simple gap Element if a request is made for an Element from before a sequence starts or after a sequence finishes, so long as the row > 0 and < alignment.getLength(). Created: Wed Jun 7 14:23:43 2000

Version:
$Id: AlignmentColumn.java,v 1.3 2001/04/11 17:04:43 lord Exp $
Author:
Phillip Lord

Constructor Summary
AlignmentColumn()
           
AlignmentColumn(SequenceAlignment alignment)
           
 
Method Summary
 SequenceAlignment getAlignment()
           
 int getColumn()
           
 Element getElementAtRow(int row)
          Get the element for this column at the given row.
 void setAlignment(SequenceAlignment alignment)
           
 void setColumn(int column)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlignmentColumn

public AlignmentColumn()

AlignmentColumn

public AlignmentColumn(SequenceAlignment alignment)
Method Detail

setAlignment

public void setAlignment(SequenceAlignment alignment)

getAlignment

public SequenceAlignment getAlignment()

setColumn

public void setColumn(int column)

getColumn

public int getColumn()

getElementAtRow

public Element getElementAtRow(int row)
                        throws NoSuchSequenceException,
                               IllegalStateException
Get the element for this column at the given row. This will return a Gap element if in front or after the sequence.

Parameters:
row - the row
Returns:
the element
Throws:
NoSuchSequenceException - if row < 1 or row > getNumberSequences()
IllegalStateException - if the alignment has not been set