Skip to contents

This function is primarily designed for fetching the raw count data from a LOOM file, output by Velocyto. We by default use the spliced counts.

Usage

readVelocytoLoom(
  filename,
  matrixPath = "layers/spliced",
  cellID = "CellID",
  featureID = "Gene",
  chunkSize = 1000
)

Arguments

filename

File path to the LOOM file.

matrixPath

A path in the LOOM file to the matrix to extract, following the inner HDF5 structure. Default "layers/spliced". See Details.

cellID

The name of the cell ID column in the LOOM column-attributes. The same thing as argument obs_names of scanpy.read_loom. Default "CellID".

featureID

The name of the feature ID column in the LOOM row-attributes. The same thing as argument var_names of scanpy.read_loom. Default "Gene".

chunkSize

The maximum size of the chunk to load the matrix. Default 1000.

Value

A sparse matrix of class "dgCMatrix", with cells as columns and genes as rows.

Details

The velocyto output LOOM file is HDF5 based and is roughly organized as follows:

  • "matrix": The whole raw counts, which is the sum of spliced, unspliced and ambiguous counts.

  • layers: A group like a folder

    • "layers/spliced": The spliced counts.

    • "layers/unspliced": The unspliced counts.

    • "layers/ambiguous": The ambiguous counts.

An AnnData object created with Scanpy by default loads the data with a different structure, so that all the four matrices are accessible in adata.layers and set one of them (by default "layers/spliced") to adata.X.

See also

Examples

if (FALSE) {
loomFile <- "velocyto/out/analysis.loom"
rawCounts <- readVelocytoLoom(loomFile)
}