MappingQuality() calculates the trustworthiness and continuity of mapped distances (Venna and Kaski 2001; Kaski et al. 2003) . Trustworthiness measures, on a scale from 0--1, the degree to which points that are nearby in a mapping are truly close neighbours; continuity, the extent to which points that are truly nearby retain their close spatial proximity in a mapping.

MappingQuality(original, mapped, neighbours = 10L)

ProjectionQuality(original, mapped, neighbours = 10L)


original, mapped

Square matrix or dist object containing original / mapped pairwise distances.


Number of nearest neighbours to use in calculation.


MappingQuality() returns a named vector of length four, containing the entries: Trustworthiness, Continuity, TxC(the product of these values), and sqrtTxC (its square root).


Kaski S, Nikkila J, Oja M, Venna J, Toronen P, Castren E (2003). “Trustworthiness and metrics in visualizing similarity of gene expression.” BMC Bioinformatics, 4, 48. doi: 10.1186/1471-2105-4-48 .

Venna J, Kaski S (2001). “Neighborhood preservation in nonlinear projection methods: an experimental study.” In Dorffner G, Bischof H, Hornik K (eds.), Artificial Neural Networks --- ICANN 2001, Lecture Notes in Computer Science, 485--491. doi: 10.1007/3-540-44668-0_68 .

See also

Other tree space functions: MapTrees(), SpectralEigens(), median.multiPhylo()


Wrapper for functions from Charlotte Soneson's dreval,


library('TreeTools', quietly = TRUE, warn.conflict = FALSE)
trees <- as.phylo(0:10, nTip = 8)
distances <- ClusteringInfoDistance(trees)
mapping <- cmdscale(distances)
MappingQuality(distances, dist(mapping), 4)
#> Trustworthiness      Continuity             TxC         sqrtTxC 
#>       0.8080808       0.9040404       0.7305377       0.8547150