R/Read_&_Write_Data.R
Read_CellBender_h5_Multi_File.Rd
Extract sparse matrix with corrected counts from CellBender h5 output file across multiple samples within the same directory.
Read_CellBender_h5_Multi_File(
data_dir = NULL,
filtered_h5 = TRUE,
custom_name = NULL,
sample_list = NULL,
sample_names = NULL,
h5_group_name = NULL,
feature_slot_name = "features",
parallel = FALSE,
num_cores = NULL,
merge = FALSE,
...
)
Directory containing the .h5 files output by CellBender.
logical (default TRUE). Will set the shared file name suffix if custom_name
is NULL.
if file name was customized in CellBender then this parameter should contain the portion of file name that is shared across all samples. Must included the ".h5" extension as well.
a vector of sample names if only specific samples are desired. If NULL
will
read in all files within data_dir
directory.
a set of sample names to use for each sample entry in returned list. If NULL
will
set names to the subdirectory name of each sample.
Name of the group within H5 file that contains count data. This is only
required if H5 file contains multiple subgroups and non-default names. Default is NULL
.
Name of the slot contain feature names/ids. Must be one of: "features"(Cell Ranger v3+) or "genes" (Cell Ranger v1/v2 or STARsolo). Default is "features".
logical (default FALSE) whether or not to use multi core processing to read in matrices
how many cores to use for parallel processing.
logical (default FALSE) whether or not to merge samples into a single matrix or return
list of matrices. If TRUE each sample entry in list will have cell barcode prefix added. The prefix
will be taken from sample_names
.
Extra parameters passed to Read_CellBender_h5_Mat
.
list of sparse matrices
if (FALSE) {
base_path <- 'path/to/data/directory'
mat_list <- Read_CellBender_h5_Multi_File(data_dir = base_path)
}