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))
}

Try the biclustermd package in your browser

Any scripts or data that you put into this service are public.

biclustermd documentation built on June 17, 2021, 5:11 p.m.