Ejemplo n.º 1
0
    def fstAlleleDistance(
            self, data, samples
    ):  #this could have been more efficient when we pass objects
        fst = FST()
        sampleCount = data.shape[1]

        dm = np.zeros((sampleCount, sampleCount))
        messages = dict()
        for i in range(0, sampleCount):
            for j in range(0, sampleCount):
                #extract the whole copy number profile, so the whole column
                sample1Profile = data[:, i]
                sample2Profile = data[:, j]
                returnValue = fst.computeAlleleDistance(
                    sample1Profile, sample2Profile, samples[i], samples[j])
                messages[(i, j)] = returnValue[0]

                dm[i, j] = returnValue[1]
        print "distances: "
        print dm
        return [messages, dm]