changePostCutoff {chromstaR} | R Documentation

## Change the posterior cutoff of a Hidden Markov Model

### Description

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

### Usage

    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

### See Also

`changeMaxPostCutoff`

### Examples

    ## Get an example BAM file with ChIP-seq reads
    file <- system.file("extdata", "euratrans",
                          "lv-H3K27me3-BN-male-bio2-tech1.bam",
                           package="chromstaRData")
    ## Bin the BED file into bin size 1000bp
    data(rn4_chrominfo)
    data(experiment_table)
    binned <- binReads(file, experiment.table=experiment_table,
                      assembly=rn4_chrominfo, binsizes=1000,
                      stepsizes=500, chromosomes='chr12')
    plotHistogram(binned)
    ## Fit HMM
    model <- callPeaksUnivariate(binned, keep.posteriors=TRUE, verbosity=0)
    ## Compare fits with different post.cutoffs
    plotHistogram(changePostCutoff(model, post.cutoff=0.01)) + ylim(0,0.25)
    plotHistogram(model) + ylim(0,0.25)
    plotHistogram(changePostCutoff(model, post.cutoff=0.99)) + ylim(0,0.25)

    ## Get an example multiHMM ##
    file <- system.file("data","multivariate_mode-combinatorial_condition-SHR.RData",
                        package="chromstaR")
    model <- get(load(file))
    genomicFrequencies(model)
    model.new <- changePostCutoff(model, post.cutoff=0.9999)
    genomicFrequencies(model.new)

    ## Get an example combinedMultiHMM ##
    file <- system.file("data","combined_mode-differential.RData",
                        package="chromstaR")
    model <- get(load(file))
    genomicFrequencies(model)
    model.new <- changePostCutoff(model, post.cutoff=0.9999)
    genomicFrequencies(model.new)

[Package chromstaR version 1.14.1 Index]