Counts ChIP-seq read coverage for each BAM file using the coverage function from bedtools. Then normalizes the read counts by scaling to the reference ChIP-seq library size, and transforms the ChIP-seq read counts.

count_normalize_chip(
  sites,
  chip_bam_files,
  chip_idxstats_files,
  chrom_size_file,
  ref_size = 2e+07,
  transform = c("none", "asinh", "log2", "sqrt"),
  bedtools_path = "bedtools"
)

Arguments

sites

A data frame containing the candidate sites.

chip_bam_files

ChIP-seq BAM files (may include multiple replicates).

chip_idxstats_files

ChIP-seq idxstats files (may include multiple replicates). (Default: uses the corresponding .idxstats.txt files in the same directory of the BAM files).

chrom_size_file

Chromosome size file.

ref_size

Scales to ChIP-seq reference library size (Default: 2e7)

transform

Transformation for ChIP-seq read counts. Options are ‘none’ (no transformation), ‘asinh’, ‘log2’, and ‘'sqrt'’.

bedtools_path

Path to bedtools executable. (default: 'bedtools')

Value

A data frame of candidate sites and normalized (and transformed) ChIP-seq read counts around each candidate site.

Examples

if (FALSE) {
sites_chip <- count_normalize_chip(sites,
                                   chip_bam_files=c('ChIPseq.rep1.bam', 'ChIPseq.rep2.bam'),
                                   chrom_size_file='hg38.chrom.sizes',
                                   ref_size=2e7)
}