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,
  ...
)

Arguments

base_path

path to the parent directory which contains all of the subdirectories of interest.

secondary_path

path from the parent directory to count matrix files for each sample.

filtered_h5

logical (default TRUE). Will set the shared file name suffix custom_name is NULL.

custom_name

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.

sample_list

a vector of sample directory names if only specific samples are desired. If NULL will read in subdirectories in parent directory.

sample_names

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.

h5_group_name

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.

feature_slot_name

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".

replace_suffix

logical (default FALSE). Whether or not to replace the barcode suffixes of matrices using Replace_Suffix.

new_suffix_list

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 = "".

parallel

logical (default FALSE) whether or not to use multi core processing to read in matrices.

num_cores

how many cores to use for parallel processing.

merge

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.

Value

list of sparse matrices

Examples

if (FALSE) {
base_path <- 'path/to/data/directory'
mat_list <- Read_CellBender_h5_Multi_Directory(base_path = base_path)
}