View on GitHub

Seurat.multicore

Multicore and utility functions for Seurat 2 & 3, using doMC / foreach packages.

Multicore functions / parallel implementations plus speed optimized & utility functions for Seurat 2 & 3

Multicore functions & implementations for Seurat using doMC / foreach packages. Implementations are either from me or found on the web.

This repository now serves 4 main purposes:

  1. Multicore read/write/save/load/compress functions (Seurat3.Multicore.Read.Write.R)
  2. Multicore implementation of single core functions via foreach / dopar (Seurat.Multicore.Examples.R)
  3. Legacy functionality for Seurat v2.x (Seurat2.Multicore.Functions.R)
  4. Other functionalities are in (Seurat3.Multicore.Generic.Functions.R, Seurat.Functions.other.R)

Notice: most of the non-multicore functionalites were migrated to Seurat.utils`

Use case

Some Seurat functions can be fairly slow when run on a single core. To speed up you can use all cores of your computer.

Tested on OS X, but it is in development.

Notice

‘Future’ and ‘doMC (foreach)’ based parallelisation seem to collide in one case. If you load futures before, using NormalizeData inside a foreach loop, it fails (Error writing to connection).

Solution: do not load & setup future before NormalizeData.

# After NormalizeData
library(future)
plan("multiprocess", workers = 6)
# So to set Max mem size to 2GB, you would run :
options(future.globals.maxSize = 4000 * 1024^2) 

Install

  1. Download (clone) this repo locally,
  2. change the file path in each .R script (to where you keep them on your computer), and
  3. source("~/path/to/Seurat3.Multicore.Load.R") (Make sure you also change the path’s inside this file):

Alternative: Directly source each .R script from the web, e.g:

source("https://raw.githubusercontent.com/vertesy/Seurat.multicore/master/Seurat3.Multicore.Generic.Functions.R")

Content

!! Notice: most of the non-multicore functionalites were migrated to https://github.com/vertesy/Seurat.utils !! Notice: Consequently, content now changed

  1. Seurat3.Multicore.Read.Write.R:
    1. Multi-core / parallelized read/write/save/load/compress functions
  2. Seurat.Multicore.Examples.R
    1. Single-core functions wrapped in multi-core / parallelized foreach loops
  3. Seurat2.Multicore.Functions.R
    1. Legacy functionality for Seurat v2.x
  4. Seurat3.Multicore.Generic.Functions.R
    1. Multicore
  5. Seurat.Functions.other.R:
    1. Other functionalities

Implementations

1.Parallel Implementation

2.Parallel templates with foreach

3. Parallel Implementation by Seurat (3.1)

4. No Parallel Implementation

5. Other functions implemented / collected here

Functions in main script

!! Notice: most of the non-multicore functionalites were migrated to https://github.com/vertesy/Seurat.utils

Functions in Saving.and.loading.R

Functions in Seurat3.plotting.Functions.R

Other functions