threshLGF: Threshing and Reaping the 'BinaryMatrix'

View source: R/03-thresh.R

threshLGFR Documentation

Threshing and Reaping the BinaryMatrix

Description

The threshLGF function produces an object of class ThreshedBinaryMatrix from threshing on an object of class BinaryMatrix.

The function threshLGF and the ThreshedBinaryMatrix object can be used to access the functionality of the Thresher R-package within Mercator.

Usage

threshLGF(object, cutoff = 0)

Arguments

object

An object of class BinaryMatrix

cutoff

The value of delta set to demarcate an uninformative feature. Features with a value greater than the cutoff will be kept.

Details

The Thresher R-package provides a variety of functionalities for data filtering and the identification of and reduction to "informative" features. It performs clustering using a combination of outlier detection, principal component analysis, and von Mises Fisher mixture models. By identifying significant features, Thresher performs feature reduction through the identification and removal of noninformative features and the nonbiased calculation of the number of groups (K) for down-stream use.

Value

threshLGF returns an object of class ThreshedBinaryMatrix. The ThreshedBinaryMatrix object retains all the functionality, slots, and methods of the BinaryMatrix object class with added features. After threshing, the ThreshedBinaryMatrix records the history, "Threshed."

Additional Slots

thresher:

Returns the functions of the Thresher object class of the Thresher R-package.

reaper:

Returns the functions of the Reaper object class of the Thresher R-package.

Note

The Thresher R-package applies the Auer-Gervini statistic for principal component analysis, outlier detection, and identification of uninformative features on a matrix of class integer or numeric.

An initial delta of 0.3 is recommended.

Author(s)

Kevin R. Coombes <krc@silicovore.com>, Caitlin E. Coombes

References

Wang, M., Abrams, Z. B., Kornblau, S. M., & Coombes, K. R. (2018). Thresher: determining the number of clusters while removing outliers. BMC bioinformatics, 19(1), 9.

See Also

The threshLGF function creates a new object of class ThreshedBinaryMatrix from an object of class BinaryMatrix.

Examples

#Create a BinaryMatrix
set.seed(52134)
my.matrix <- matrix(rbinom(50*100, 1, 0.15), ncol=50)
my.rows <- as.data.frame(paste("R", 1:100, sep=""))
my.cols <- as.data.frame(paste("C", 1:50, sep=""))
my.binmat <- BinaryMatrix(my.matrix, my.cols, my.rows)
summary(my.binmat)

#Identify delta cutoff and thresh
my.binmat <- threshLGF(my.binmat)
Delta <- my.binmat@thresher@delta
sort(Delta)
hist(Delta, breaks=15, main="", xlab="Weight")
abline(v=0.3, col='red')
my.binmat <- threshLGF(my.binmat, cutoff = 0.3)
summary(my.binmat)

#Principal Component Analysis
my.binmat@reaper@pcdim
my.binmat@reaper@nGroups
plot(my.binmat@reaper@ag)
abline(h=1, col="red")
screeplot(my.binmat@reaper)
abline(v=6, col="forestgreen", lwd=2)

Mercator documentation built on April 27, 2024, 3:01 a.m.