Example #1
0
def getMaxSimilarityForNJ(d, seq):
    Q = {}
    n = len(seq)
    for (i, j) in d:
        sumI = 0
        sumJ = 0
        for k in seq:
            if i != k:
                sumI += d[i, k]
            if j != k:
                sumJ += d[j, k]
        Q[i, j] = (n - 2) * d[i, j] - sumI - sumJ
    maxSimilarity = Clustering.getMax(Q)
    return maxSimilarity
Example #2
0
def getMaxSimilarityForUPGMA(d):
    maxSimilarity = Clustering.getMax(d)
    return maxSimilarity