fheatmap: Approximate a facile heatmap function

View source: R/fheatmap.R

fheatmapR Documentation

Approximate a facile heatmap function

Description

This just wraps the sparrow::mgheatmap2() function, but can accept a facile_frame

Usage

fheatmap(
  x,
  features = NULL,
  assay_name = NULL,
  gdb = NULL,
  rename_rows = NULL,
  ...,
  colors = NULL
)

Arguments

colors

a list of named color vectors. Names should correspond to columns in row or column annotation dataframes(?)

Details

TODO: support batch correction over data retrieved from x

Examples

# the seed matters, because some samples don't have all assay data
set.seed(0xBEEF)
set.seed(0xBEE)
afds <- FacileData::an_fds()
asamples <- FacileData::samples(afds) |> 
  FacileData::with_sample_covariates() |> 
  dplyr::filter(cell_abbrev %in% c("IMM", "PT")) |> 
  dplyr::sample_n(10)

genes <- dplyr::tibble(
    name = c(
      "AOX1",   "DPEP1",  "CDH6", "NAT8",     # PT
      "S100A8", "JCHAIN", "CCL4", "FCER1G"),  # IMM
    class = rep(c("PT", "IMM"), each = 4)) |> 
  dplyr::inner_join(FacileData::features(afds), by = "name")
fheatmap(
  asamples,
  genes,
  bottom_annotation = c("cell_abbrev", "condition"),
  ba_annotation_name_gp = grid::gpar(fontsize = 16),
  colors = list(cell_abbrev = c(IMM = "firebrick", PT = "navy")),
  column_split = asamples$cell_abbrev
  )

facilebio/FacileIncubator documentation built on April 17, 2025, 10:58 a.m.