count_coverage: Create a smoothed and normalized coverage track from a BAM...

View source: R/coverage.R

count_coverageR Documentation

Create a smoothed and normalized coverage track from a BAM file and given a bin GenomicRanges object (same as deepTools bamCoverage)

Description

Normalization is CPM, smoothing is done by averaging on n_smoothBin regions left and right of any given region.

Usage

count_coverage(
  input,
  format = "BAM",
  bins,
  canonical_chr,
  norm_factor,
  n_smoothBin = 5,
  ref = "hg38",
  read_size = 101,
  original_bins = NULL
)

Arguments

input

Either a named list of character vector of path towards single-cell BED files or a sparse raw matrix of small bins (<<500bp). If a named list specifying scBEDn the names MUST correspond to the 'sample_id' column in your SingleCellExperiment object. The single-cell BED files names MUST match the barcode names in your SingleCellExperiment (column 'barcode'). The scBED files can be gzipped or not.

format

File format, either "BAM" or "BED"

bins

A GenomicRanges object of binned genome

canonical_chr

GenomicRanges of the chromosomes to read the BAM file.

norm_factor

Then number of cells or total number of reads in the given sample, for normalization.

n_smoothBin

Number of bins left and right to smooth the signal.

ref

Genomic reference

read_size

Length of the reads

original_bins

Original bins GenomicRanges in case the format is raw

matrix.

Value

A binned GenomicRanges that can be readily exported into bigwig file.


vallotlab/ChromSCape documentation built on Oct. 15, 2023, 1:47 p.m.