Learn R Programming

Seurat (version 3.0.1)

as.loom: Convert objects to loom objects

Description

Convert objects to loom objects

Usage

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, ...)

Arguments

x

An object to convert to class loom

...

Ignored for now

assay

Assay to store in loom file

filename

The name of the new loom file

max.size

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

chunk.dims

Matrix chunk dimensions; auto-determined by default

chunk.size

Maximum number of cells read/written to disk at once; auto-determined by default

overwrite

Overwrite an already existing loom file?

verbose

Display a progress bar

Details

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

See Also

create

Examples

Run this code
# NOT RUN {
lfile <- as.loom(x = pbmc_small)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab