WGCNA_saveModuleAndMe: Save gene-module relationships, MEs and plot module...

Description Usage Arguments Examples

View source: R/WGCNA.R

Description

Save gene-module relationships, MEs and plot module correlations.

Usage

1
WGCNA_saveModuleAndMe(net, datExpr, prefix = "ehbio", saveplot = NULL, ...)

Arguments

net

WGCNA_coexprNetwork or blockwiseModules returned WGCNA object.

datExpr

Expression data. A matrix (preferred) or data frame in which columns are genes and rows ar samples. NAs are allowed, but not too many. See checkMissingData below and details.

prefix

prefix for output files.

saveplot

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

...

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
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)

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

traitData <- 'trait.file'
wgcnaL <- WGCNA_readindata(exprMat, traitData)
datExpr <- wgcnaL$datExpr
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)

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