Hi there I'm trying to analyze a cancer dataset using xCell (https://github.com/dviraran/xCell) in R. The xCell performs cell type enrichment analysis from gene expression data and provides a accurate and sensitive way to identify enrichment of multiple cell types in an admixture. The problem that I faced is with MulticoreParam. After running the initial code, which is xCellAnalysis, the analysis stopped by a warning. The warning is related to MulticoreParam(), which not work on Windows. I don't know how to change the function code in order to avoid the following warning : MulticoreParam() not supported on Windows, use SnowParam().
Here is the codes and results:
# call the xCell package > library(xCell)
# Check the input data > head(AMLexpr[1:5,1:5]) 2803 2805 2806 2807 2808 A1BG 9.319523 7.798598 8.415356 9.043970 8.111895 A2M 9.467271 6.827417 6.528420 9.034234 8.765476 NAT1 8.337392 8.237841 8.153449 7.727084 7.858645 NAT2 6.010205 6.010205 6.167216 6.010205 6.010205 SERPINA3 6.298155 6.010205 6.010205 6.800231 6.010205
# Run the 1st function
xCellAnalysis <- function(expr, 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) {
if (is.null(signatures))
signatures = xCell.data$signatures
if (is.null(genes))
genes = xCell.data$genes
if (is.null(spill)) {
if (rnaseq==TRUE) {
spill = xCell.data$spill
} else {
spill = xCell.data$spill.array
}
}
# Caulcate average ssGSEA scores for cell types
if (is.null(file.name) || save.raw==FALSE) {
fn <- NULL
} else {
fn <- paste0(file.name,'_RAW.txt')
}
if (!is.null(cell.types.use)) {
A = intersect(cell.types.use,rownames(spill$K))
if (length(A)<length(cell.types.use)) {
return ('ERROR - not all cell types listed are available')
}
}
scores <- rawEnrichmentAnalysis(expr,signatures,genes,fn, parallel.sz = parallel.sz, parallel.type = 'SOCK')
# Transform scores from raw to percentages
scores.transformed <- transformScores(scores, spill$fv, scale)
# Adjust scores using the spill over compensation matrix
if (is.null(file.name)) {
fn <- NULL
} else {
fn <- file.name
}
if (is.null(cell.types.use)) {
scores.adjusted <- spillOver(scores.transformed, spill$K, alpha,fn )
scores.adjusted = microenvironmentScores(scores.adjusted)
} else {
scores.adjusted <- spillOver(scores.transformed[cell.types.use,], spill$K, alpha,fn )
}
return(scores.adjusted)
}
# Perform xCell analysis
> adjusted <- xCellAnalysis(AMLexpr)
#result !!
[1] "Num. of genes: 10786" Setting parallel calculations through a MulticoreParam back-end with workers=4 and tasks=100. Estimating ssGSEA scores for 489 gene sets. [1] "Calculating ranks..." [1] "Calculating absolute values from ranks..." |==== | 6%Called from: eval(formal.args[[as.character(substitute(arg))]], envir = sys.frame(sysP))
Warning message: In MulticoreParam(progressbar = verbose, workers = parallel.sz, : MulticoreParam() not supported on Windows, use SnowParam()