plot_heatmap_generic {proBatch} | R Documentation

## Plot the heatmap

### Description

Plot the heatmap

### Usage

    plot_heatmap_generic(
      data_matrix,
      column_annotation_df = NULL,
      row_annotation_df = NULL,
      col_ann_id_col = "FullRunName",
      row_ann_id_col = "peptide_group_label",
      columns_for_cols = c("MS_batch", "Diet", "DateTime", "order"),
      columns_for_rows = c("KEGG_pathway", "WGCNA_module", "evolutionary_distance"),
      cluster_rows = FALSE,
      cluster_cols = TRUE,
      annotation_color_cols = NULL,
      annotation_color_rows = NULL,
      fill_the_missing = -1,
      color_for_missing = "black",
      heatmap_color = colorRampPalette(rev(brewer.pal(n = 7, name = "RdYlBu")))(100),
      filename = NULL,
      width = 7,
      height = 7,
      units = c("cm", "in", "mm"),
      plot_title = NULL,
      ...
    )

### Arguments

`data_matrix` | the matrix of data to be plotted
`column_annotation_df` | data frame annotating columns of `data_matrix`
`row_annotation_df` | data frame annotating rows of `data_matrix`
`col_ann_id_col` | column of `column_annotation_df` whose values are unique identifiers of columns in `data_matrix`
`row_ann_id_col` | column of `row_annotation_df` whose values are unique identifiers of rows in `data_matrix`
`columns_for_cols` | vector of factors (columns) of `column_annotation_df` that will be mapped to color annotation of heatmap columns
`columns_for_rows` | vector of factors (columns) of `row_annotation_df` that will be mapped to color annotation of heatmap rows
`cluster_rows` | boolean: whether the rows should be clustered
`cluster_cols` | boolean: whether the rows should be clustered
`annotation_color_cols` | list of color vectors for column annotation, for each factor to be plotted; for factor-like variables a named vector (names should correspond to the levels of factors). Advisable to supply here color list returned by `sample_annotation_to_colors`
`annotation_color_rows` | list of color vectors for row annotation, for each factor to be plotted; for factor-like variables a named vector (names should correspond to the levels of factors). Advisable to supply here color list returned by `sample_annotation_to_colors`
`fill_the_missing` | numeric value that the missing values are substituted with, or `NULL` if features with missing values are to be excluded.
`color_for_missing` | special color to make missing values. Usually black or white, depending on `heatmap_color`
`heatmap_color` | vector of colors used in heatmap (typicall a gradient)
`filename` | path where the results are saved. If null the object is returned to the active window; otherwise, the object is save into the file. Currently only pdf and png format is supported
`width` | option determining the output image width
`height` | option determining the output image width
`units` | units: 'cm', 'in' or 'mm'
`plot_title` | title of the plot (e.g., processing step + representation level (fragments, transitions, proteins) + purpose (meanplot/corrplot etc))
`...` | other parameters of `link[pheatmap]{pheatmap}`

### Value

pheatmap-type object

### Examples

    p <- plot_heatmap_generic(log_transform_dm(example_proteome_matrix),
    column_annotation_df = example_sample_annotation,
    columns_for_cols = c("MS_batch",  "digestion_batch", "Diet", 'DateTime'),
    plot_title = 'test_heatmap',
    show_rownames = FALSE, show_colnames = FALSE)

[Package proBatch version 1.11.0 Index]