Wrapper function to
Read_Velocity(
loom_file = NULL,
data_dir = NULL,
multi_dir = TRUE,
gene_symbol = TRUE,
sort_type = FALSE,
sample_list = NULL,
sample_names = NULL,
shared_suffix = NULL,
parallel = FALSE,
num_cores = NULL
)path and name of loom file to read
path to data directory containing all loom files to read
logical, whether or not files are contained in sub-directories or in single folder, default is NULL
logical, should row names of returned matrices have gene symbols or accession ID #s, default is TRUE (symbols).
logical, default is FALSE and will return list with 1 sample per entry. Each sample entry will contain 3 matrices (spliced, unspliced, ambiguous). If TRUE will return list of 3 matrix types (spliced, unspliced, ambiguous) with one entry per sample
A vector of file prefixes/names if specific samples are desired. Default is NULL and
will load all samples in given directory.
a set of sample names to use for each sample entry in returned list. If NULL
will set names to the file name of each sample.
a suffix and file extension shared by all samples.
logical (default FALSE). Whether to use multiple cores when reading in data. Only possible on Linux based systems.
if parallel = TRUE indicates the number of cores to use for multi-core processing.
list of sparse matrices containing spliced, unspliced, and ambiguous counts
Function is updated from SeuratWrappers::ReadVelocity
https://github.com/satijalab/seurat-wrappers/blob/master/R/velocity.R (License: GPL-3).
Function included in scCustomize to avoid installation issues related to other aspects of
velocyto.R package which SeuratWrappers::ReadVelocity requires.
scCustomize version also adds multi-file and multi-directory support, ability to return Ensembl IDs,
and multi-core parallel file reading.
if (FALSE) {
# Read single velocity loom file
velo_res <- Read_Velocity(loom_file = "PATH/sample01.loom")
# Read single velocity loom file with ensembl IDs
velo_res <- Read_Velocity(loom_file = "PATH/sample01.loom", gene_symbol = FALSE)
# Read multiple files from a parent directory with many subdirectories & return 1 list entry per
sample
# Each entry will contain 3 matrices (spliced, unspliced, ambiguous)
velo_res_list <- Read_Velocity(loom_file = "PATH/", secondary_path = "SEC_PATH/")
# Sort returned list by read type instead of by sample
# list will contain 3 entries (spliced, unspliced, ambiguous)
# each entry will contain 1 matrix per sample
velo_res_list <- Read_Velocity(loom_file = "PATH/", secondary_path = "SEC_PATH/",
sort_type = TRUE)
# Read multiple files from a single directory
velo_res_list <- Read_Velocity(loom_file = "PATH/", multi_dir = FALSE)
}