R/Read_&_Write_Data.R
Read_CellBender_h5_Multi_Directory.Rd
Extract sparse matrix with corrected counts from CellBender h5 output file across multiple sample subdirectories.
Read_CellBender_h5_Multi_Directory(
base_path,
secondary_path = NULL,
filtered_h5 = TRUE,
custom_name = NULL,
sample_list = NULL,
sample_names = NULL,
h5_group_name = NULL,
feature_slot_name = "features",
replace_suffix = FALSE,
new_suffix_list = NULL,
parallel = FALSE,
num_cores = NULL,
merge = FALSE,
...
)
path to the parent directory which contains all of the subdirectories of interest.
path from the parent directory to count matrix files for each sample.
logical (default TRUE). Will set the shared file name suffix 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 directory names if only specific samples are desired. If NULL
will
read in subdirectories in parent 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 replace the barcode suffixes of matrices
using Replace_Suffix
.
a vector of new suffixes to replace existing suffixes if replace_suffix = TRUE
.
See Replace_Suffix
for more information. To remove all suffixes set new_suffix_list = ""
.
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_Directory(base_path = base_path)
}