pal.distance
Class PairwiseDistance

java.lang.Object
  extended by pal.distance.PairwiseDistance
All Implemented Interfaces:
java.io.Serializable

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

determines the (observed and ML) distance between a pair of sequences

Version:
$Id: PairwiseDistance.java,v 1.10 2002/09/08 03:47:01 matt Exp $
Author:
Korbinian Strimmer
See Also:
Serialized Form

Field Summary
 double distance
          last estimated distance
 double distanceSE
          last estimate standard error of a distance
 
Constructor Summary
PairwiseDistance(SitePattern sp)
          Constructor 1 (estimate observed distances only)
PairwiseDistance(SitePattern sp, SubstitutionModel m)
          Constructor 2 (uses evolutionary model)
 
Method Summary
 double getDistance(byte[] s1, byte[] s2)
          compute distance between two sequences (not necessarly in the given alignment but with the same weights in the site pattern)
 double getDistance(int s1, int s2)
          compute distance between two sequences in the given alignment
 void updateModel(SubstitutionModel m)
          update model of substitution
 void updateSitePattern(SitePattern sp)
          update site pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distance

public double distance
last estimated distance


distanceSE

public double distanceSE
last estimate standard error of a distance

Constructor Detail

PairwiseDistance

public PairwiseDistance(SitePattern sp)
Constructor 1 (estimate observed distances only)

Parameters:
sp - site pattern

PairwiseDistance

public PairwiseDistance(SitePattern sp,
                        SubstitutionModel m)
Constructor 2 (uses evolutionary model)

Parameters:
sp - site pattern
m - evolutionary model
Method Detail

updateModel

public void updateModel(SubstitutionModel m)
update model of substitution

Parameters:
model - of substitution

updateSitePattern

public void updateSitePattern(SitePattern sp)
update site pattern

Parameters:
site - pattern

getDistance

public double getDistance(int s1,
                          int s2)
compute distance between two sequences in the given alignment

Parameters:
s1 - number of first sequence
s2 - number of second sequence
Returns:
estimated distance (observed or ML, depending on constructor used)

getDistance

public double getDistance(byte[] s1,
                          byte[] s2)
compute distance between two sequences (not necessarly in the given alignment but with the same weights in the site pattern)

Parameters:
s1 - site pattern of first sequence
s2 - site pattern of second sequence
Returns:
estimated distance (observed or ML, depending on constructor used)