WGCNA_sampleClusterDetectOutlier: Sample cluster and outlier detection

View source: R/WGCNA.R

WGCNA_sampleClusterDetectOutlierR Documentation

Sample cluster and outlier detection

Description

Sample cluster and outlier detection

Usage

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


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/ImageGP documentation built on April 14, 2025, 12:54 p.m.