viterbi2GRanges {STAN} | R Documentation

## Convert the viterbi path to a GRanges object

### Description

Convert the viterbi path to a GRanges object

### Usage

    viterbi2GRanges(viterbi, regions, binSize)

### Arguments

`viterbi` | A list containing the viterbi paths as factors. The output from getViterbi.
`regions` | GRanges object of the regions (e.g. chromosomes) stored in the viterbi path.
`binSize` | The bin size of the viterbi path.

### Value

The viterbi path as GRanges object.

### Examples

    library(GenomicRanges)
    data(yeastTF_databychrom_ex)
    dStates = 6
    dirobs = as.integer(c(rep(0,10), 1, 1))
    bdhmm_gauss = initBdHMM(yeastTF_databychrom_ex, dStates = dStates, method ="Gaussian", directedObs=dirobs)
    bdhmm_fitted_gauss = fitHMM(yeastTF_databychrom_ex, bdhmm_gauss)
    viterbi_bdhmm_gauss = getViterbi(bdhmm_fitted_gauss, yeastTF_databychrom_ex)
    yeastGRanges = GRanges(IRanges(start=1214616, end=1225008), seqnames="chrIV")
    names(viterbi_bdhmm_gauss) = "chrIV"
    viterbi_bdhmm_gauss_gr = viterbi2GRanges(viterbi_bdhmm_gauss, yeastGRanges, 8)

[Package STAN version 2.20.0 Index]