Package pal.distance

Class PairwiseDistance

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

public class PairwiseDistance extends Object implements 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:
  • Field Details

    • distance

      public double distance
      last estimated distance
    • distanceSE

      public double distanceSE
      last estimate standard error of a distance
  • Constructor Details

    • 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 Details

    • 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)