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, scaled = TRUE) {
    # 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")
        }
    }
    return(scalef)
}
TRUE

Try the scMAGeCK package in your browser

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

scMAGeCK documentation built on Nov. 8, 2020, 7:49 p.m.