flatVSflat
carries out the comparison and visualisation of two flat
clusterings. The nodes in each partitioning are represented as nodes in the
two layers of a bi-graph. The sizes of the intersection between clusters
are reflected in the edge thickness. The number of edge crossings is
minimised heuristically using the barycentre algorithm alternatively on
each side.flatVSflat(weights, coord1 = NULL, coord2 = NULL, max.iter = 24, h.min = 0.1, plotting = TRUE, horiz = FALSE, offset = 0.1, line.wd = 3, point.sz = 2, evenly = FALSE, main = "", xlab = "", ylab = "", col = NULL, ...)
plot
.plot
.plot
.plot
.h.min
apart, the coordinates of the second and all the
following ones are shifted.
Additionally, to improve the results of the algorithm the following
strategy is also used after running the barycentre algorithm on each side:
consecutive nodes are swapped if this transposition leads to a reduction in
the number of edge crossings.
The algorithm runs until there is no improvement in the number of crossings
or until the maximum number of iterations is reached.
The rownames and colnames of matrix weights
contain the cluster
labels.
The ordering in the layout is over-imposed by the coordinate values,
therefore, the names (in the coordinates) and row-/col-names (in the
contingency table) should coincide.
Gansner, E.R. et al. (1993). A technique for drawing directed graphs. IEEE Trans. on Software Engineering, 19 (3), 214-230.
Garey, M.R. et al. (1983). Crossing number in NP complete. SIAM J. Algebraic Discrete Methods, 4, 312-316.
Torrente, A. et al. (2005). A new algorithm for comparing and visualizing relationships between hierarchical and flat gene expression data clusterings. Bioinformatics, 21 (21), 3993-3999.
# simulated data
clustering1 <- c(rep(1, 5), rep(2, 10), rep(3, 10))
clustering2 <- c(rep(1:4, 5), rep(1, 5))
weights <- table(clustering1, clustering2)
flatVSflat(table(clustering1, clustering2))
Run the code above in your browser using DataLab