meichendong / SCDC

SCDC
42 stars 10 forks source link

Bisque transformation not working #11

Open KaBach opened 4 years ago

KaBach commented 4 years ago

Hi

I am struggling to get sensible deconvolution of bulk RNA sequencing data. It works perferctly fine on other pseudobulked scRNAseq but seems to perform poorly on bulk. So I was hoping to use the bisque transformation, however, it seems that the internal GenerateSCReference function expects an input "cell.types" that is not defined in the parent function SCDC_prop(). Further, it doesn't seem that the bisque transformation is supported in the SCDC_prop_subcl_marker function. Is there a reason for this or could I transform the data before hand and then pass it on to the respective functions?

Best Karsten

meichendong commented 4 years ago

Hi Karsten, Thanks for using SCDC and sorry for the late response! I see the SCDC_prop() issue and I've made a correction for it. The bisque transformation was actually added when I was performing some benchmark for my paper. So it was not intended to be included at first, and I did not try to include it in the SCDC_prop_subcl_marker function since the sub-clustering step is already complicated. I added a deconv_simple() function to allow users to input the pre-processed bulk matrix and pre-calculated basis matrix for the deconvolution. I don't know if this will help? Did you try the bisque package to see the result? Would transformation improve the performance? Please feel free to reach out to meichen@live.unc.edu if you want to discuss more!

lahuuki commented 3 years ago

Hello, I am also getting an error trying to use the Transform_bisque parameter. My data runs fine when Transform_bisque = FALSE, but when I try to turn to TRUE I get the error:

Error in .subset2(x, i, exact = exact) : no such index at level 1
> traceback()
12: (function(x, i, exact) if (is.matrix(i)) as.matrix(x)[[i]] else .subset2(x, 
        i, exact = exact))(x, ..., exact = exact)
11: `[[.data.frame`(pData(x), i)
10: pData(x)[[i]]
9: phenoData(x)[[i]]
8: phenoData(x)[[i]]
7: sc.eset[[ct.sub]]
6: sc.eset[[ct.sub]]
5: base::factor(sc.eset[[ct.sub]])
4: GenerateSCReference(sc.eset, ct.sub)
3: SCDC_prop(bulk.eset = .x$bulk, sc.eset = .x$sce, ct.varname = "cellType.split", 
       sample = "donor", ct.sub = .y, Transform_bisque = TRUE)
2: .f(.x[[1L]], .y[[i]], ...)
1: map2(exp_set2[1], ct, ~SCDC_prop(bulk.eset = .x$bulk, sc.eset = .x$sce, 
       ct.varname = "cellType.split", sample = "donor", ct.sub = .y, 
       Transform_bisque = TRUE))

To me it looks like the error is coming from this line is ct.sub perhaps supposed to be ct.varname? Thanks, -Lousie

meichendong commented 3 years ago

Hi @lahuuki , good catch! I think you are correct. The function is updated now. Please let me know if you have further questions!

Best, Meichen