load_peaks_counts_into_sce.Rd
Load one 3-column counts.tab.gz file from polyApipe.py into a SingleCellExperiment for analysis.
load_peaks_counts_into_sce( counts_file, peak_info_file, batch = "", output, cell_name_func = function(batch, cell) paste0(batch, cell), cells_to_use = NULL, n_max = -1, missing_peaks_are_zero = TRUE, ... )
counts_file | Tab-delimeted file of read counts per peak. The '<sample>.tab.gz' as output from polyApipe.py. Format: <peak> <cell> <count> |
---|---|
peak_info_file | GTF formatted peak file _specfically_ as output from polyApipe.py |
batch | A name of the batch/sample. Important if multiple samples are going to be combined. |
output | Where to save the sce object on disk using ssaveHDF5SummarizedExperiment. Should not exist. This directory will be created. |
cell_name_func | A function taking two arguments, the batch name and a vector of cell barcodes. Returns a vector of cell names. Defaults to just paste0-ing the batch and cell barcode together. |
cells_to_use | A vector of cell names to use (should match the output of cell_name_func). NULL to retain all cells. |
n_max | Only read the first *n_max* lines of counts table. (Default = -1 (all)) |
... | Extra options passed to saveHDF5SummarizedExperiment |
Other peak counts loading functions:
load_peaks_counts_dir_into_sce()
,
load_peaks_counts_files_into_sce()
if (FALSE) { counts_file <- system.file("extdata", "demo_dataset/demo_counts/SRR5259354_demo.tab.gz", package = "polyApiper") peak_info_file <- system.file("extdata", "demo_dataset/demo_polyA_peaks.gff", package = "polyApiper") sce <- load_peaks_counts_into_sce(counts_file =counts_file1, peak_info_file = peak_info_file, output = "demo") sce <- load_peaks_counts_into_sce(real_counts_file, "real_polyA_peaks.gff", output = "mysce") sce <- load_peaks_counts_into_sce(counts_file = "run1_knockout_counts.tab.gz", peak_info_file = "run1_knockout_polyA_peaks.gff", output = "./knockout_rep1", batch = "knockout_rep1") # To reload from disk later library('HDF5Array') library('SingleCellExperiment') sce <- loadHDF5SummarizedExperiment("knockout_rep1/") }