Skip to contents

Write single cell counts from an indexed bam file

Usage

write_sc_counts_from_bam(
  bam_file,
  out_dir,
  cell_names,
  cell_suffix = NULL,
  genome = NULL,
  bin_size = 50000000,
  overwrite = FALSE,
  id = "",
  description = "",
  min_mapq = NULL,
  samtools_bin = "samtools",
  samtools_opts = NULL,
  num_reads = NULL,
  verbose = FALSE
)

scc_from_bam(
  bam_file,
  out_dir,
  cell_names,
  cell_suffix = NULL,
  genome = NULL,
  bin_size = 50000000,
  id = "",
  description = "",
  min_mapq = NULL,
  samtools_bin = "samtools",
  samtools_opts = NULL,
  num_reads = NULL,
  verbose = FALSE,
  overwrite = FALSE
)

Arguments

bam_file

name of the bam file

out_dir

output directory.

cell_names

a vector with the cell names or an ATAC object

cell_suffix

a suffix to add to the cell names (optional). This is useful when you want to merge multiple batches of cells. The suffix would be added in the following way: paste0(cell_name, "-", cell_suffix).

genome

genome name (e.g. hg19). Will be inferred from the ScPeaks object if provided

bin_size

Size of the genomic bins to use (in bp). Each chromsome will be chunked into bins with size which is smaller than this value. Default is 50Mb.

overwrite

overwrite existing directory (optional)

id

an identifier for the object, e.g. "pbmc".

description

description of the object, e.g. "PBMC from a healthy donor - granulocytes removed through cell sorting (10k)"

min_mapq

minimal mapping quality (optional)

samtools_bin

path to samtools executable

samtools_opts

additional options for samtools (e.g. "--subsample 0.1")

num_reads

number of reads (within the region) to process (optional).

verbose

verbose output (optional)

Value

None

Examples

if (FALSE) {
scc_from_bam("pbmc_data/possorted_bam.bam", "pbmc_reads", cell_names = atac_sc)
}