BioinfoFieldExtractor
Class ConsensusSeq

java.lang.Object
  extended by BioinfoFieldExtractor.ConsensusSeq

public class ConsensusSeq
extends java.lang.Object

This is the generic class for storing a consensus sequence. A sequence is stored as a double array list where an index of a row is the position of character in a sequence. The columns of a row are all the possible characters that are met at that position retrieved from multiple-aligned sequences. If only one column corresponds to a row, meaning that the symbol is unique and identical at that position across all generated sequences. If more than one column assigned to a row, it then contains all possible characters met at that position across the generated sequences.

Author:
Serge Gorbunov

Constructor Summary
ConsensusSeq()
           
 
Method Summary
 boolean generateSeq(java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> seqs)
          Populates the consensus sequence from the multiple aligned sequences.
 java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getConsensusSeq()
           
 java.lang.String getConsSeq()
          Returns a consensus sequence with ? inserted whenever there is a mutation at a certain position in the consensus sequence
 java.util.ArrayList<java.lang.Integer> getConsSeqAsList()
           
 void setConsensusSeq(java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> seq)
           
 boolean verifyLengths(java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> seqs)
          Verifies that all sequences are the same length
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsensusSeq

public ConsensusSeq()
Method Detail

generateSeq

public boolean generateSeq(java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> seqs)
Populates the consensus sequence from the multiple aligned sequences.

Parameters:
seqs - An array list of aligned sequences

verifyLengths

public boolean verifyLengths(java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> seqs)
Verifies that all sequences are the same length


getConsSeq

public java.lang.String getConsSeq()
Returns a consensus sequence with ? inserted whenever there is a mutation at a certain position in the consensus sequence


getConsSeqAsList

public java.util.ArrayList<java.lang.Integer> getConsSeqAsList()
Returns:
The consensus sequence as an array list of integers, where each integer is the decimal representation of a letter with 256 indicating a gap

getConsensusSeq

public java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> getConsensusSeq()

setConsensusSeq

public void setConsensusSeq(java.util.ArrayList<java.util.ArrayList<java.lang.Integer>> seq)