# Random matrix with embedded bicluster
test <- matrix(rnorm(5000),100,50)
test[11:20,11:20] <- rnorm(100,10,0.1)
image(test)
shuffled_test <- test[sample(nrow(test)), sample(ncol(test))]
image(shuffled_test)
# Without specifying the number of row and column clusters
res1 <- spectral(shuffled_test,normalization="log", numberOfEigenvalues=6,
minr=2, minc=2, withinVar=1, n_clusters = NULL, n_best = 3)
res1
image(shuffled_test[order(res1@info$row_labels), order(res1@info$column_labels)])
# Specifying the number of row and column clusters
res2 <- spectral(shuffled_test,normalization="log", numberOfEigenvalues=6,
minr=2, minc=2, withinVar=1, n_clusters = 2, n_best = 3)
res2
image(shuffled_test[order(res2@info$row_labels), order(res2@info$column_labels)])
Run the code above in your browser using DataLab