meichendong / SCDC

SCDC
42 stars 9 forks source link

Error in SCDC_prop() #18

Open RK1912 opened 3 years ago

RK1912 commented 3 years ago

Hi I am running SCDC for deconvolving 200 bulk samples. My current data looks like this : single cell data : ~10,000 genes and ~2500 unique cell IDs and their corresponding cell types in the metadata. Also the single cell data is multi subject and the sample names are given under the subjectname column in the metadata. bulk data : ~10000 genes and 200 individuals.

I get the following error when I run SCDC_prop():

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 't': NAs are not allowed in subscripted assignments 
8.h(simpleError(msg, call)) 
7..handleSimpleError(function (cond) 
.Internal(C_tryCatchHelper(addr, 1L, cond)), "NAs are not allowed in subscripted assignments", 
    base::quote(y[y < q15] <- q15[y < q15])) 
6.FUN(newX[, i], ...) 
5.apply(var.adj, 1, function(y) {
    y[y < q15] <- q15[y < q15]
    y[y > q85] <- q85[y > q85]
    return(y) ... 
4.t(apply(var.adj, 1, function(y) {
    y[y < q15] <- q15[y < q15]
    y[y > q85] <- q85[y > q85]
    return(y) ... 
3.SCDC_basis(x = sc.eset, ct.sub = ct.sub, ct.varname = ct.varname, 
    sample = sample, ct.cell.size = ct.cell.size) 
2.SCDC::SCDC_prop(bulk.eset = T.eset, sc.eset = C.eset, ct.varname = "cellType", 
    sample = "SubjectName", ct.sub = unique(as.character(phenoDataC$cellType)), 
    iter.max = 200) at helper_functions.R#677
1.t(SCDC::SCDC_prop(bulk.eset = T.eset, sc.eset = C.eset, ct.varname = "cellType", 
    sample = "SubjectName", ct.sub = unique(as.character(phenoDataC$cellType)), 
    iter.max = 200)$prop.est.mvw) at helper_functions.R#677

let me know how I can fix this . Thanks , RK

meichendong commented 3 years ago

Hi @RK1912 , I just updated some functions. I doubt the problem is that some individuals/subjects do not provide cells from certain cell types of interest. This would be a problem when we do division or calculate variance. Please try again and see if you still have questions! Sorry for late response! Please let me know if you have more questions. Feel free to send questions to: meichen@live.unc.edu.

Best, Meichen