plotHeat | R Documentation |
Plotting a heatmap using pheatmap
plotHeat(
d,
color = "BluWhRd",
scale = "row",
genes = NULL,
n = 50,
alpha = 1,
begin = 0,
end = 1,
option = "D",
direction = 1,
show_colnames = TRUE,
show_rownames = TRUE,
cluster_rows = TRUE,
cluster_cols = TRUE,
drop_levels = TRUE,
fontsize = 9,
legend = TRUE,
border_color = NA,
repel_degree = 0,
...
)
color |
Default has "BluWhRd", "RdWhBlu", "viridis" or a string of the colours you want. e.g. c("blue","yellow","orange"). |
scale |
Default is "row". Other options include "column" or "none". see ?pheatmap. |
genes |
if provided, will highlight the vector provided in the rows |
n |
see ?viridis |
alpha |
see?viridis |
begin |
see ?viridis |
end |
see ?viridis |
option |
see ?viridis |
direction |
see ?viridis |
show_colnames |
TRUE/FALSE. see ?pheatmap. |
show_rownames |
TRUE/FALSE. see ?pheatmap. |
cluster_rows |
TRUE/FALSE. see ?pheatmap. |
cluster_cols |
TRUE/FALSE. see ?pheatmap. |
drop_levels |
TRUE/FALSE. see ?pheatmap. |
fontsize |
Default is 9. see ?pheatmap. |
legend |
TRUE/FALSE. see ?pheatmap. |
border_color |
see ?pheatmap. |
repel_degree |
amount of repel for flag. Only used if genes is specified |
... |
Passes on arguments to pheatmap. |
data |
A data frame containing values of interest. Genes in rows, samples across columns. if supplied as a matrix with rownames as genes and the 1st column is exprs values, it will still go through. |
A wrapper for pheatmap.
data(iris)
head(iris)
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#1 5.1 3.5 1.4 0.2 setosa
#2 4.9 3.0 1.4 0.2 setosa
#3 4.7 3.2 1.3 0.2 setosa
#4 4.6 3.1 1.5 0.2 setosa
#5 5.0 3.6 1.4 0.2 setosa
#6 5.4 3.9 1.7 0.4 setosa
df <- iris[,c(1:4)]
plotHeat(df)
# using example from pheatmap
# Create test matrix
test = matrix(rnorm(200), 20, 10)
test[1:10, seq(1, 10, 2)] = test[1:10, seq(1, 10, 2)] + 3
test[11:20, seq(2, 10, 2)] = test[11:20, seq(2, 10, 2)] + 2
test[15:20, seq(2, 10, 2)] = test[15:20, seq(2, 10, 2)] + 4
colnames(test) = paste("Test", 1:10, sep = "")
rownames(test) = paste("Gene", 1:20, sep = "")
# Generate annotations for rows and columns
annotation_col = data.frame(
CellType = factor(rep(c("CT1", "CT2"), 5)),
Time = 1:5
)
rownames(annotation_col) = paste("Test", 1:10, sep = "")
annotation_row = data.frame(
GeneClass = factor(rep(c("Path1", "Path2", "Path3"), c(10, 4, 6)))
)
rownames(annotation_row) = paste("Gene", 1:20, sep = "")
#plot!
plotHeat(test, annotation_col=annotation_col, annotation_row=annotation_row)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.