BinQuasi

Emily Goren

March 22, 2018

Introduction

This package provides code to call peaks in ChIP-seq data with biological replicates using the BinQuasi algorithm.

Data Preprocessing

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.

Peak Calling

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.76342982781363"
head(results$peaks)
#>   start   end width  chr        P.val        Q.val
#> 1 18051 18200   150 chr4 1.344227e-08 2.833598e-08
#> 2 21951 22100   150 chr4 8.873772e-07 1.216566e-06
#> 3 25401 25550   150 chr4 8.997599e-09 1.961015e-08
#> 4 29851 29950   100 chr4 7.554015e-07 1.052609e-06
#> 5 39551 39650   100 chr4 3.514806e-06 4.267979e-06
#> 6 53001 53100   100 chr4 2.742602e-07 4.019330e-07

See the package documentation for information on changing the default settings.

?BQ