dendrogram from precomputed distance matrix
Show older comments
I have looked around for an answer for this by have not been able to find one so I have come here. I have a precomputed distance matrix from an all vs all comparison of the root mean squared deviation (RMSD) of different protein structures.
0 0.5770 0.4910 1.6840 0.6660 0.8970 1.0920 0.5380 0.6390 0.8100
0.5770 0 0.6540 2.2020 0.2370 0.8790 0.9440 0.6120 0.4030 1.2530
0.4910 0.6540 0 1.7360 0.6300 0.7520 1.4530 0.3460 0.4630 1.1190
1.6840 2.2020 1.7360 0 2.2740 2.0790 2.5400 1.8480 2.1110 1.3380
0.6660 0.2370 0.6300 2.2740 0 0.8560 1.0880 0.5900 0.3360 1.3490
0.8970 0.8790 0.7520 2.0790 0.8560 0 1.4620 0.6840 0.7260 1.4480
1.0920 0.9440 1.4530 2.5400 1.0880 1.4620 0 1.3330 1.2400 1.3950
0.5380 0.6120 0.3460 1.8480 0.5900 0.6840 1.3330 0 0.3260 1.0900
0.6390 0.4030 0.4630 2.1110 0.3360 0.7260 1.2400 0.3260 0 1.2800
0.8100 1.2530 1.1190 1.3380 1.3490 1.4480 1.3950 1.0900 1.2800 0
I want to draw a dendrogram from this matrix:
tree=linkage(matrix,'average')
dengrogram(tree,0)
but if I do this the y-axis distance is all wrong because it's calculating the euclidean distances in the linkage. Is there a way to draw dendrograms directly from a precomputed distance matrix?
Answers (2)
1 Comment
Note that a much simpler and faster way to obtain the same result would be:
v = A(tril(true(size(A)), -1))';
crow white
on 23 Sep 2017
0 votes
I would like to do the same: I have a precomputed distance matrix (calculated on data using the bray-curtis index) and I want to draw a dendogram of the results. I don't see how your solution draws the dendrogram. Thanks for your help
1 Comment
KA
on 23 Sep 2017
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!