R/reorder_biclust.R

Defines functions reorder_biclust

Documented in reorder_biclust

#' Reorder a bicluster object for making a heat map
#'
#' @param x A bicluster object.
#'
#' @return A list containing the two partition matrices used by gg_bicluster.

reorder_biclust <- function(x) {
  bc <- x

  bc_p <- bc$P[, order(-colMeans(bc$A))]
  bc_q <- bc$Q[, order(rowMeans(bc$A))]

  return(list(P = bc_p, Q = bc_q))
}
jreisner/sparseBiclustering documentation built on June 22, 2021, 12:54 p.m.