Heat: Heatmap with Row Names Colored by Group

Description Usage Arguments Value Note Author(s) Examples

View source: R/statVisual.R

Description

Heatmap with row names colored by group.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
Heat(data, 
     group = NULL, 
     fontsize_row=10,
     fontsize_col=10, 
     scale = "none",
     cluster_rows = TRUE,
     cluster_cols = TRUE,
     color = colorRampPalette(rev(brewer.pal(n = 7, name ="RdYlBu")))(100),
     angle_col = c("270", "0", "45", "90", "315"), 
     ...) 

Arguments

data

A data frame. Rows are subjects; Columns are variables describing the subjects. Except the column indicating subject group, all columns of data should be numeric.

group

character. The column name of data that indicates the subject groups. The row names of the heatmap will be colored based on group.

fontsize_col

x axis label font size

fontsize_row

y axis label font size

scale

character. Indicate how data will be scaled: “none” (i.e., no scaling), “row” (i.e., row scaled), “column” (i.e., column scaled).

cluster_rows

logic. Indicates if rows should be clustered.

cluster_cols

logic. Indicates if columns should be clustered.

color

vector indicating colors used in heatmap

angle_col

angle of the column labels. Please refer to the manual in pheatmap

...

other input parameters for facet & theme.

Value

A list with 10 elements: “rowInd”, “colInd”, “call”, “carpet”, “rowDendrogram”, “colDendrogram”, “breaks”, “col”, “colorTable”, “layout”.

Note

This function is based on the function pheatmap in pheatmap R package.

Author(s)

Wenfei Zhang <Wenfei.Zhang@sanofi.com>, Weiliang Qiu <Weiliang.Qiu@sanofi.com>, Xuan Lin <Xuan.Lin@sanofi.com>, Donghui Zhang <Donghui.Zhang@sanofi.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
data(esSim)
print(esSim)

# expression data
dat = exprs(esSim)
print(dim(dat))
print(dat[1:2,])

# phenotype data
pDat = pData(esSim)
print(dim(pDat))
print(pDat[1:2,])

# feature data
fDat = fData(esSim)
print(dim(fDat))
print(fDat[1:2,])

# choose the first 6 probes (3 OE probes, 2 UE probes, and 1 NE probe)
pDat$probe1 = dat[1,]
pDat$probe2 = dat[2,]
pDat$probe3 = dat[3,]
pDat$probe4 = dat[4,]
pDat$probe5 = dat[5,]
pDat$probe6 = dat[6,]

print(pDat[1:2, ])

# check histograms of probe 1 expression in cases and controls
print(table(pDat$grp, useNA = "ifany"))

statVisual(type = 'Heat', 
           data = pDat[, c(2:8)], 
           group = 'grp')

Heat(
     data = pDat[, c(2:8)], 
     group = 'grp')

statVisual documentation built on Feb. 21, 2020, 1:08 a.m.