Save monocle objects

The Monocle3 cell_data_set includes the UMAP models and nearest neighbor indexes, which are not R objects, so the saveRDS() and readRDS() functions do not manage them. The Monocle3 functions save_monocle_objects and load_monocle_objects save the complete cell_data_set in a specified directory.

Save monocle objects

The save_monocle_objects() function saves all of the information in a cell_data_set to files that are stored in a directory with the name specified by the directory_path argument. The optional comment argument stores a memo string with the objects, which is reported when the cell_data_set is loaded with load_monocle_objects().

save_monocle_objects(cds=cds, directory_path='my_cds_objects', comment='This is my example cds. Stored 2022-04-18.')

Load monocle objects

The load_monocle_objects() function loads the complete data set into R from the files in the directory specified by the directory_path argument.

cds <- load_monocle_objects(directory_path='my_cds_objects')
Previous Next