## WE do not run this, it takes relatively long
if (FALSE) {
data <- ppa.in.silico(noise=0.1)
ppa.result <- ppa(data[1:2], direction="up")
## Find the best bicluster for each block in the input
## (based on the rows of the first input matrix)
best <- apply(cor(ppa.result$rows1, data[[3]]), 2, which.max)
## Check correlation
sapply(seq_along(best),
function(x) cor(ppa.result$rows1[,best[x]], data[[3]][,x]))
## The same for the rows of the second matrix
sapply(seq_along(best),
function(x) cor(ppa.result$rows2[,best[x]], data[[4]][,x]))
## The same for the columns
sapply(seq_along(best),
function(x) cor(ppa.result$columns[,best[x]], data[[5]][,x]))
## Plot the data and the modules found
if (interactive()) {
layout(rbind(1:2,c(3,6),c(4,7), c(5,8)))
image(data[[1]], main="In-silico data, first matrix")
image(data[[2]], main="In-silico data, second matrix")
sapply(best[1:3], function(b) image(outer(ppa.result$rows1[,b],
ppa.result$columns[,b]),
main=paste("Module", b)))
sapply(best[1:3], function(b) image(outer(ppa.result$rows2[,b],
ppa.result$columns[,b]),
main=paste("Module", b)))
}
}
Run the code above in your browser using DataLab