R/SFlabels.R

Defines functions SFlabels

Documented in SFlabels

SFlabels <- function(normData) {
    
    ## obtain 2-means clustering labels from transformed data
    km <- kmeans(t(log10(normData$data.norm + 1)),
                 2, nstart=100)$cluster

    ## sort cluster labels based on first entry for consistency
    if (km[1] == 2) {
        km <- 3 - km
    }

    ## combine 2-means labels with low expression flag
    labels <- rep(1, length(normData$flag))
    labels[which(!normData$flag)] <- km + 1

    return(labels)
}

Try the SigFuge package in your browser

Any scripts or data that you put into this service are public.

SigFuge documentation built on Nov. 8, 2020, 6:17 p.m.