| plotHistogram {chromstaR} | R Documentation |
Plot a histogram of binned read counts with fitted mixture distributions from a uniHMM object.
plotHistogram( model, state = NULL, chromosomes = NULL, start = NULL, end = NULL, linewidth = 1 )
model |
A |
state |
Plot the histogram only for the specified state. One of |
chromosomes, start, end |
Plot the histogram only for the specified chromosomes, start and end position. |
linewidth |
Width of the distribution lines. |
A ggplot object.
## 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)