Description Usage Format Fields Methods See Also
A class for connections loom files
1 | lfile <- loomR::connect(filename = 'myfile.loom')
|
An R6::R6Class object
versionVersion of loomR object was created under
shapeShape of /matrix in genes (columns) by cells (rows)
chunksizeChunks set for this dataset in columns (cells) by rows (genes)
matrixThe main data matrix, stored as columns (cells) by rows (genes)
layersAdditional data matricies, the same shape as /matrix
col.attrsExtra information about cells
row.attrsExtra information about genes
add.graph(a, b, w, name, MARGIN, overwrite), add.graph.matrix(mat, name, MARGIN, overwrite)Add a graph to the loom object; can add either in coorindate format (add.graph) or matrix format (add.graph.matrix).
Stores graph in coordinate format as [row, col]_graphs/name/a (row indices),
[row, col]_graphs/name/b (column indices), and [row, col]_graphs/name/w (values)
aInteger vector of row indices for graph, must be the same lengths as b and w
bInteger vector of column indices for graph, must be the same lengths as a and w
wNumeric vector of values for graph, must be the same lengths as a and b
matGraph provided as a matrix (sparse or dense) or data.frame
nameName to store graph, will end up being col_graphs/name or row_graphs/name, depending on MARGIN
MARGINStore the graph in row_graphs (1) or col_graphs (2), defaults to 2
overwriteCan overwrite existing graph?
add.layer(layer, chunk.size, overwrite)Add a data layer to this loom file, must be the same dimensions as /matrix
layerA named list of matrices to be added as layers
chunk.sizeNumber of rows from each layer to stream at once, defaults to 1000
overwriteIf a layer already exists, overwrite with new data, defaults to FALSE
add.attribute(attribute, MARGIN, overwrite)Add extra information to this loom file.
attributeA named list where the first dimmension of each element as long as one dimension of /matrix
MARGINEither 1 for genes or 2 for cells
overwriteCan overwrite existing attributes?
add.row.attribute(attribute), add.col.attribute(attribute)Add row or column attributes
get.attribute.df(MARGIN, attribute.names, row.names, col.names)Get a group of row or column attributes as a data frame, will only return attributes that have one dimension
MARGINEither '1' or '2' to get row- or column-attributes, respectively
attribute.namesA vector of attribute dataset basenames
row.namesBasename of the rownames dataset
col.namesBasename of the colnames dataset
get.graph(name, MARGIN)Get a graph as a sparse matrix
nameName of the graph, can be either the basename or full name of the grpah
MARGINLoad the graph from row_graphs (1) or col_graphs (2), defaults to 2.
Ignored if full path to graph is passed to name
batch.scan(chunk.size, MARGIN, index.use, dataset.use, force.reset), batch.next(return.data)Scan a dataset in the loom file from index.use[1] to index.use[2], iterating by chunk.size.
chunk.sizeSize to chunk MARGIN by, defaults to self$chunksize
MARGINIterate over genes (1) or cells (2), defaults to 2
index.useWhich specific values of dataset.use to use, defaults to 1:self$shape[MARGIN] (all values)
dataset.useName of dataset to use, can be the name, not group/name, unless the name is present in multiple groups
force.resetForce a reset of the internal iterator
return.dataReturn data for a given chunk, if FALSE, returns the indices across MARGIN for said chunk
apply(name, FUN, MARGIN, chunk.size, dataset.use, overwrite, display.progress, ...)Apply a function over a dataset within the loom file, stores the results in the loom file. Will not make multidimensional attributes.
nameFull name ('group/name') of dataset to store results to
FUNFunction to apply
MARGINIterate over genes (1) or cells (2), defaults to 2
index.useWhich specific values of dataset.use to use, defaults to 1:self$shape[MARGIN] (all values)
chunk.sizeSize to chunk MARGIN by, defaults to self$chunksize
dataset.useName of dataset to use
overwriteOverite name if already exists
display.progressDisplay progress
...Extra parameters to pass to FUN
map(FUN, MARGIN, chunk.size, index.use, dataset.use, display.progress, expected, ...)Map a function onto a dataset within the loom file, returns the result into R.
FUNMARGINIterate over genes (1) or cells (2), defaults to 2
chunk.sizeSize to chunk MARGIN by, defaults to self$chunksize
index.useWhich specific values of dataset.use to use, defaults to 1:self$shape[MARGIN] (all values)
dataset.useName of dataset to use
display.progressDisplay progress
...Extra parameters to pass to FUN
add.cells(matrix.data, attributes.data = NULL, layers.data = NULL, display.progress = TRUE)Add cells to a loom file.
matrix.dataA list of m2 cells where each entry is a vector of length n (num genes, self$shape[1])
attributes.dataA list where each entry is named for one of the datasets in self[['col_attrs']]; each entry is a vector of length m2.
layers.dataA list where each entry is named for one of the datasets in self[['layers']]; each entry is an n-by-m2 matrix where n is the number of genes in this loom file and m2 is the number of cells being added.
display.progressDisplay progress
add.loom(other, other.key, self.key, ...)Add the contents of another loom file to this one.
otherAn object of class loom or a filename of another loom file
other.keyRow attribute in other to add by
self.keyRow attribute in this loom file to add by
...Ignored for now
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.