WGCNA_moduleTraitPlot: Module-trait heatmap

Description Usage Arguments Value Examples

View source: R/WGCNA.R

Description

Module-trait heatmap

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
WGCNA_moduleTraitPlot(
  MEs_col,
  traitData = NULL,
  corType = "bicor",
  saveplot = NULL,
  prefix = "ehbio",
  angle_x = 90,
  up_color = c("red", "white", "blue"),
  down_color = c("green", "white"),
  ...
)

Arguments

MEs_col

Module epigenes generated in WGCNA_saveModuleAndMe.

traitData

Sample attributes data frame. Or the "traitData" generated in WGCNA_readindata.

corType

character string specifying the correlation to be used. Allowed values are (unique abbreviations of) "pearson" and "bicor", corresponding to Pearson and bidweight midcorrelation, respectively. Missing values are handled using the pairwise.complete.obs option.

saveplot

Save plot to given file "a.pdf", "b.png".

prefix

prefix for output files.

angle_x

Rotation angle for x-axis labels

up_color

Vector of colours to use for upper triangles (which representing pearson correlations values).

down_color

Vector of colours to use for lower triangles (which representing significance p-values).

...

Additional parameters given to plot output (pdf, png,...) like "width", "height", .etc.

Value

A dataframe.

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
df = generateAbundanceDF(nSample=30, nGrp=3, sd=5)
datExpr <- WGCNA_dataFilter(df)
datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr)
power <- WGCNA_softpower(datExpr)
net <- WGCNA_coexprNetwork(datExpr, power)
WGCNA_saveModuleAndMe(net, datExpr)
cyt <- WGCNA_cytoscape(net, power, datExpr)
hubgene <- WGCNA_hubgene(cyt)

#2
exprMat <- "test.file"
wgcnaL <- WGCNA_readindata(exprMat)

traitData <- 'trait.file'
wgcnaL <- WGCNA_readindata(exprMat, traitData)
datExpr <- wgcnaL$datExpr
traitData <- wgcnaL$traitData
WGCNA_dataCheck(datExpr)
datExpr <- WGCNA_dataFilter(datExpr)
datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr)
# datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors)
power <- WGCNA_softpower(datExpr)
net <- WGCNA_coexprNetwork(datExpr, power)
MEs_col <- WGCNA_saveModuleAndMe(net, datExpr)
WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=traitData)
cyt <- WGCNA_cytoscape(net, power, datExpr)
hubgene <- WGCNA_hubgene(cyt)
WGCNA_moduleTraitPlot(MEs_col, traitData=traitData)

Tong-Chen/YSX documentation built on Jan. 25, 2021, 2:49 a.m.