getAvgSignal: Compute average signal in state segmentation

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Compute average signal in state segmentation

Usage

1
getAvgSignal(viterbi, obs, fct=mean)

Arguments

viterbi

A list containing the viterbi paths as factors. The output from getViterbi.

obs

The observations. A list of one or more entries containing the observation matrix (numeric) for the samples (e.g. chromosomes).

fct

The averaging function, default: mean.

Value

A state x data track matrix containing the average signal.

Examples

1
2
3
4
5
6
7
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)
avg_signal = getAvgSignal(viterbi_bdhmm_gauss, yeastTF_databychrom_ex)

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