SimThresher-class {Thresher} | R Documentation |
Class "SimThresher"
Description
The SimThresher
class is used to simulate Thresher
objects.
Usage
SimThresher(ss, nSample, nm = deparse(substitute(ss)), rho = NULL,
agfun = agDimTwiceMean, ...)
Arguments
ss |
A covariance matrix. |
nSample |
An integer; the number of samples to simulate. |
nm |
A character string; the name of this object. |
rho |
A numeric vector; the correlation between different variables. If NULL, then these are obtained from the covariance matrix. |
agfun |
A function used by the |
... |
Parameters to be passed to the |
Details
Basically, given a number of samples and a covariance matrix, simulate a data matrix of the appropriate size and multivariate normal structure by assuming that all of the means are zero. After simulating the data, we apply the Thresher algorithm. The result is an object that combines the simulation parameters, simulated data, and fitted model.
Value
The SimThresher
function returns an object of the
SimThresher
class.
Objects from the Class
Objects should be created using the SimThresher
constructor.
Slots
nSample
:An integer; the number of simulated samples.
covariance
:A covariance matrix.
rho
:A vector of correlation coefficients; essentially the unique values in the upper triangular part of the covariance matrix.
Extends
Class Thresher
, directly.
Methods
- image
signature(x = "SimThresher")
: Produces an image of the covariance matrix.- makeFigures
signature(object = "SimThresher")
: This is a convenience function to produce a standard set of figures. In addition tot he plots preodcued forThresher
object, this function also produces an image of te covariance matrix used in the simulations. If theDIR
argument is non-null, it is treated as the name of an existing directory where the figures are stored as PNG files. Otherwise, the figures are displayed interactively, one at a time, in a window on screen.
Author(s)
Kevin R. Coombes <krc@silicovore.com>, Min Wang.
References
Wang M, Abrams ZB, Kornblau SM, Coombes KR. Thresher: determining the number of clusters while removing outliers. BMC Bioinformatics, 2018; 19(1):1-9. doi://10.1186/s12859-017-1998-9.
See Also
Examples
set.seed(250264)
rho <- 0.5
nProtein <- 16
splinter <- sample((nProtein/2) + (-3:3), 1)
sigma1 <- matrix(rho, ncol=nProtein, nrow=nProtein)
diag(sigma1) <- 1
st <- SimThresher(sigma1, nSample=300)
image(st, col=redgreen(64), zlim=c(-1,1))
screeplot(st, col='pink', lcol='red')
plot(st)
scatter(st)
heat(st)