Skip to contents

combineLoomFiles combines .loom files generated using velocyto, on multiple BAM files, into one loom file with the cell barcodes fixed to reflect the cell names in the given Seurat object.

Usage

combineLoomFiles(
  loom_files,
  new_loom_filename,
  SeuratObj,
  sample_names,
  seurat_sample_column = "sample_id"
)

Arguments

loom_files

vector of loom files to be merged

new_loom_filename,

character, name of the new loom file to be written out containing the merged data

SeuratObj

corresponding Seurat Object

sample_names

vector of sample names to be looked for in the seurat_sample_column column of the Seurat metadata. Assumed this is in the same order as the order given in loom_files.

seurat_sample_column

column name in the Seurat metadata where the different values given in sample_names can be found

Value

a output message indicating success of writing out the merged loom matrices into the file given by new_loom_file.

Details

combineLoomFiles take a vector of sample_names (which is assumed to be of the same length and in the same order as loom_files), parse the prefix and suffix added to the cell barcodes belonging to the given sample, and modify the column names of the matrices in the loom files accordingly. This allows for combining the matrices coming from different samples without ambiguity of cell barcodes. It then checks the matrices for overlap of genes with the given Seurat Object, and remove duplicated genes, and finally write out the merged loom matrices into a new loom file, to be used for RNA velocity analysis.