public class DistanceMatrix extends Object implements Cloneable
DistanceMatrix matrix = msa.getDistanceMatrix(new UncorrectedModel());
String testMatrix =
" 14\n" +
"Mouse \n" +
"Bovine 1.7043\n" +
"Lemur 2.0235 1.1901\n" +
"Tarsier 2.1378 1.3287 1.2905\n" +
"Squir Monk 1.5232 1.2423 1.3199 1.7878\n" +
"Jpn Macaq 1.8261 1.2508 1.3887 1.3137 1.0642\n" +
"Rhesus Mac 1.9182 1.2536 1.4658 1.3788 1.1124 0.1022\n" +
"Crab-E.Mac 2.0039 1.3066 1.4826 1.3826 0.9832 0.2061 0.2681\n";
DistanceMatrix matrix = new DistanceMatrix(testMatrix);
String testMatrix =
"# Subunit distance matrix\n" +
"Alpha 0.000 1.000 2.000 3.000 3.000\n" +
"Beta 1.000 0.000 2.000 3.000 3.000\n" +
"Gamma 2.000 2.000 0.000 3.000 3.000\n" +
"Delta 3.000 3.000 0.000 0.000 1.000\n" +
"Epsilon 3.000 3.000 3.000 1.000 0.000\n\n";
DistanceMatrix matrix = new DistanceMatrix(testMatrix);
| Constructor and Description |
|---|
DistanceMatrix() |
DistanceMatrix(File inMatrix) |
DistanceMatrix(int inInitialSize) |
DistanceMatrix(String inMatrix) |
| Modifier and Type | Method and Description |
|---|---|
void |
addKey(String inKey) |
void |
changeKey(String inOldKey,
String inNewKey)
Changes the key name inOldKey to inNewKey.
|
DistanceMatrix |
clone() |
Float |
getDistance(String inKey1,
String inKey2) |
String |
getNearestNeighbor(String inKey) |
float |
getNetDivergence(String inKey) |
Edge<String> |
getShortestEdge()
Returns the Edge with the shortest distance.
|
List<Edge<String>> |
getSortedEdges(String inSeqId)
Returns the Edges for the specified sequence sorted shortest to longest.
|
boolean |
isConsumable() |
boolean |
isConsumed() |
Collection<String> |
keySet() |
int |
numKeys() |
void |
removeKey(String inKey) |
void |
removeKeys(Set<String> inKeys) |
void |
setDistance(String inKey1,
String inKey2,
Float inDistance) |
DistanceMatrix |
setIsConsumable(boolean inValue) |
DistanceMatrix |
setIsConsumed() |
int |
size() |
public DistanceMatrix()
public DistanceMatrix(int inInitialSize)
public DistanceMatrix(String inMatrix)
public DistanceMatrix(File inMatrix) throws IOException
IOExceptionpublic DistanceMatrix setIsConsumable(boolean inValue)
public boolean isConsumable()
public DistanceMatrix setIsConsumed()
public boolean isConsumed()
public void removeKeys(Set<String> inKeys)
public void changeKey(String inOldKey, String inNewKey)
inOldKey - the old matrix keyinNewKey - the new matrix keypublic void setDistance(String inKey1, String inKey2, Float inDistance)
public Float getDistance(String inKey1, String inKey2)
public int size()
public int numKeys()
public Collection<String> keySet()
public float getNetDivergence(String inKey)
public String getNearestNeighbor(String inKey)
public Edge<String> getShortestEdge()
public List<Edge<String>> getSortedEdges(String inSeqId)
inSeqId - the id (key) of the sequence for which Edges should be retrievedpublic DistanceMatrix clone()
jataylor@hairyfatguy.com