phy_heatmap: Heatmap of microbiota features, NOT EXPORTED, because I...

View source: R/phy_heatmap.R

phy_heatmapR Documentation

Heatmap of microbiota features, NOT EXPORTED, because I haven't tested it yet!!

Description

Make a quick heatmap of selected features, also transforming internally

Usage

phy_heatmap(
  physeq,
  variable,
  physeq_transformation = "identity",
  taxa = "all",
  aggregation_samples = "median",
  taxa_into_rows = TRUE,
  scale = "row",
  add_sample_size = TRUE,
  angle_col = "90",
  legend = FALSE,
  treeheight_row = 20,
  treeheight_col = 20,
  legend_labels = NULL
)

Arguments

physeq

A phyloseq object

variable

The variable to consider for clustering

physeq_transformation

The transformation you want to apply to your data. Default is identity, which is no transformation

taxa

A facultative list of taxa to subset the phyloseq by. Default is all

aggregation_samples

If you want to perform variable-wise aggregation. the allowed aggregation methods here are mean, median, none. NB: none doesn't work yet

taxa_into_rows

A logical. It asks whether you want taxa as rows or columns of the heatmap. make sure you do the scaling right, then, in the next parameter

scale

The scale option in pheatmap, either scale by row or column. default is "row", as also taxa_into_rows default is TRUE

add_sample_size

A logical. It asks whether you want to add the per-category sample size in your variable's labels

angle_col

A numeric/character value of the degrees of tilting of labels. Justification is taken care of automatically

legend

A logical. It asks whether you want to draw the legend or not

treeheight_row

A numeric value for drawing the height of the row-wise tree clustering

treeheight_col

A numeric value for drawing the height of the column-wise tree clustering

legend_labels

A character vector of length 3 that describes the 3 labels to print on the legend. These labels will be printed as bottom, middle, top

Value

A pheatmap plot object. you can convert it into a ggplot2 object (to some extent) with pheatmap_ggplot <- ggplotify::as.ggplot(returned_pheatmap_object)[[2]]

Examples

data(enterotype)

phy_heatmap(physeq = enterotype,
            variable = "SeqTech",
            aggregation_samples = "median",
            taxa_into_rows = TRUE,
            scale = "row",
            add_sample_size = TRUE,
            angle_col = 45,
            legend = FALSE)


g-antonello/gautils2 documentation built on Nov. 28, 2022, 9:39 a.m.