Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with Visium HD #35

Open
alipirani88 opened this issue Nov 13, 2024 · 7 comments
Open

Work with Visium HD #35

alipirani88 opened this issue Nov 13, 2024 · 7 comments

Comments

@alipirani88
Copy link

How do I bypass this error?

Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 't': cannot allocate vector of size 722.0 Gb
Calls: SpaCET.deconvolution ... .V.rep.len -> .V.rep.int -> .handleSimpleError -> h
Execution halted

@beibeiru
Copy link
Collaborator

beibeiru commented Nov 13, 2024

Hi, @alipirani88

Can you upload your SpaCET_obj to the following folder? I will fix it soon.

Best,
Beibei

@alipirani88
Copy link
Author

alipirani88 commented Nov 13, 2024

Hi @beibeiru,

I an not able to access the link but I have uploaded the object to google drive:

@beibeiru
Copy link
Collaborator

Hi, @alipirani88

Thanks for uploading your data.

Your data is a Visium HD sample with 5,744,684 2µm-bins.
This is an extra-large matrix for deconvolution, causing memory issues.

It is better to aggregate your data to 16µm-bin so that you will get 5,744,684/64 = 89760 16µm-bins.
This has two advantages.
(1) a 16µm-bin has more expressed genes while a 2µm-bin has too many gene drop-out.
(2) a 2µm-bin is seldom able to cover an intact cell.

The solution for the current version of SpaCET package is that you can aggregate your data before your read your data as a SpaCET_object.
Alternatively, you can wait two days and I will upgrade the SpaCET package with an automatic aggregation function.

Best,
Beibei

@alipirani88
Copy link
Author

Hi @beibeiru,

I get the following error with 16Mm bins:

Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 't': unable to aggregate TsparseMatrix with 'i' and 'j' slots of length exceeding 2^31-1

Here is the link to object

https://drive.google.com/file/d/1h9j_JFMYjWt7exF77kAcfoK6SF3WmBTp/view?usp=sharing

@beibeiru
Copy link
Collaborator

Hi, @alipirani88

I fixed it and succeeded in running against your data on our HPC sever.

Please reinstall our package.

remove.packages(SpaCET)
devtools::install_github("data2intelligence/SpaCET")

There are many bins in your sample, which have a low count of expressed genes.
You can use min.genes to filter these low-quality bins, e.g., 50.

SpaCET_obj <- SpaCET.quality.control(SpaCET_obj, min.genes=50)
## [1] "Removing spots with less than 50 expressed genes."
## [1] "54865 spots are removed."
## [1] "91215 spots are kept."

SpaCET_obj <- SpaCET.deconvolution(SpaCET_obj, cancerType="BRCA", coreNo=8)

Best,
Beibei

@alipirani88
Copy link
Author

Cool. It ran for me with 16Mm bins.

Does SpaCET work with Xenium data as well?

@beibeiru
Copy link
Collaborator

Xenium can capture hundreds of genes only.
I am not sure whether they are enough for SpaCET.
You can have a try and compare the results with H&E image.

@beibeiru beibeiru changed the title cannot allocate vector of size Work with Visium HD Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants