View source: R/Olink_heatmap.R
olink_heatmap_plot | R Documentation |
Generates a heatmap using pheatmap::pheatmap
of all samples from NPX data.
olink_heatmap_plot(
df,
variable_row_list = NULL,
variable_col_list = NULL,
center_scale = TRUE,
cluster_rows = TRUE,
cluster_cols = TRUE,
show_rownames = TRUE,
show_colnames = TRUE,
colnames = "both",
annotation_legend = TRUE,
fontsize = 10,
na_col = "black",
...
)
df |
Data frame in long format with SampleID, NPX, OlinkID, Assay and columns of choice for annotations. |
variable_row_list |
Columns in |
variable_col_list |
Columns in |
center_scale |
Logical. If data should be centered and scaled across assays (default |
cluster_rows |
Logical. Determining if rows should be clustered (default |
cluster_cols |
Logical. Determining if columns should be clustered (default |
show_rownames |
Logical. Determining if row names are shown (default |
show_colnames |
Logical. Determining if column names are shown (default |
colnames |
Character. Determines how to label the columns. Must be 'assay', 'oid', or 'both' (default 'both'). |
annotation_legend |
Logical. Determining if legend for annotations should be shown (default |
fontsize |
Fontsize (default 10) |
na_col |
Color of cells with |
... |
Additional arguments used in |
The values are by default scaled across and centered in the heatmap. Columns and rows are by default sorted by by dendrogram. Unique sample names are required.
An object of class ggplot
, generated from the gtable
returned by pheatmap::pheatmap
.
library(dplyr)
npx_data <- npx_data1 %>%
filter(!stringr::str_detect(SampleID,'CONT'))
try({ # This will fail if ggplotify is not installed
#Heatmap
olink_heatmap_plot(df=npx_data)
#Heatmap with annotation
olink_heatmap_plot(df=npx_data, variable_row_list = c('Time','Site'))
#Heatmap with calls from pheatmap
olink_heatmap_plot(df=npx_data, cutree_rows = 3)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.