R/preprocessing_filtering_reduction.R
raw_counts_to_sparse_matrix.RdThis function takes three different type of single-cell input: - Single cell BAM files (sorted) - Single cell BED files (gzipped) - A combination of an index file, a peak file and cell barcode file (The index file is composed of three column: index i, index j and value x for the non zeroes entries in the sparse matrix.)
raw_counts_to_sparse_matrix( files_dir_list, file_type = c("scBED", "scBAM", "FragmentFile"), use_Signac = TRUE, peak_file = NULL, n_bins = NULL, bin_width = NULL, genebody = NULL, extendPromoter = 2500, verbose = TRUE, ref = c("hg38", "mm10")[1], progress = NULL, BPPARAM = BiocParallel::bpparam() )
| files_dir_list | A named character vector of directories containing the files. The names correspond to sample names. |
|---|---|
| file_type | Input file(s) type(s) ('scBED','scBAM','FragmentFile') |
| use_Signac | Use Signac wrapper function 'FeatureMatrix' if the Signac package is installed (TRUE). |
| peak_file | A file containing genomic location of peaks (NULL) |
| n_bins | The number of bins to tile the genome (NULL) |
| bin_width | The size of bins to tile the genome (NULL) |
| genebody | Count on genes (body + promoter) ? (NULL) |
| extendPromoter | If counting on genes, number of base pairs to extend up or downstream of TSS (2500). |
| verbose | Verbose (TRUE) |
| ref | reference genome to use (hg38) |
| progress | Progress object for Shiny |
| BPPARAM | BPPARAM object for multiprocessing. See bpparam for more informations. Will take the default BPPARAM set in your R session. |
A sparse matrix of features x cells
This functions re-counts signal on either fixed genomic bins, a set of user-defined peaks or around the TSS of genes.
Stuart el al., Multimodal single-cell chromatin analysis with Signac bioRxiv https://doi.org/10.1101/2020.11.09.373613