jspp
Class SearchMatrix

java.lang.Object
  |
  +--jspp.SearchMatrix
All Implemented Interfaces:
java.io.Serializable

public class SearchMatrix
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
SearchMatrix(int sequencelength, int cleavageposition)
          constructs an empty SearchMatrix
SearchMatrix(java.lang.String[] alignedsequences, int cleavageposition)
          constructs a new SearchMatrix
 
Method Summary
 void addSearchMatrix(SearchMatrix matrix)
          Adds a complete SearchMatrix object to this SearchMatrixThe length of both SearchMatrix must be the same, otherwise a SequenceLengthException will be thrown
 void addSequence(java.lang.String sequence)
          Adds new sequences to the SearchMatrix.
 int getCleavagePosition()
          Returns the cleavage position.
 double getCutOffScore()
          Returns the cutoff score
 double getInformation(int position)
          Returns the information contents of the specified position
 int[][] getMatrix()
          Returns the alignment matrix
 double getRawScore(java.lang.String sequence)
          Returns the raw score
 double getScore(java.lang.String sequence)
          Returns the normalized score.
 int getSequenceLength()
           
 double raw2normalizedScore(double rawscore)
          Transfers a raw score to a normalized score
 void removeSequence(java.lang.String sequence)
          Removes a sequence from the SearchMatrix The sequence length must be the same as the initial weight matrix size, otherwise a SequenceLengthException will be thrown
 void setFrequencyMatrix(SearchMatrix sequences)
          Method for considering the amino acid background
 void setFrequencyMatrix(java.lang.String[] sequences)
          Method for considering the amino acid background
 void setLimits(double cutoff, double uppercutoff)
          Sets the limits for score normalization.
 void writeMatrix(java.io.File file)
          Writes the content of this object as tabulator seperated values in a file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchMatrix

public SearchMatrix(java.lang.String[] alignedsequences,
                    int cleavageposition)
constructs a new SearchMatrix

Parameters:
alignedsequences - String-Array of aligned sequences
cleavageposition - cleavage position inside the aligned sequences

SearchMatrix

public SearchMatrix(int sequencelength,
                    int cleavageposition)
constructs an empty SearchMatrix

Parameters:
sequencelength - length of sequences (signalpeptide+mature protein)
cleavageposition - cleavageposition, normally the same length as signalpeptide
Method Detail

getSequenceLength

public int getSequenceLength()
Returns:
the sequence length of the aligned sequences

addSequence

public void addSequence(java.lang.String sequence)
                 throws jspp.SequenceLengthException
Adds new sequences to the SearchMatrix.

The sequence length must be the same as the initial weight matrix size, otherwise a SequenceLengthException will be thrown

Parameters:
sequence - the sequence to add to the matrix
Throws:
jspp.SequenceLengthException

addSearchMatrix

public void addSearchMatrix(SearchMatrix matrix)
                     throws jspp.SequenceLengthException
Adds a complete SearchMatrix object to this SearchMatrix

The length of both SearchMatrix must be the same, otherwise a SequenceLengthException will be thrown

Parameters:
matrix - SearchMatrix to add to this SearchMatrix
Throws:
jspp.SequenceLengthException

removeSequence

public void removeSequence(java.lang.String sequence)
                    throws jspp.SequenceLengthException
Removes a sequence from the SearchMatrix

The sequence length must be the same as the initial weight matrix size, otherwise a SequenceLengthException will be thrown

Parameters:
sequence - Sequence to remove from the SearchMatrix
Throws:
jspp.SequenceLengthException

getCleavagePosition

public int getCleavagePosition()
Returns the cleavage position.

Returns:
the cleavage position.

setLimits

public void setLimits(double cutoff,
                      double uppercutoff)
Sets the limits for score normalization.

Scores are normalized in a linear manner, where cutoff is normalized to 0.5 and uppercuttoff is normalized to 1.0.

Parameters:
cutoff - cutoff-score will be normalized to 0.5.
uppercutoff - upper-limit will be normalized to 1.0.

getScore

public double getScore(java.lang.String sequence)
                throws jspp.SequenceLengthException
Returns the normalized score.

Method setLimits() should be called before.

Parameters:
sequence - sequence for score calculation
Returns:
a normalized score for sequence
Throws:
jspp.SequenceLengthException

getRawScore

public double getRawScore(java.lang.String sequence)
                   throws jspp.SequenceLengthException
Returns the raw score

Parameters:
sequence - sequence for score calculation
Returns:
the raw score
Throws:
jspp.SequenceLengthException

getCutOffScore

public double getCutOffScore()
Returns the cutoff score

Returns:
the cutoff score

raw2normalizedScore

public double raw2normalizedScore(double rawscore)
Transfers a raw score to a normalized score

Parameters:
rawscore - the raw score
Returns:
the normalized score

getInformation

public double getInformation(int position)
                      throws jspp.SequenceLengthException
Returns the information contents of the specified position

Parameters:
position - the weight matrix position
Returns:
the information content of specified weight matrix position
Throws:
jspp.SequenceLengthException

getMatrix

public int[][] getMatrix()
Returns the alignment matrix

Returns:
the alignment matrix

setFrequencyMatrix

public void setFrequencyMatrix(java.lang.String[] sequences)
Method for considering the amino acid background

Parameters:
sequences - array of Strings containing sequences of dependent organism / group

setFrequencyMatrix

public void setFrequencyMatrix(SearchMatrix sequences)
Method for considering the amino acid background

Parameters:
sequences - sequences stored in a SearchMatrix object

writeMatrix

public void writeMatrix(java.io.File file)
                 throws java.io.IOException
Writes the content of this object as tabulator seperated values in a file

Parameters:
file - the output file
Throws:
java.io.IOException