plot.job: Plot the called peaks in a job.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/visuals.R

Description

Plot the distribution of reads in a .bed file, with BayesPeak's calls highlighted.

Usage

1
2
3
plot.job(x, raw.out, job, strand = "+", threshold = 0.5,
	xlim = c(0,1), highlight = TRUE, col.un = "grey",
	col.enr = "blue", bin = 100L, ...)

Arguments

x

RangedData (from the IRanges package) with a value column entitled "strand". The .bed file to plot. This could have been read in with read.bed, or alternatively by the import function in the rtracklayer library.

raw.out

Raw output from the bayespeak function.

job

Integer. The number of the job to plot.

strand

Character. Strand to plot - usually either "+" or "-". If the bed argument uses a different convention in its strand column, this can be used instead.

threshold

Numeric. Bins with a PP higher than this value will be classed as enriched.

xlim

Numeric vector. This controls which part of the job is plotted. For example, c(0.5,1) would plot the last half of the job, whereas c(0.25,0.75) would plot the central half.

highlight

Logical. FIXME

col.un

The colour used to plot counts in unenriched bins.

col.enr

The colour used to plot counts in enriched bins.

bin

What sized bin should be used? Currently, this value should be the same as the value used in bayespeak. The function will behave strangely if this parameter is altered, particularly to pathological values.

...

Additional arguments to be passed through to hist.

Details

Similar to plot.bed, plot.job takes the reads in a bed file, and plots a histogram of their locations - i.e. plots the bin counts. It then goes on to highlight the histogram bins that have been made in the raw.output from bayespeak.

It is worth bearing in mind that BayesPeak takes the information on both strands into account when calling peaks, and therefore judgements based on a one-stranded view of the data should be treated with caution. For a better picture of what is going on, both strands should be viewed simultaneously, as is done in the examples below.

Value

Plots a histogram on the active graphical device.

Author(s)

Jonathan Cairns

References

Spyrou C, Stark R, Lynch AG, Tavare S BayesPeak: Bayesian analysis of ChIP-seq data, BMC Bioinformatics 2009, 10:299 doi:10.1186/1471-2105-10-299

See Also

bayespeak, read.bed, plot.bed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
##get the ChIP .bed file
dir <- system.file("extdata", package="BayesPeak")
treatment <- file.path(dir, "H3K4me3reduced.bed")
bed <- read.bed(treatment)

##get the corresponding raw.output object
data(raw.output.H3K4me3)

##plot job 1, + and - strand
par(mfrow = c(2,1))
plot.job(bed, raw.output.H3K4me3, 1)
plot.job(bed, raw.output.H3K4me3, 1, "-")

##zoom in for a closer look...
plot.job(bed, raw.output.H3K4me3, 1, xlim = c(0.58,0.6))
plot.job(bed, raw.output.H3K4me3, 1, "-", xlim = c(0.58,0.6))

BayesPeak documentation built on April 28, 2020, 6:27 p.m.