nbh {RIPSeeker} | R Documentation

## Generic function of negative binomial HMM

### Description

Generic function for `nbh.GRanges` and `nbh.integer`

### Usage

    nbh(x, ...)

### Arguments

`x` | Object of class Integer or GRanges.
`...` | Extra arguments passed to either `nbh.GRanges` or `nbh.integer`.

### Author(s)

Yue Li

### References

Rabiner, L. R. (1989). A tutorial on hidden Markov models and selected applications in speech recognition (Vol. 77, pp. 257-286). Presented at the Proceedings of the IEEE. doi:10.1109/5.18626

Bishop, Christopher. Pattern recognition and machine learning. Number 605-631 in Information Science and Statisitcs. Springer Science, 2006.

Capp\'e, O. (2001). H2M : A set of MATLAB/OCTAVE functions for the EM estimation of mixtures and hidden Markov models. (http://perso.telecom-paristech.fr/cappe/h2m/)

### See Also

`mainSeekSingleChrom, nbh.integer, nbh.GRanges`

### Examples

    # 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 <- 1e5  # use a large fixed bin size for demo only

    binGR <- binCount(alignGRList$chrX, binSize)

    # test on GRanges object
    nbhGR <- nbh(binGR, 2, runViterbi=TRUE)

    # test on integer object
    nbhList <- nbh(values(binGR)$count, 2, runViterbi=TRUE)

[Package RIPSeeker version 1.24.0 Index]