total.norm <- function(x) {
y <- sum(x)
z <- x/y
return(z)
}
#' Deconvolution Methods of xCell
#'
#' @param bulkdata A matrix with genes in rows and samples in columns.
#' @import xCell
#' @return A data frame of Mixed cellular fractions.
#' @export
#'
#'
#' @examples
#'
#' Bulk <- Bulk_GSE60424
#' res <- Xcell(bulkdata = Bulk)
#'
#'
Xcell <- function(bulkdata) {
require(xCell)
res <- xCell::xCellAnalysis(expr = bulkdata,
signatures = NULL,
genes = NULL,
spill = NULL,
rnaseq = TRUE,
file.name = NULL,
scale = TRUE,
alpha = 0.5,
save.raw = FALSE,
parallel.sz = 4,
parallel.type = "SOCK",
cell.types.use = NULL)
res <- apply(t(res)[, 1:64], 1, total.norm)
res_Xcell <- t(res)
return(res_Xcell)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.