binCount: Count reads in nonoverlapping bins across a chromosome

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Stratify chromosome into nonoverlapping bins of the same size and count the number of reads that fall within each bin.

Usage

1
binCount(alignGR, binSize, returnBinCountOnly = FALSE)

Arguments

alignGR

GRanges object containing the alignments for a single chromosome.

binSize

An integer for the bin size.

returnBinCountOnly

Binary indicator. If TRUE, only the integer read count is returned; if FALSE, GRanges of bins with value slot saved as the corresponding read counts is returned.

Details

The funciton is designed to operate to a single chromosome to facilitate parallel computing on multiple chromosomes independently. The function is used in evalBinSize to select the optimal bin size based on the read counts and in mainSeekSingleChrom to provide the read count as input for the HMM.

Value

If returnBinCountOnly is TRUE, then the integer read count is returned; if returnBinCountOnly is FALSE, then the GRanges of bins with value slot saved for the corresponding read counts is returned.

Author(s)

Yue Li

References

P. Aboyoun, H. Pages and M. Lawrence. GenomicRanges: Representation and manipulation of genomic intervals. R package version 1.8.9.

See Also

selectBinSize, evalBinSize

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Retrieve system files
extdata.dir <- system.file("extdata", package="RIPSeeker") 

bamFiles <- list.files(extdata.dir, ".bam$", recursive=TRUE, full.names=TRUE)

bamFiles <- grep("PRC2", bamFiles, value=TRUE)

alignGal <- getAlignGal(bamFiles[1], reverseComplement=TRUE, genomeBuild="mm9")

alignGR <- as(alignGal, "GRanges")

alignGRList <- GRangesList(as.list(split(alignGR, seqnames(alignGR))))

binSize <- 1000

binGR <- binCount(alignGRList$chrX, binSize)

yueli-compbio/RIPSeeker documentation built on May 8, 2019, 2:34 a.m.