R/hplot.R

#' Heat maps for markers
#'
#' This function takes the object from emb() and plots a heat map
#'   for each marker
#'
#' @param input An object from emb().
#' @param cols Column indeces.
#' @return Heat map for each marker.
#' @import tibble ggplot2 magrittr dplyr tidyr
#' @export hplot

hplot <- function(input, cols = c(1:20)) {
  hihi_gg_transform <- input %>% gather(key ="markers", values = cols)
  hihi_gg_transform %>%
    ggplot(aes(x = EmbedSOM1, y = EmbedSOM2, col=value)) +
    geom_point(size =0.2) +
    scale_color_distiller(palette = "Spectral") +
    coord_fixed() +
    facet_wrap(~markers, nrow = 5) +
    theme_minimal() +
    theme(axis.text = element_blank(),
          panel.background = element_rect(color = "black", fill = NA))
}
AbhivKoladiya/CytoDataViz documentation built on June 23, 2019, 3:31 a.m.