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

Issue loading Vizgen data #7648

Closed
JessicaChevallier opened this issue Aug 7, 2023 · 8 comments
Closed

Issue loading Vizgen data #7648

JessicaChevallier opened this issue Aug 7, 2023 · 8 comments

Comments

@JessicaChevallier
Copy link

JessicaChevallier commented Aug 7, 2023

Hi,

Thank you for the recent updates @alikhuseynov in order for us to load Vizgen data using parquet files. I installed the development branch and red this post #7080 to learn how to load the data correctly. I always run into a C stack usage error in Rstudio as you can see below. I tried increasing the C stack usage limit in R and when running docker, but I still get the same issue. I'm using Ubuntu 20.04.4 and should have plenty of memory.

Has anyone run into this issue before and have any advice? Thank you!

obj <-
  LoadVizgen(data.dir = dir_use,  
             fov = "merfish.test", 
             assay = "Vizgen",
             metadata = c("volume", "fov"), # add cell volume info
             type = c("segmentations", "centroids"), # type of cell spatial coord matrices
             z = 3L,
             add.zIndex = TRUE, # add z slice section to a cell
             update.object = TRUE,
             use.BiocParallel = TRUE,
             workers.MulticoreParam = 14, # for `BiocParallel` processing
             verbose = TRUE
  )

Using parallelization with: `BiocParallel`
Setting total workers to: 14
Reading data from:
./region_0
Cell segmentations are found in `.parquet` file
>>> using micron space coordinates
>>> filtering `cell_metadata` - keep cells with `transcript_count` > 0
>>> filtering `cell_by_gene` - keep cells with counts > 0
Error: C stack usage  7971172 is too close to the limit
@alikhuseynov
Copy link
Contributor

Hi there,
Could you please list the content of your ./region_0 directory?
Does it work if you set ulimit -s unlimited before you start R session?

@JessicaChevallier
Copy link
Author

JessicaChevallier commented Aug 9, 2023

Hi,

This is my directory structure. I've omitted the image directory because we saved those files on our server. Setting ulimit -s unlimited before my R session did not work.

After some test, I've found that updating to SeuratV5 in the Rstudio session, restarting the session and then installing the development branch does not cause this error. However, when I implemented these steps in a Dockerfile and ran the container I get the C stack usage error again. Maybe there are some dependency issues I'm not aware of.

region_0/
├── *_region_0.vzg
├── cell_boundaries.parquet
├── cell_by_gene.csv
├── cell_metadata.csv
├── detected_transcripts.csv

@alikhuseynov
Copy link
Contributor

Hi,

This is my directory structure. I've omitted the image directory because we saved those files on our server. Setting ulimit -s unlimited before my R session did not work.

After some test, I've found that updating to SeuratV5 in the Rstudio session, restarting the session and then installing the development branch does not cause this error. However, when I implemented these steps in a Dockerfile and ran the container I get the C stack usage error again. Maybe there are some dependency issues I'm not aware of.

region_0/ ├── *_region_0.vzg ├── cell_boundaries.parquet ├── cell_by_gene.csv ├── cell_metadata.csv ├── detected_transcripts.csv

yeah, the directory is fine.
Probably some dependencies were lacking, however my SeuratObject package version is 4.1.3. I haven't yet tested the feat/vizgen branch on Seurat v5 and v5 related SeuratObject
I can't help you on Docker part, sorry, but could you specify there the ulimit -s unlimited before the R session starts?

@JessicaChevallier
Copy link
Author

Hi,

Downloading the development branch and necessary dependencies right in the Rstudio session works for now. I'm not quite sure what the issue with Docker is, but thank you for your help! I tried to specify ulimit -s unlimited before starting the R session when running Docker and in the Rstudio terminal but the issue still comes up.

@alikhuseynov
Copy link
Contributor

what does the following prints inside R in your docker?

system("ulimit", intern = T)
Cstack_info()

# in my case:
Cstack_info()
      size    current  direction eval_depth 
   7969177      20616          1          2 

I assume the issue is with docker's C++ or Rcpp.
If you specify ulimit similar to this issue or this when running docker, does it help?

@JessicaChevallier
Copy link
Author

JessicaChevallier commented Aug 18, 2023

Thank you for your help, it works now! I added --rm -ti --ulimit stack=8277716992:8277716992 as suggested by moby/moby#13521 (comment)

Running Cstack_info() now gives the following:

Cstack_info()
      size    current  direction eval_depth 
        NA         NA          1          2 

@alikhuseynov
Copy link
Contributor

Thank you for your help, it works now! I added --rm -ti --ulimit stack=8277716992:8277716992 as suggested by moby/moby#13521 (comment)

Running Cstack_info() now gives the following:

Cstack_info()
      size    current  direction eval_depth 
        NA         NA          1          2 

Great! glad it did work

@dcollins15
Copy link
Contributor

Thanks for using Seurat!

It appears that this issue has gone stale. In an effort to keep our Issues board from getting more unruly than it already is, we’re going to begin closing out issues that haven’t had any activity since the release of v4.4.0.

If this issue is still relevant we strongly encourage you to reopen or repost it, especially if you didn’t initially receive a response from us.

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

3 participants