data2intelligence / SpaCET

Spatial Cellular Estimator for Tumors
GNU General Public License v3.0
43 stars 4 forks source link

Issues and Suggestions for Malignant Cell Fraction Analysis #38

Open bhyu0217 opened 22 hours ago

bhyu0217 commented 22 hours ago

Hello,

Thank you so much for developing the fascinating tool, which has been incredibly useful for my research!!!

I am inferring malignant cell fractions through CNV and then performing deconvolution on the non-malignant fraction using matched sc/snRNA-seq data. However, I seem to encounter errors in downstream analyses due to the absence of a reference profile for malignant in the SpaCET object.

Here is the error I encountered during the analysis:

SpaCET_obj <- SpaCET.deconvolution.matched.scRNAseq( spatial.obj, sc_includeMalignant = FALSE, cancerType = "GBM", sc_counts = sc_counts, sc_annotation = sc_annotation, sc_lineageTree = sc_lineageTree, sc_nCellEachLineage = 100, coreNo = 8 )

SpaCET_obj <- SpaCET.deconvolution.malignant(SpaCET_obj, Malignant = "Malignant", malignantCutoff = 0.7, coreNo = 8)

[1] "Identify 2 malignant cell states" Error in Ref$refProfiles[, knownCellTypes] : subscript out of bounds In addition: Warning messages: 1: Zero sample variances detected, have been offset away from zero 2: Zero sample variances detected, have been offset away from zero

I noticed that applying SpaCET_obj@results$deconvolution$Ref <- NULL allows the function to run, but it results in an error where all spots (including non-malignant spots) are classified into cancer cell states.

Additionally, during colocalization analysis, the "reference_rho" and "reference_pv" values associated with "malignant" are displayed as "NA" values.

SpaCET_obj <- SpaCET.CCI.colocalization(SpaCET_obj)

SpaCET_obj@results$CCI $colocalization cell_type_1 cell_type_2 fraction_product fraction_rho Glial_Malignant Glial Malignant 2.510831e-02 -0.103 Vascular_Malignant Vascular Malignant 1.556394e-01 -0.702 Neuronal_Malignant Neuronal Malignant 3.049182e-02 0.001 Immune_Malignant Immune Malignant 3.716447e-02 -0.319 Astro_Malignant Astro Malignant 1.483616e-02 -0.071 Oligo_Malignant Oligo Malignant 9.181587e-03 -0.151 OPC_Malignant OPC Malignant 9.329728e-04 0.057 Endo_Malignant Endo Malignant 4.534058e-02 -0.596

fraction_pv reference_rho reference_pv Glial_Malignant 7.997172e-05 NA NA Vascular_Malignant 7.822941e-218 NA NA Neuronal_Malignant 9.616220e-01 NA NA Immune_Malignant 4.353278e-36 NA NA Astro_Malignant 6.225376e-03 NA NA Oligo_Malignant 5.837621e-09 NA NA OPC_Malignant 2.986717e-02 NA NA Endo_Malignant 1.141059e-141 NA NA

I also wanted to ask if it might be possible to implement a function that allows the deconvolution of malignant spots using malignant cell states defined in the matched sc/snRNA-seq data after inferring malignant fractions using CNV. If this is available, it would make it much easier to directly apply cancer cell states established in matched sc/snRNA-seq data to the spatial level.

Thank you for your time and support!!!

beibeiru commented 11 hours ago

Hi, @bhyu0217 ,

We are delighted that our tool can help you with your studies!

I also wanted to ask if it might be possible to implement a function that allows the deconvolution of malignant spots using malignant cell states defined in the matched sc/snRNA-seq data after inferring malignant fractions using CNV.

Do you mean your single-cell data includes malignant cells? If yes, you can set sc_includeMalignant=TRUE to skip inferring malignant fractions using CNV, and decovolve directly with your matched reference, just like https://data2intelligence.github.io/SpaCET/articles/oldST_PDAC.html.

If I misunderstand you or the previous method does not work, please share your spatial.obj, sc_counts, sc_annotation, and sc_lineageTree with me. I will fix it soon.

Best, Beibei