Skip to contents

Save a MarchRProject to a directory

Usage

save_project(project, ...)

# S3 method for class 'MarchRProject'
save_project(project, path, copy = TRUE, overwrite = FALSE, ...)

Arguments

project

(MarchRProject) Project to save.

...

Additional arguments passed to methods.

path

(character) Destination directory to write the project into.

copy

(logical) If TRUE, write a self-contained copy: stored data is copied and queued operations (cell subsets, cell name prefixes, lazy matrices) are computed and stored. If FALSE, write a checkpoint that points at stored data and keeps queued operations as recipes. Default: TRUE.

overwrite

(logical) Allow overwriting into a directory that already holds a saved project. Default: FALSE.

Value

(invisibly) The input MarchRProject. With copy = TRUE, its dir is set to path and its matrices and fragments read from the copies.

Details

A checkpoint (copy = FALSE) reads stored data where it lives. For newly saved checkpoints, load_project() checks matrix dimensions and the names and order of matrix rows and columns, fragment cells, and chromosomes. Rewrites that preserve these can still change the data the checkpoint reads. Data it cannot reference, such as data in R's temporary directory, is written into path.

An interrupted or failed save with overwrite = TRUE can leave the previous save partially updated. Save to a new directory to preserve the previous save.