regionReads: Count ChIP-Seq Reads for Genomic Regions

Description Usage Arguments Value Examples

Description

Count reads for customized regions or genome wide bins for multiple ChIP-Seq samples in BAM (.bam) or BIGWIG (.bw or .bigwig) format. When no customized peaks provided, this function will generate bin-level counts based on genome information embedded in BAM or BIGWIG files. For BAM files, counts will be generated using Rsubread package; for BIGWIG files, counts will be generated by function in rtracklayer package.

Usage

1
2
3
regionReads(samples, colData = DataFrame(cond = basename(samples)),
  peaks = NULL, binsize = 300L, bincut = 0L, readlen = NULL,
  read2pos = "5", ignoreDup = TRUE)

Arguments

samples

A vector of paths to ChIP-seq files in Bam or Bigwig format.

colData

A DataFrame object contains at lease one column representing the conditions of samples for comparison in differential binding analysis. This object includes the meta-data describing samples. It can store any number of descriptive columns for each sample. See detail in SummarizedExperiment::colData. The default here uses sample names to represent conditions.

peaks

GRanges or NULL. If NULL, genome-wide bins with length binsize will be pre-selected as potential peaks; otherwise, ChIP-seq peaks should be provided as a GRanges object, e.g. a union of peaks identified by peak caller from all samples. (Default: NULL)

binsize

A number specify the bin size. This parameter is only appliable when peaks is NULL. (Default: 300)

bincut

A numeric cut off on read counts to nominate bins as high coverage bins. This parameter is only appliable when peaks is NULL. (Default: 0)

readlen

Sample fragment length with which Bigwig files are created. The signal in Bigwig file is readlen times of original reads number when created by software as Bedtools. One way to count original reads is to privde readlen here. This parameter is only appliable when samples are Bigwig files. If NULL, it is recommended to multiply bincut by a scale factor (normally fragment length). (Default: NULL)

read2pos

Parameter for function featureCounts in package Rsubread. This parameter is only appliable when samples are bam files. (Default: '5')

ignoreDup

Parameter for function featureCounts in package Rsubread. This parameter is only appliable when samples are bam files. (Default: TRUE)

Value

A RangedSummarizedExperiment object containing read counts for genome-wide bins or given peaks..

Examples

1
2
3
4
5
6
library(GenomicRanges)
bams <- c(system.file("extdata", "control.bam", package="ComplexDiff"),
          system.file("extdata", "treated.bam", package="ComplexDiff"))
bins <- GRanges("chr1",IRanges(start = seq(1000000,2000000,300),
                      end = seq(1000000,2000000,300)+300-1))
regionReads(samples=bams,peaks=bins)

tengmx/ComplexDiff documentation built on May 31, 2019, 8:34 a.m.