de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous
Class TwoPointEvaluater

java.lang.Object
  extended by de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.TwoPointEvaluater

public class TwoPointEvaluater
extends Object

This class is for visualizing two point dependency between sequence positions.

Author:
Jens Keilwagen

Constructor Summary
TwoPointEvaluater()
           
 
Method Summary
static BufferedImage getImage(DataSet d, double[] weights, REnvironment r, double alpha, int... borders)
           
static BufferedImage getImage(double[][] mi, REnvironment r)
          This method can be used to create an image of a mutual information matrix.
static double getMax(double[][] mi)
          This method can be used to determine the maximal value of the matrix of mutual informations.
static double[][] getMI(DataSet s, double[] weights)
          This method computes the pairwise mutual information between the sequence positions.
static double[][] getMIInBits(DataSet s, double[] weights)
          This method computes the pairwise mutual information (in bits) between the sequence positions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoPointEvaluater

public TwoPointEvaluater()
Method Detail

getMI

public static double[][] getMI(DataSet s,
                               double[] weights)
                        throws IllegalArgumentException
This method computes the pairwise mutual information between the sequence positions.

Parameters:
s - the DataSet
weights - the weights for each sequence of the DataSet or null
Returns:
a matrix containing all pairwise mutual informations
Throws:
IllegalArgumentException - if something went wrong (e.g. the AlphabetContainer is not discrete, the length is not matching with the AlphabetContainer, ...)

getMIInBits

public static double[][] getMIInBits(DataSet s,
                                     double[] weights)
                              throws IllegalArgumentException
This method computes the pairwise mutual information (in bits) between the sequence positions.

Parameters:
s - the DataSet
weights - the weights for each sequence of the DataSet or null
Returns:
a matrix containing all pairwise mutual informations (in bits)
Throws:
IllegalArgumentException - if something went wrong (e.g. the AlphabetContainer is not discrete, the length is not matching with the AlphabetContainer, ...)

getImage

public static BufferedImage getImage(double[][] mi,
                                     REnvironment r)
                              throws Exception
This method can be used to create an image of a mutual information matrix.

Parameters:
mi - the matrix of mutual information
r - the R environment
Returns:
an image of the matrix
Throws:
Exception - if an Exception is thrown from REnvironment
See Also:
getMIInBits(DataSet, double[])

getImage

public static BufferedImage getImage(DataSet d,
                                     double[] weights,
                                     REnvironment r,
                                     double alpha,
                                     int... borders)
                              throws Exception
Throws:
Exception

getMax

public static double getMax(double[][] mi)
This method can be used to determine the maximal value of the matrix of mutual informations.

Parameters:
mi - the matrix of mutual informations
Returns:
the maximal value