YMa-lab / CARD

GNU General Public License v3.0
94 stars 21 forks source link

Error in creating the reference matrix #18

Closed dhivyaa-6 closed 2 years ago

dhivyaa-6 commented 2 years ago

Dear CARD team-

Thanks for this helpful package to deconvolute spatial data. I created the CARD object. However, I am running into issues while trying to run the CARD deconvolution in the create reference from scRNASeq.

     CARD_obj = CARD_deconvolution(CARD_object = CARD_obj)
    ## create reference matrix from scRNASeq...
     Error in asMethod(object) : 
    Cholmod error 'problem too large' at file ../Core/cholmod_dense.c, line 102

This could be due to the size of the sparse matrix. Is there a workaround?

   dim(sc_count)
  [1]  32738 167598
YingMa0107 commented 2 years ago

Hi @dhivyaa-6,

Thank you for your interest in our package! The error is because that the number of cells of the sc_count is too large for SparseMatrix to deal with. One way to solve this quickly is to subset the cells per each cell type, which is also adopted by many other deconvolution methods in their source code. Based on my previous experience on other datasets, you can subset 1000 cells for each cell type (if < 1000 cells, just take them all), it should not affect the general performance of CARD. There is a similar issue posted here: https://github.com/YingMa0107/CARD/issues/11 Hope this is helpful!

Best, Ying

dhivyaa-6 commented 2 years ago

Thanks for your prompt response Ying. That is what I ended up doing, was just wondering if there were any other solutions. Thanks again for the amazing package.

YingMa0107 commented 2 years ago

Hi @dhivyaa-6,

I have updated the package to enable it dealing with large-scale scRNASeq data. I tested the code on a public dataset with about 25,000 genes and 185,000 cells, it takes 2 minutes to construct the reference matrix. In your case, it might take a little bit longer since you have more genes. You can try to reinstall the package and try to run the code to see if it can work for you!

Thank you!

Best, Ying

dhivyaa-6 commented 2 years ago

works now. thanks again.