plotHistogram {chromstaR} | R Documentation

## Histogram of binned read counts with fitted mixture distribution

### Description

Plot a histogram of binned read counts with fitted mixture distributions from a `uniHMM` object.

### Usage

    plotHistogram(model, state = NULL, chromosomes = NULL, start = NULL,
      end = NULL, linewidth = 1)

### Arguments

`model` | A `uniHMM` object or file that contains such an object.
`state` | Plot the histogram only for the specified state. One of `c('unmodified','modified')`.
`chromosomes, start, end` | Plot the histogram only for the specified chromosomes, start and end position.
`linewidth` | Width of the distribution lines.

### Value

A `ggplot` object.

### See Also

`plotting`

### 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 the univariate Hidden Markov Model
    hmm <- callPeaksUnivariate(binned, max.time=60, eps=1)
    ## Check if the fit is ok
    plotHistogram(hmm)

[Package chromstaR version 1.10.0 Index]