WGCNA_sampleClusterDetectOutlier: Sample cluster and outlier detection

Description Usage Arguments Value Examples

View source: R/WGCNA.R

Description

Sample cluster and outlier detection

Usage

1
2
3
4
5
6
7
8
WGCNA_sampleClusterDetectOutlier(
  wgcnaL,
  thresholdZ.k = -2.5,
  saveplot = NULL,
  removeOutlier = F,
  traitColors = NULL,
  ...
)

Arguments

wgcnaL

A matrix or an object return by WGCNA_readindata. A transformed gene expression matrix normally output by WGCNA_dataFilter. Samples x Genes.

thresholdZ.k

Threshold for defining outliers. First compute the overall corelation of one sample to other samples. Then do Z-score transfer for all correlation values. The samples with corelation values less than given value would be treated as outliers. Default -2.5 meaning -2.5 std.

saveplot

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

removeOutlier

Remove outlier samples. Normally this should be only performed if no suitable soft power can be found.

traitColors

Sample attributes data frame transferred by numbers2colors or generated in WGCNA_readindata.

...

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

Value

A data frame.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
df = generateAbundanceDF(nSample=30, nGrp=3)
datExpr <- WGCNA_dataFilter(df)
datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr)


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)

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