Analyzing Replicated ChIP Sequencing Data Using Quasi-Likelihood

Identify peaks in ChIP-seq data with biological replicates using a one-sided quasi-likelihood ratio test in quasi-Poisson or quasi-negative binomial models.


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.

Installation

The BinQuasi package for R can be installed from Github using devtools following the code below.

devtools::install_github("emilygoren/BinQuasi", args = "--preclean", build_vignettes = TRUE)
library(BinQuasi)

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.

fpath <- paste0(system.file(package = 'BinQuasi'), '/extdata/')
results <- BQ(fpath, 
              ChIP.files = c('C1.bam', 'C2.bam'), 
              control.files = c('I1.bam', 'I2.bam'))
head(results$peaks)

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

?BQ

Exporting Results

The code below saves the called peaks in BED format in the file "BinQuasiPeaks.bed".

# Sort peaks by p-value
opeaks <- results$peaks[order(results$peaks$P.val),]
# Name the peaks by rank
opeaks$name <- paste0('BQ_Peak_', 1:nrow(opeaks))
# Save as .bed file, setting the scores to be -log10(p-value)
bedout <- data.frame(chrom = opeaks$chr,
                     chromStart = opeaks$start,
                     chromEnd = opeaks$end,
                     name = opeaks$name,
                     score = -log10(opeaks$P.val),
                     strand = c(rep(".",  nrow(opeaks))))
head(bedout)
write.table(bedout, file="BinQuasiPeaks.bed", quote = FALSE, sep = "\t", row.names = FALSE, col.names = FALSE)

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("BinQuasi")

0.1-6 by Emily Goren, 9 months ago


https://github.com/emilygoren/BinQuasi


Report a bug at https://github.com/emilygoren/BinQuasi/issues


Browse source code at https://github.com/cran/BinQuasi


Authors: Emily Goren [aut, cre] , Steve Lund [aut] (The author of the QuasiSeq package , from which all functions were modified to produce this package.) , Long Qu [aut] (The author of the QuasiSeq package , from which all functions were modified to produce this package.) , Ian Marschner [aut] (The author of glm2::glm.fit2 , which was modified slightly leading to glm.fit3 in this package.) , Daniel Gerhard [aut] (The author of mcprofile::orglm.fit , which was modified slightly and used under the same name in this package.) , R Core Team [aut] (The author of stats::glm.fit , which was modified slightly leading to glm.fit3 in this package.)


Documentation:   PDF Manual  


GPL (>= 2) license


Imports edgeR, mgcv, pracma, quadprog, Rsamtools, GenomicAlignments, GenomicRanges, IRanges, csaw, SummarizedExperiment, BiocGenerics, S4Vectors, RMySQL

Suggests nleqslv, knitr, rmarkdown


See at CRAN