statalign.distance
Class Distance

java.lang.Object
  extended by statalign.distance.Distance

public class Distance
extends java.lang.Object

A class that calculates the distance and similarity score between two alignments

Author:
Ingolfur

Constructor Summary
Distance()
           
 
Method Summary
static double AMA(java.util.ArrayList<java.lang.String> A, java.util.ArrayList<java.lang.String> B)
          Does the same as the distance(ArrayList, ArrayList) but outputs a more meaningful number since it is between 0 and 1. 1 means we have the same alignments while 0 means they are as distance as possible.
static double AMA(java.lang.String[] A, java.lang.String[] B)
          The same as AMA(ArrayList, ArrayList) but here you can use arrays instead of lists
static double amaScoreToDistance(java.util.ArrayList<java.lang.String> sequences, double amaScore)
          Given a set of sequences and an AMA score, returns the corresponding distance.
static int distance(java.util.ArrayList<java.lang.String> A, java.util.ArrayList<java.lang.String> B)
          Calculates the distance between two alignments, if the function returns 0, the alignments are the same.
static int distance(java.lang.String[] A, java.lang.String[] B)
          So we can use Strings instead of list
static double sequenceSimilarityScore(java.util.List<java.lang.String> A)
          Calculates the similarity of the sequences.
static double sequenceSimilarityScore(java.lang.String[] A)
          Overloading the sequenceSimilarityScore method so one can use arrays instead of lists
static java.util.ArrayList<java.lang.Double> spaceAMA(java.util.ArrayList<java.lang.String[]> allAlignments)
          Used when determining the step rate in the automation of the MCMC.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Distance

public Distance()
Method Detail

amaScoreToDistance

public static double amaScoreToDistance(java.util.ArrayList<java.lang.String> sequences,
                                        double amaScore)
Given a set of sequences and an AMA score, returns the corresponding distance.

Parameters:
sequences - sequences (possibly having gaps)
amaScore - similarity score between 0 and 1
Returns:
the distance between the alignments

distance

public static int distance(java.lang.String[] A,
                           java.lang.String[] B)
So we can use Strings instead of list

See Also:
distance(ArrayList, ArrayList)

distance

public static int distance(java.util.ArrayList<java.lang.String> A,
                           java.util.ArrayList<java.lang.String> B)
Calculates the distance between two alignments, if the function returns 0, the alignments are the same. Higher number means the alignments are more distant.

Parameters:
A - The first alignment
B - The second alignment
Returns:
Integer between 0 and infinity

AMA

public static double AMA(java.lang.String[] A,
                         java.lang.String[] B)
The same as AMA(ArrayList, ArrayList) but here you can use arrays instead of lists


AMA

public static double AMA(java.util.ArrayList<java.lang.String> A,
                         java.util.ArrayList<java.lang.String> B)
Does the same as the distance(ArrayList, ArrayList) but outputs a more meaningful number since it is between 0 and 1. 1 means we have the same alignments while 0 means they are as distance as possible.

Parameters:
A - The first alignment
B - The second alignment
Returns:
Number between 0 and 1

sequenceSimilarityScore

public static double sequenceSimilarityScore(java.lang.String[] A)
Overloading the sequenceSimilarityScore method so one can use arrays instead of lists


sequenceSimilarityScore

public static double sequenceSimilarityScore(java.util.List<java.lang.String> A)
Calculates the similarity of the sequences.

Parameters:
A - List of strings where each string is a sequence ()
Returns:
A double between 0 and 1, 1 means all sequences are the same. 0 they are as different as possible

spaceAMA

public static java.util.ArrayList<java.lang.Double> spaceAMA(java.util.ArrayList<java.lang.String[]> allAlignments)
Used when determining the step rate in the automation of the MCMC. Gives you a much better idea how the MCMC progress behaves that is, how the space looks like on average.

Parameters:
allAlignments - List of alignments
Returns:
A list of average similarity between all possible pairs of alignments