Change the false discovery rate of a Hidden Markov Model

Share:

Description

Adjusts the peak calls of a uniHMM or multiHMM object with the given posterior cutoff.

Usage

1
changePostCutoff(model, post.cutoff = 0.5)

Arguments

model

A uniHMM or multiHMM object with posteriors.

post.cutoff

A vector of posterior cutoff values between 0 and 1 the same length as ncol(model$bins$posteriors). If only one value is given, it will be reused for all columns. Values close to 1 will yield more stringent peak calls with lower false positive but higher false negative rate.

Details

Posterior probabilities are between 0 and 1. Peaks are called if the posteriors for a state (univariate) or sample (multivariate) are >= post.cutoff.

Value

The input object is returned with adjusted peak calls.

Author(s)

Aaron Taudt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Get an example BAM file
file <- system.file("extdata", "euratrans",
                      "lv-H3K27me3-BN-male-bio2-tech1.bam",
                       package="chromstaRData")
## Bin the file into bin size 1000bp
data(rn4_chrominfo)
binned <- binReads(file, assembly=rn4_chrominfo, binsizes=1000,
                  chromosomes='chr12')
## Fit the univariate Hidden Markov Model
# !Keep posteriors to change the post.cutoff later!
hmm <- callPeaksUnivariate(binned, max.time=60, eps=1,
                          keep.posteriors=TRUE)
## Compare fits with different post.cutoffs
plotHistogram(changePostCutoff(hmm, post.cutoff=0.01)) + ylim(0,0.25)
plotHistogram(hmm) + ylim(0,0.25)
plotHistogram(changePostCutoff(hmm, post.cutoff=0.99)) + ylim(0,0.25)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.