R/cell_list_dist.r

Defines functions cell_list_dist

# specificity is generated in the main_CellTypeAnalysis_Preperation.r file
cell_list_dist <- function(hitGenes, sct_data, annotLevel) {
    ValidGenes <- 
        rownames(sct_data[[annotLevel]]$specificity)[
                rownames(sct_data[[annotLevel]]$specificity) %in% hitGenes]
    temp <- sct_data[[annotLevel]]$specificity[ValidGenes, ]

    # If the function was based a single gene list... just return temp
    # if(is.null(dim(hitGenes)[1])){
    #    return(temp)
    # }else{
    return(apply(temp, 2, sum))
    # }
}
NathanSkene/EWCE documentation built on Oct. 5, 2021, 9:19 p.m.