Convert objects to loom objects
as.loom(x, ...)# S3 method for Seurat
as.loom(x, assay = NULL, filename = file.path(getwd(),
paste0(Project(object = x), ".loom")), max.size = "400mb",
chunk.dims = NULL, chunk.size = NULL, overwrite = FALSE,
verbose = TRUE, ...)
An object to convert to class loom
Ignored for now
Assay to store in loom file
The name of the new loom file
Set maximum chunk size in terms of memory usage, unused if chunk.dims
is set;
may pass a character string (eg. 3gb
, 1200mb
) or exact value in bytes
Matrix chunk dimensions; auto-determined by default
Maximum number of cells read/written to disk at once; auto-determined by default
Overwrite an already existing loom file?
Display a progress bar
The Seurat method for as.loom
will try to automatically fill in datasets based on data presence.
For example, if an assay's scaled data slot isn't filled, then dimensional reduction and graph information
will not be filled, since those depend on scaled data. The following is a list of how datasets will be filled
counts
will be stored in matrix
Cell names will be stored in col_attrs/CellID
; feature names will be stored in row_attrs/Gene
data
will be stored in layers/norm_data
scale.data
will be stored in layers/scale_data
Cell-level metadata will be stored in col_attrs
; all periods '.' in metadata will be replaced with underscores '_'
Clustering information from Idents(object = x)
will be stored in col_attrs/ClusterID
and col_attrs/ClusterName
for the numeric and string representation of the factor, respectively
Feature-level metadata will be stored in Feature_attrs
; all periods '.' in metadata will be replaced with underscores '_'
Variable features, if set, will be stored in row_attrs/Selected
; features declared as variable will be stored as '1',
others will be stored as '0'
Dimensional reduction information for the assay provided will be stored in col_attrs
for cell embeddings and row_attrs
for feature loadings; datasets will be named as name_type
where name
is the name within the Seurat object
and type
is cell_embeddings
or feature_loadings
; if feature loadings have been projected for all features,
then projected loadings will be stored instead and type
will be feature_loadings_projected
Nearest-neighbor graphs that start with the name of the assay will be stored in col_graphs
Assay information will be stored as an HDF5 attribute called assay
at the root level
# NOT RUN {
lfile <- as.loom(x = pbmc_small)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab