de.jstacs.utils
Class PFMComparator.PFMDistance

java.lang.Object
  extended by de.jstacs.utils.PFMComparator.PFMDistance
Direct Known Subclasses:
PFMComparator.NormalizedEuclideanDistance, PFMComparator.OneMinusPearsonCorrelationCoefficient, PFMComparator.SymmetricKullbackLeiblerDivergence
Enclosing class:
PFMComparator

public abstract static class PFMComparator.PFMDistance
extends Object

This interface declares a method for comparing different PFMs. If the PFMs are identical the value 0 should be returned, otherwise some positive value. Ideally, each distance has to be length-normalized.

Author:
Jens Keilwagen

Constructor Summary
PFMComparator.PFMDistance()
           
 
Method Summary
 double compare(double[][] pfm1, double[][] pfm2, int minimalOverlap)
          This method compares two PFMs, pfm1 and pfm2.
 double getDistance(double[][] pfm1, double[][] pfm2, int offset)
          This method computes the distance between two PFMs.
protected abstract  double getDistance(double[][] pfm1, double[][] pfm2, int l1, int l2)
          Computes the mean distance between the overlapping parts of pfm1 and pfm2 starting at the offsets l1 and l2, respectively.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PFMComparator.PFMDistance

public PFMComparator.PFMDistance()
Method Detail

getDistance

public final double getDistance(double[][] pfm1,
                                double[][] pfm2,
                                int offset)
This method computes the distance between two PFMs. If the PFMs are identical the value 0 should be returned, otherwise some positive value.

Parameters:
pfm1 - the first PFM
pfm2 - the second PFM
offset - the offset for the alignment of the PFMs
Returns:
the distance between the PFMs

getDistance

protected abstract double getDistance(double[][] pfm1,
                                      double[][] pfm2,
                                      int l1,
                                      int l2)
Computes the mean distance between the overlapping parts of pfm1 and pfm2 starting at the offsets l1 and l2, respectively.

Parameters:
pfm1 - the first PFM
pfm2 - the second PFM
l1 - the offset for the first PFM
l2 - the offset for the second PFM
Returns:
the mean distance of the overlapping part

compare

public double compare(double[][] pfm1,
                      double[][] pfm2,
                      int minimalOverlap)
This method compares two PFMs, pfm1 and pfm2. The method tests all alignments of the PFMs with an overlap of mininmalOverlap consecutive positions.

Parameters:
pfm1 - the first PFM
pfm2 - the second PFM
minimalOverlap - the minimal number of consecutive positions in an alignment
Returns:
the distance