lasso: Create an adjacency matrix based on LASSO

Description Usage Arguments Details Value Author(s) Examples

View source: R/statistical.R

Description

'lasso' infers a adjacency matrix using LASSO using the 'stabsel.matrix' function from the 'stabs' package. 'lasso' extracts the predictors from the function 'stabsel.matrix' and writes the coefficients to an adjacency matrix.

Usage

1

Arguments

x

matrix, where columns are the samples and the rows are features (metabolites), cell entries are intensity values

parallel

logical, should computation be parallelized? If 'parallel = TRUE' the 'bplapply' will be applied if 'parallel = FALSE' the 'lapply' function will be applied.

...

parameters passed to 'stabsel.matrix'

Details

For use of the parameters used in the 'stabsel.matrix' function, refer to '?stabs::stabsel.matrix'.

Value

matrix, matrix with edges inferred from LASSO algorithm 'stabsel.matrix'

Author(s)

Thomas Naake, thomasnaake@googlemail.com

Examples

1
2
3
4
5
data("x_test", package = "MetNet")
x <- x_test[1:10, 3:ncol(x_test)]
x <- as.matrix(x)
x_z <- t(apply(x, 1, function(y) (y - mean(y)) / sd(y)))
## Not run: lasso(x_z, PFER = 0.95, cutoff = 0.95)

MetNet documentation built on Nov. 8, 2020, 7:34 p.m.