Description Usage Arguments Details Value Author(s) References See Also Examples
Given a bin size and a GRanges alignment object, the funciton computes the bin count and returns the cost of the bin size based on Shimazaki cost function.
1 | evalBinSize(binSize, alignGR)
|
binSize |
An integer that indicates the bin size applied to the binning of the chromosome. |
alignGR |
GRanges object of alignments to a single chromosome. |
The function implements the algorithm developed by Shimazaki and Shinomoto (2007), which is based on the goodness of the fit of the time histogram to estimate the rate of neural response of an animal to certain stimuli in a spike-in experiment. The algorithm involves four simple steps:
1. Divide chromosome sequence into N bins of width b.
2. Count number of read counts x_i that enter the i'th bin.
3. Compute: \bar{x} = \frac{1}{N}∑_{i=1}^{N}x_{i} and v = \frac{1}{N}∑_{i=1}^{N}(x_{i} - \bar{x})^{2}.
4. Compute: C(b) = \frac{2\bar{x}-v}{b^{2}}
cost |
A scalar value for the cost of the bin size. |
Yue Li
Hideaki Shimazaki and Shigeru Shinomoto. A method for selecting the bin size of a time histogram. Neural computation, 19(6):1503-1527, June 2007.
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
costs <- evalBinSize(binSize, alignGRList$chrX)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.