|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pal.distance.DistanceMatrix
storage for pairwise distance matrices.
features: - printing in in PHYLIP format, - computation of (weighted) squared distance to other distance matrix - Fills in all of array...
Field Summary | |
double[][] |
distance
distances [seq1][seq2] |
IdGroup |
idGroup
sequence identifiers |
int |
numSeqs
number of sequences. |
Constructor Summary | |
DistanceMatrix()
constructor |
|
DistanceMatrix(DistanceMatrix dm)
constructor that takes a distance matrix and clones the distances but uses the same idGroup. |
|
DistanceMatrix(DistanceMatrix dm,
IdGroup subset)
constructor that takes a distance matrix and clones the distances, of a the identifiers in idGroup. |
|
DistanceMatrix(double[][] distance,
IdGroup idGroup)
constructor taking distances array and IdGroup |
Method Summary | |
double |
absoluteDistance(DistanceMatrix mat)
compute absolute distance to second distance matrix |
void |
addDistance(int i,
int j,
double delta)
Adds a delta to both upper and lower triangle distances. |
double[][] |
getDistances()
Returns the distances as a 2-dimensional array of doubles. |
int |
getIdCount()
Returns the number of identifiers in this group |
Identifier |
getIdentifier(int i)
Returns the ith identifier. |
IdGroup |
getIdGroup()
Deprecated. distance matrix now implements IdGroup |
int |
getSize()
Returns the number of rows and columns that the distance matrix has. |
boolean |
isSymmetric()
test whether this matrix is a symmetric distance matrix |
double |
meanDistance()
Returns the mean pairwise distance of this matrix |
void |
printPHYLIP(java.io.PrintWriter out)
print alignment (PHYLIP format) |
void |
setDistance(int i,
int j,
double dist)
Sets both upper and lower triangles. |
void |
setIdentifier(int i,
Identifier ident)
Sets the ith identifier. |
double |
squaredDistance(DistanceMatrix mat,
boolean weighted)
compute squared distance to second distance matrix |
java.lang.String |
toString()
returns representation of this alignment as a string |
int |
whichIdNumber(java.lang.String name)
returns the index of the identifier with the given name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public int numSeqs
public IdGroup idGroup
public double[][] distance
Constructor Detail |
public DistanceMatrix()
public DistanceMatrix(double[][] distance, IdGroup idGroup)
public DistanceMatrix(DistanceMatrix dm)
public DistanceMatrix(DistanceMatrix dm, IdGroup subset)
Method Detail |
public void printPHYLIP(java.io.PrintWriter out)
public java.lang.String toString()
toString
in class java.lang.Object
public double squaredDistance(DistanceMatrix mat, boolean weighted)
public double absoluteDistance(DistanceMatrix mat)
public int getSize()
public double[][] getDistances()
public void setDistance(int i, int j, double dist)
public void addDistance(int i, int j, double delta)
public double meanDistance()
public Identifier getIdentifier(int i)
IdGroup
getIdentifier
in interface IdGroup
public void setIdentifier(int i, Identifier ident)
IdGroup
setIdentifier
in interface IdGroup
public int getIdCount()
IdGroup
getIdCount
in interface IdGroup
public int whichIdNumber(java.lang.String name)
IdGroup
whichIdNumber
in interface IdGroup
public IdGroup getIdGroup()
public boolean isSymmetric()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |