sigmoidTransform: Function to used to perform a k-means k=2 on a W matrix

View source: R/preprocessing_functions.R

sigmoidTransformR Documentation

Function to used to perform a k-means k=2 on a W matrix

Description

Function to used to perform a k-means k=2 on a W matrix

Usage

sigmoidTransform(col.vector, q = 0.95)

Arguments

col.vector

vector taken from a matrix columns

q

quantile

Value

vector

Examples

## Not run: 
Wf <- HMatrix(nmf_exp, k = 5)
ssf <- apply(Wf, 1, function(x){
x <- sigmoidTransform(x)
k <- kmeans(x, 2)
max_idx <- which.max(k$centers)
paste(if_else(k$cluster == max_idx, "1", "0"), collapse = "")
})

## End(Not run)

hdsu-bioquant/ButchR documentation built on Jan. 28, 2023, 6:06 p.m.