## Generate data and annotation
n <- 50; m <- 3000
ddata <- matrix(rnorm(n * m), ncol = m)
ddata[1:20, ] <- ddata[1:20, ] + 0.2
row.names(ddata) <- c(paste0("A", 1:20), paste0("B", 1:30))
ddist <- dist(ddata)
annotation <- data.frame(row.names = rownames(ddata), clust = substr(rownames(ddata), 1, 1))
annotation.colorCode <- c("red", "blue")
names(annotation.colorCode) <- c("A", "B")
####### run in sequential mode
####### sampling the samples ....
(aConsensus <- yaConsensus(ddist))
plot(aConsensus, G = 2)
ans <- plot(aConsensus, G = 2,
annotation = annotation,
annotation.colorCode = annotation.colorCode)
summary(ans)
summary(ans, given = "clust")
####### sampling the features ....
(aConsensus <- yaConsensus(ddata, runs= 20, epsilon = 0.2, is_by_sample = FALSE))
ans <- plot(aConsensus, G = 2,
annotation = annotation,
annotation.colorCode = annotation.colorCode,
matching_clustering = "clust")
summary(ans, given = "clust")
####### run in parallel mode
## uncomment to run
# require(doParallel)
# cpu_cluster <- makeCluster(3)
# registerDoParallel(cpu_cluster)
# (aConsensus <- yaConsensus(ddist))
# plot(aConsensus, G = 2)
#stopCluster(cpu_cluster)
Run the code above in your browser using DataLab