This function takes either the output of precise_dist or any other list of distance matrices, and fuses it into a consensus distance matrix for downstream clustering, visualization or other use case. Note: Run precise_transform first to coerce all matrices into distances or similarities if the data contains a herterogenous mix of matrix types.

precise_fusion(data, fusion = "distatis", verbose = TRUE)

Arguments

data

Either the output of precise_dist or a list of distance matrices.

fusion

A string of the fusion algorithm to use. Options include "distatis", "fuse" and "SNF".

verbose

TRUE or FALSE. Should the function tell you what is happening internally?

Value

A square, numeric matrix representing the fusion of the input matrices.

Details

Currently, this function offers three matrix fusion algorithms: SNF, DiSTATIS and fuse. Just as there is typically no single distance matrix which faithfully captures any patterns inherent to a dataset, there is also no single best fusion algorithm that best combines different distance matrices. Thus, if computationally feasible, it is recommended to try each algorithm in turn. As far as speed is concerned, from fastest to slowest they go fuse -> distatis -> SNF.

References

Muchmore, B., Muchmore P. and Alarcón-Riquelme ME. (2018). Optimal Distance Matrix Construction with PreciseDist and PreciseGraph.

Bo Wang, Aziz Mezlini, Feyyaz Demir, Marc Fiume, Zhuowen Tu, Michael Brudno, Benjamin Haibe-Kains and Anna Goldenberg (2018). SNFtool: Similarity Network Fusion. R package version 2.3.0. https://CRAN.R-project.org/package=SNFtool

Derek Beaton, Cherise Chin Fatt and Herve Abdi (2013). DistatisR: DiSTATIS Three Way Metric Multidimensional Scaling. R package version 1.0. https://CRAN.R-project.org/package=DistatisR

Simpson, G.L. and Oksanen, J. ( 2016 ). analogue: Analogue matching and Modern Analogue Technique transfer function models. (R package version 0.17-0 ). (http://cran.r-project.org/package=analogue).

Examples

test_matrix <- replicate(10, rnorm(100)) test_dists <- test_matrix %>% precise_dist(c("manhattan", "euclidean"))
#> [1] "Starting dists calculations at 2018-11-29 15:20:22" #> [1] "Finished dists calculations at 2018-11-29 15:20:23" #> [1] "Calculations took: 0.5 seconds" #> [1] "Starting dist_funcs calculations at 2018-11-29 15:20:23" #> [1] "Finished dist_funcs calculations at 2018-11-29 15:20:23" #> [1] "Calculations took: 0 seconds"
test_fusion <- test_dists %>% precise_fusion(fusion = "fuse", verbose = TRUE)
#> [1] "Starting distance matrix fusion using fuse at 2018-11-29 15:20:23" #> [1] "Finished distance matrix fusion at 2018-11-29 15:20:24" #> [1] "Fusion took: 0 seconds"