This package provides code to call peaks in ChIP-seq data with biological replicates using the BinQuasi algorithm of Goren, Liu, Wang, and Wang (2018) doi.org/10.1093/bioinformatics/bty227.
BinQuasi accepts sorted and indexed BAM files (note that it does not perform genome alignment of raw reads). If your BAM files are not indexed and sorted, we recommend using samtools.
Once installed, BinQuasi calls peaks with the function “BQ().” Below is code to run BinQuasi with all default settings, where the sorted and indexed BAM files are stored in the directory specified by “fpath” under the file names “C1.bam”, " C2.bam" and “I1.bam”, “I2.bam” for ChIP and input files, respectively.
library(BinQuasi)
fpath <- paste0(system.file(package = 'BinQuasi'), '/extdata/')
results <- BQ(fpath,
ChIP.files = c('C1.bam', 'C2.bam'),
control.files = c('I1.bam', 'I2.bam'))
#> Fragment length not provided. Estimating fragment length using cross correlation... please wait...
#> Bin size not provided. Estimating bin size... please wait...
#> Using bin size of 50 bp
#> Using estimated fragment length for C1.bam equal to 100 bp
#> Using estimated fragment length for C2.bam equal to 100 bp
#> Using estimated fragment length for I1.bam equal to 100 bp
#> Using estimated fragment length for I2.bam equal to 100 bp
#> [1] "Analyzing Window # 2"
#> [1] "Analyzing Window # 10"
#> [1] "Analyzing Window # 100"
#> [1] "Analyzing Window # 500"
#> [1] "Analyzing Window # 1000"
#> [1] "Analyzing Window # 2500"
#> [1] "Analyzing Window # 5000"
#> [1] "Analyzing Window # 10000"
#> [1] "Analyzing Window # 15000"
#> [1] "Analyzing Window # 2"
#> [1] "Analyzing Window # 10"
#> [1] "Analyzing Window # 100"
#> [1] "Analyzing Window # 500"
#> [1] "Analyzing Window # 1000"
#> [1] "Analyzing Window # 2500"
#> [1] "Analyzing Window # 5000"
#> [1] "Analyzing Window # 10000"
#> [1] "Analyzing Window # 15000"
#> [1] "Spline scaling factor: 1.76342977026972"
head(results$peaks)
#> start end width chr P.val Q.val
#> 1 18051 18200 150 chr4 1.342319e-08 2.829367e-08
#> 2 21951 22100 150 chr4 8.868498e-07 1.215842e-06
#> 3 25401 25550 150 chr4 8.988149e-09 1.958956e-08
#> 4 29851 29950 100 chr4 7.556087e-07 1.052897e-06
#> 5 39551 39650 100 chr4 3.514736e-06 4.267893e-06
#> 6 53001 53100 100 chr4 2.740210e-07 4.015825e-07
See the package documentation for information on changing the default settings.