R/getscaledata.R

Defines functions getscaledata

# function definitions ##### version: 02-22-2019 should sync from the version in macbook:
# /Users/weili/Dropbox/work/cropseq/Shendure/nmeth18/multiple_guides_function.R


getscaledata <- function(targetobj,  slot = c("data", "scale.data", "counts")) {
    ## if scaled=FALSE, return raw.data
    #if ("scale.data" %in% names(attributes(targetobj))) {
    #    if (scaled) {
    #        scalef = targetobj@scale.data  # for version 2
    #    } else {
    #        scalef = targetobj@raw.data  # for version 2
    #    }
    #} else {
    #    if (scaled) {
    #        scalef = GetAssayData(object = targetobj, slot = "scale.data")
    #    } else {
    #        scalef = GetAssayData(object = targetobj, slot = "counts")
    #    }
    #}
    scalef = GetAssayData(object = targetobj, slot = slot)
    return(scalef)
}
TRUE
weililab/scMAGeCK documentation built on April 21, 2024, 10:36 a.m.