viterbi2GRanges: Convert the viterbi path to a GRanges object

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Convert the viterbi path to a GRanges object

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

STAN documentation built on Nov. 8, 2020, 11:11 p.m.