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

Parallelisation #3

Open
vincr04 opened this issue Feb 27, 2020 · 2 comments
Open

Parallelisation #3

vincr04 opened this issue Feb 27, 2020 · 2 comments

Comments

@vincr04
Copy link

vincr04 commented Feb 27, 2020

Hi, thanks for developping IKAP, which seems to be a useful software. I am running it on a large Seurat object and am wondering if there are ways to make it quicker (e.g. parallelisation)? Any hint on how to do this would be really appreciated!

@hummuscience
Copy link

Since IKAP uses some functions from Seurat, I guess parallelization can be done using the Seurat method.

According to Seurat, the following functions can use parallelization:
NormalizeData
ScaleData
JackStraw
FindMarkers
FindIntegrationAnchors
FindClusters - if clustering over multiple resolutions

IKAP uses ScaleData, FindAllMarkers from Seurat that would benefit from the parallel processing. Data scaling is done at the beginning so it probably doesn't change much. FindAllMarkers is probably done multiple times so I guess this would benefit a lot from parallelization.

To set up parallel processing, use future

library(future)
plan("multiprocess", workers = 4)

If you get an error like this:

Error in getGlobalsAndPackages(expr, envir = envir, globals = TRUE) : 
  The total size of the X globals that need to be exported for the future expression ('FUN()') is X GiB. This exceeds the maximum allowed size of 500.00 MiB (option 'future.globals.maxSize'). The X largest globals are ... 

You need to adjust the variable future.globals.maxSize as follows:
options(future.globals.maxSize = 1000 * 1024^2)

Careful. Setting this too high might eat up too much RAM and crash R.

@hummuscience
Copy link

Another option would be to use snakemake to run the workflow

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