initialize_odm_from_backing_file()
initializes an odm
object from a backing .odm
file.
Details
initialize_odm_from_backing_file()
is portable: the user can create an .odm
file (via create_odm_from_cellranger()
or create_odm_from_r_matrix()
) on one computer, transfer the .odm
file to another computer, and then load the .odm
file (via initialize_odm_from_backing_file()
) on the second computer.
Examples
library(sceptredata)
directories_to_load <- paste0(
system.file("extdata", package = "sceptredata"),
"/highmoi_example/gem_group_", c(1, 2)
)
directory_to_write <- tempdir()
out_list <- create_odm_from_cellranger(
directories_to_load = directories_to_load,
directory_to_write = directory_to_write,
)
#> Round 1/2 processing of the input files.
#> Processing file 1 of 2.
#> Processing file 2 of 2.
#> Round 2/2 processing of the input files.
#> Processing file 1 of 2. Computing cellwise covariates. Writing to disk.
#> Processing file 2 of 2. Computing cellwise covariates. Writing to disk.
gene_odm <- out_list$gene
gene_odm
#> An object of class odm with the following attributes:
#> • 526 features
#> • 45919 cells
#> • Backing file: /var/folders/7v/5sqjgh8j28lgf8qx3gbtq1h00000gp/T//Rtmp8pBZJd/gene.odm
# delete the gene_odm object
rm(gene_odm)
# reinitialize the gene_odm object
gene_odm <- initialize_odm_from_backing_file(
paste0(tempdir(), "/gene.odm")
)
gene_odm
#> An object of class odm with the following attributes:
#> • 526 features
#> • 45919 cells
#> • Backing file: /var/folders/7v/5sqjgh8j28lgf8qx3gbtq1h00000gp/T//Rtmp8pBZJd/gene.odm