org.emboss.jemboss.editor
Class Consensus

java.lang.Object
  extended byorg.emboss.jemboss.editor.Consensus

public class Consensus
extends java.lang.Object

Calculate a consensus using the same method as 'cons' in the EMBOSS suite.


Field Summary
private  java.lang.String cons
           
private  int[][] matrix
           
 
Constructor Summary
Consensus(java.io.File matrixFile, java.util.Vector seqs, float fplural, float setcase, int identity)
           
Consensus(Matrix mat, java.util.Vector seqs, float fplural, float setcase, int identity)
           
Consensus(java.lang.String matrixJar, java.lang.String matrixFileName, java.util.Vector seqs, float fplural, float setcase, int identity)
           
 
Method Summary
private  void calculateCons(Matrix mat, java.util.Vector seqs, float fplural, float setcase, int identity)
          Routine to calculate the consensus of a set of sequences
 Sequence getConsensusSequence()
          Get the consensus sequence
 int getMaxSequenceLength(java.util.Vector seqs)
          Check all sequences lengths and return length of the longest sequence
 java.lang.String getResidue(java.util.Vector seqs, int i, int k)
          Get the residue at a given position from a given sequence
 float getSequenceWeight(java.util.Vector seqs, int i)
          Get the sequence weight
 boolean isEqualSequenceLength(java.util.Vector seqs)
          Check all sequences are the same length
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrix

private int[][] matrix

cons

private java.lang.String cons
Constructor Detail

Consensus

public Consensus(java.io.File matrixFile,
                 java.util.Vector seqs,
                 float fplural,
                 float setcase,
                 int identity)
Parameters:
matrixFile - scoring matrix file
seqs - vector of Sequence objects
fplural - defines no. of +ve scoring matches below which there is no consensus.
setcase - upper/lower case given if score above/below user defined +ve matching threshold.
identity - defines the number of identical symbols requires in an alignment column for it to included in the consensus.

Consensus

public Consensus(java.lang.String matrixJar,
                 java.lang.String matrixFileName,
                 java.util.Vector seqs,
                 float fplural,
                 float setcase,
                 int identity)
Parameters:
matrixJar - jar file containing scoring matrix
matrixFileName - scoring matrix file name
seqs - vector of Sequence objects
fplural - defines no. of +ve scoring matches below which there is no consensus.
setcase - upper/lower case given if score above/below user defined +ve matching threshold.
identity - defines the number of identical symbols requires in an alignment column for it to included in the consensus.

Consensus

public Consensus(Matrix mat,
                 java.util.Vector seqs,
                 float fplural,
                 float setcase,
                 int identity)
Parameters:
mat - scoring matrix
seqs - vector of Sequence objects
fplural - defines no. of +ve scoring matches below which there is no consensus.
setcase - upper/lower case given if score above/below user defined +ve matching threshold.
identity - defines the number of identical symbols requires in an alignment column for it to included in the consensus.
Method Detail

calculateCons

private void calculateCons(Matrix mat,
                           java.util.Vector seqs,
                           float fplural,
                           float setcase,
                           int identity)
Routine to calculate the consensus of a set of sequences

Parameters:
mat - scoring matrix
seqs - vector of Sequence objects
fplural - defines no. of +ve scoring matches below which there is no consensus.
setcase - upper/lower case given if score above/below user defined +ve matching threshold.
identity - defines the number of identical symbols requires in an alignment column for it to included in the consensus.

isEqualSequenceLength

public boolean isEqualSequenceLength(java.util.Vector seqs)
Check all sequences are the same length

Parameters:
seqs - collection of sequences
Returns:
true if all sequences are the same length

getMaxSequenceLength

public int getMaxSequenceLength(java.util.Vector seqs)
Check all sequences lengths and return length of the longest sequence

Parameters:
seqs - collection of sequences
Returns:
length of longest sequence

getConsensusSequence

public Sequence getConsensusSequence()
Get the consensus sequence

Returns:
the consensus sequence

getSequenceWeight

public float getSequenceWeight(java.util.Vector seqs,
                               int i)
Get the sequence weight

Parameters:
seqs - set of sequences
i - index of a sequence in the set
Returns:
sequence weight

getResidue

public java.lang.String getResidue(java.util.Vector seqs,
                                   int i,
                                   int k)
Get the residue at a given position from a given sequence

Parameters:
seqs - set of sequences
i - index of a sequence in the set
Returns:
residue

main

public static void main(java.lang.String[] args)