SIGRS
Class SIGRSScoreObject

java.lang.Object
  extended by SIGRS.SIGRSScoreObject

public class SIGRSScoreObject
extends java.lang.Object

SIGRS is a collection of routines used in searching for regions of contrasting composition (CCRs) in sequence files using a partial sum process. Significance of segments is evaluated using Karlin-Altschul statistics and specifically an extension by Karlin-Dembo allowing for nucleotides to have a Markov-dependence (see e.g. Karlin & Altschul (1993) and Karlin & Dembo (1992)

The routines are provided as is and no guarantee regarding stability etc. is given so use at your own risk!

See publication Larsson, P., Hinas, A., Ardell, D.H., Kirsebom, L.A., Virtanen, A. and Söderbom, F. De novo search for non-coding RNA genes in the AT-rich genome of Dictyostelium discoideum: performance of Markov-dependent genome feature scoring

Questions and comments can be directed to Pontus.Larsson@icm.uu.se


Constructor Summary
SIGRSScoreObject()
           
 
Method Summary
 void calculateBackgroundFrequencies(byte[][] backgroundSeqs, LogWriter lw)
           
static double[][][] calculateFrequencies(byte[][] seq)
           
static double[][][] calculateFrequencies(java.io.File seqFile)
          Calculates a set of frequencies from a set of input sequences
static double[][][] calculateFrequencies(int[][] monoCounts, int[][][] diCounts)
           
 void calculateScores(byte[][] backgroundSeqs, byte[][] targetSeqs, LogWriter lw)
          Calculates the frequencies, scores and associated parameters for the M0 and M1 model
static double[][] calculateScores(double[][] background, double[][] target)
          Calculates score matrix based on target and background frequencies according to s = C*log(tg/bg) and rounded to the closest integer Equivalent to calling calculateScores(background,target,10.,2.)
static double[][] calculateScores(double[][] background, double[][] target, double C, double base)
          Calculates score matrix based on target and background frequencies according to s = C*log(tg/bg) and rounded to the closest integer
 void calculateScores(java.io.File backgroundSeqs, java.io.File targetSeqs, LogWriter lw)
           
 void calculateScores(LogWriter lw)
           
 void calculateTargetFrequencies(byte[][] targetSeqs, LogWriter lw)
           
 double[][][] getBackgroundFrequencies()
          Returns the value of backgroundFrequencies.
 double getH0()
          Returns the value of H0.
 double getH1()
          Returns the value of H1.
 double getK0()
          Returns the value of K0.
 double getK1()
          Returns the value of K1.
 double getL0()
          Returns the value of L0.
 double getL1()
          Returns the value of L1.
 double[][] getM0ScoreMatrix()
          Returns the value of M0ScoreMatrix.
 double[][] getM1ScoreMatrix()
          Returns the value of M1ScoreMatrix.
static SIGRSScoreObject getScoreObject(java.io.File scoreFile, LogWriter lw)
           
 double[][][] getTargetFrequencies()
          Returns the value of targetFrequencies.
 void setBackgroundFrequencies(double[][][] backgroundFrequencies)
          Sets the value of backgroundFrequencies.
 void setH0(double H0)
          Sets the value of H0.
 void setH1(double H1)
          Sets the value of H1.
 void setK0(double K0)
          Sets the value of K0.
 void setK1(double K1)
          Sets the value of K1.
 void setL0(double L0)
          Sets the value of L0.
 void setL1(double L1)
          Sets the value of L1.
 void setM0ScoreMatrix(double[][] M0ScoreMatrix)
          Sets the value of M0ScoreMatrix.
 void setM1ScoreMatrix(double[][] M1ScoreMatrix)
          Sets the value of M1ScoreMatrix.
 void setTargetFrequencies(double[][][] targetFrequencies)
          Sets the value of targetFrequencies.
 java.lang.String toString()
          Returns a string with the contents of the score object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SIGRSScoreObject

public SIGRSScoreObject()
Method Detail

getM0ScoreMatrix

public double[][] getM0ScoreMatrix()
Returns the value of M0ScoreMatrix.


setM0ScoreMatrix

public void setM0ScoreMatrix(double[][] M0ScoreMatrix)
Sets the value of M0ScoreMatrix.

Parameters:
M0ScoreMatrix - The value to assign M0ScoreMatrix.

getM1ScoreMatrix

public double[][] getM1ScoreMatrix()
Returns the value of M1ScoreMatrix.


setM1ScoreMatrix

public void setM1ScoreMatrix(double[][] M1ScoreMatrix)
Sets the value of M1ScoreMatrix.

Parameters:
M1ScoreMatrix - The value to assign M1ScoreMatrix.

getBackgroundFrequencies

public double[][][] getBackgroundFrequencies()
Returns the value of backgroundFrequencies.


setBackgroundFrequencies

public void setBackgroundFrequencies(double[][][] backgroundFrequencies)
Sets the value of backgroundFrequencies.

Parameters:
backgroundFrequencies - The value to assign backgroundFrequencies.

getTargetFrequencies

public double[][][] getTargetFrequencies()
Returns the value of targetFrequencies.


setTargetFrequencies

public void setTargetFrequencies(double[][][] targetFrequencies)
Sets the value of targetFrequencies.

Parameters:
targetFrequencies - The value to assign targetFrequencies.

getK0

public double getK0()
Returns the value of K0.


setK0

public void setK0(double K0)
Sets the value of K0.

Parameters:
K0 - The value to assign K0.

getL0

public double getL0()
Returns the value of L0.


setL0

public void setL0(double L0)
Sets the value of L0.

Parameters:
L0 - The value to assign L0.

getH0

public double getH0()
Returns the value of H0.


setH0

public void setH0(double H0)
Sets the value of H0.

Parameters:
H0 - The value to assign H0.

getK1

public double getK1()
Returns the value of K1.


setK1

public void setK1(double K1)
Sets the value of K1.

Parameters:
K1 - The value to assign K1.

getL1

public double getL1()
Returns the value of L1.


setL1

public void setL1(double L1)
Sets the value of L1.

Parameters:
L1 - The value to assign L1.

getH1

public double getH1()
Returns the value of H1.


setH1

public void setH1(double H1)
Sets the value of H1.

Parameters:
H1 - The value to assign H1.

calculateScores

public void calculateScores(byte[][] backgroundSeqs,
                            byte[][] targetSeqs,
                            LogWriter lw)
                     throws java.lang.Exception
Calculates the frequencies, scores and associated parameters for the M0 and M1 model

Parameters:
backgroundSeqs - Array with encoded background sequences
targetSeqs - Array with encoded target sequences
Throws:
java.lang.Exception

calculateScores

public void calculateScores(java.io.File backgroundSeqs,
                            java.io.File targetSeqs,
                            LogWriter lw)
                     throws java.lang.Exception
Throws:
java.lang.Exception

calculateScores

public void calculateScores(LogWriter lw)

calculateBackgroundFrequencies

public void calculateBackgroundFrequencies(byte[][] backgroundSeqs,
                                           LogWriter lw)

calculateTargetFrequencies

public void calculateTargetFrequencies(byte[][] targetSeqs,
                                       LogWriter lw)

calculateFrequencies

public static double[][][] calculateFrequencies(java.io.File seqFile)
                                         throws java.lang.Exception
Calculates a set of frequencies from a set of input sequences

Parameters:
seq - An array of encoded input sequences
Returns:
An array with the different sets of frequencies: [0] -> Mononucleotide frequencies (4x1 array) [1] -> Dinucleotide frequencies (4x4 array) [2] -> Conditional dinucleotide frequencies (4x4 array)
Throws:
java.lang.Exception

calculateFrequencies

public static double[][][] calculateFrequencies(byte[][] seq)

calculateFrequencies

public static double[][][] calculateFrequencies(int[][] monoCounts,
                                                int[][][] diCounts)

calculateScores

public static double[][] calculateScores(double[][] background,
                                         double[][] target)
Calculates score matrix based on target and background frequencies according to s = C*log(tg/bg) and rounded to the closest integer Equivalent to calling calculateScores(background,target,10.,2.)

Parameters:
background - Matrix holding the frequencies of letters in the background
target - Matrix holding the frequencies of letters in the target
Returns:
A score matrix with the same dimensions as the input frequency matrices

calculateScores

public static double[][] calculateScores(double[][] background,
                                         double[][] target,
                                         double C,
                                         double base)
Calculates score matrix based on target and background frequencies according to s = C*log(tg/bg) and rounded to the closest integer

Parameters:
background - Matrix holding the frequencies of letters in the background
target - Matrix holding the frequencies of letters in the target
C - A scaling constant
base - The logarithm base
Returns:
A score matrix with the same dimensions as the input frequency matrices

getScoreObject

public static SIGRSScoreObject getScoreObject(java.io.File scoreFile,
                                              LogWriter lw)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Returns a string with the contents of the score object

Overrides:
toString in class java.lang.Object