Skip to content

C stack usage error when calling scvelo() in R, but not in Python #101

@CodingKaiser

Description

@CodingKaiser

Description

When calling velociraptor::scvelo() with a reasonable dataset (dim(sce) = c(48367, 2118), using subset.row = head(metadata(sce)$HVGs, 1000), mode = "dynamical", and scvelo.params = list(neighbors = list(n_neighbors = 50L))), I am seeing this warning:

Error: C stack usage 915013296576 is too close to the limit
  • The error does not crash the R process but it seems to appear right before the process returns.
  • Increasing the system stack limit (ulimit -s unlimited) did not resolve the issue.
  • Running the equivalent Python code (scvelo directly, outside R) works fine and doesn't trigger the error.
  • Using alternative scvelo modes (e.g., "steady_state") also triggers the error.
  • The environment uses R 4.5.0 on Debian Bookworm, with basilisk providing scvelo 0.3.2 and all dependencies.
  • Occurs on other datasets as well
  • Seemingly not related to the number of neighbors used. Sometimes it shows, sometimes it doesn't.

Minimal reproducible example

velo.out <- velociraptor::scvelo(
  x = sce, 
  subset.row = head(metadata(sce)$HVGs, 1000),
  mode = "dynamical",
  scvelo.params = list(neighbors = list(n_neighbors = 50L))
)
dim(sce)
# [1] 48367  2118

Additional Information

  • Increasing the stack size via ulimit does not help
  • No evidence of infinite recursion on the Python side
  • Full list of R session info, packages, and Python conda environment provided upon request

As mentioned, this seemingly does not actually affect the calculations, as all necessary data for downstream plotting and data manipulation appear to be generated anyways. Still, it would be helpful to know why this might be occurring.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions