JEFworks-Lab / STdeconvolve

Reference-free cell-type deconvolution of multi-cellular spatially resolved transcriptomics data
http://jef.works/STdeconvolve/
112 stars 13 forks source link

Could not find function "simulateBregmaSpots" #29

Open LYxiaotai opened 1 year ago

LYxiaotai commented 1 year ago

Dear Brendan,

Sorry to bother you.

I wanted to generate the gene counts and metadata tables of individual cells profiled by MERFISH from the Moffit et al. 2018 raw data. And I followed the code at https://jef.works/STdeconvolve/process_mpoa_data.html.

but when I generate hash tables of simulated spots for each bregma separately by:

 FN7_hash <- simulateBregmaSpots(annot.table_,
                                 counts = counts_, # gene counts matrix
                                 patch_size = 100) # size of the simulated pixels in um2 (units of the Centroids)

I get the following error:

Error in simulateBregmaSpots(annot.table_, counts = counts_, patch_size = 100) : 
  could not find function "simulateBregmaSpots"

I dont't konw how to solve this problem, could you please give me some help?

Thank you so much in advance for your time! Best, Yi Liu

bmill3r commented 1 year ago

Hi Yi Liu,

Thanks so much for using STdeconvolve and for your question. The reason why that particular function is not available in the namespace is because it is only available as part of the devel branch of STdeconvolve. You can see the function here on line 324. Further, you'll also notice that this function contains the roxygen tag @noRd so this function also won't be loaded into the namespace, but should still be able to be called if the devel version of STdeconvolve is installed via STdeconvolve::simulateBregmaSpots(). The reason for this is because simulateBregmaSpots() isn't needed for the functionality of STdeconvolve but rather is a function created to generate the simulated MPOA multicellular resolution dataset used in the paper. So it is only provided in the devel branch as a means for others to reproduce the analyses.

Without reinstalling the devel branch, you could copy the function itself into your R session. Note that to complete the MPOA vignette, you will also need the next function below it, buildBregmaCorpus().

Let me know if this helps or if you have any additional questions,

Brendan

LYxiaotai commented 1 year ago

Thank you so much for such a detailed answer, it helped me a lot. Thank you so much for your time again!