Learn R Programming

chipenrich (version 1.10.0)

plot_gene_coverage: Plot gene locus length vs. gene coverage by a peak

Description

Create a plot showing the relationship between the length of a gene locus and the proportion of the locus covered by a peak.

Usage

plot_gene_coverage(peaks,locusdef="nearest_tss", genome='hg19',use_mappability=F,read_length=36,legend=T,xlim=NULL)

Arguments

peaks
Either a data frame, a BED file, a .broadPeak file, or a .narrowPeak file. The data frame should have at least 3 columns: chrom, start, and end. Chrom should follow UCSC convention, e.g. "chrX". The file should be tab-delimited.
locusdef
A string denoting the locus definition to be used. A locus definition controls how peaks are assigned to genes. See supported_locusdefs for a list of supported definitions.
genome
A string indicating the genome upon which the peaks file is based. Supported genomes are listed by the supported_genomes function.
use_mappability
If true, each gene's locus length is corrected for by mappability.
read_length
If using mappability (see above), the read length should match the length of reads used in the original experiment.
legend
If true, a legend will be drawn on the plot.
xlim
Set the x-axis limit. NULL means select x-lim automatically.

Value

A trellis plot object.

Details

The x-axis is the log10 of the gene locus length (defined by the locus definition). The y-axis is the proportion of the gene locus covered by a peak. Each plotted black dot is the mean (over both values) of 25 genes (ordered by log10 of the locus length).

See Also

chipenrich

Examples

Run this code
library(chipenrich.data)
library(chipenrich)

# Create histogram of distance from peaks to nearest TSS.
data(peaks_E2F4)
plot_gene_coverage(peaks_E2F4)

Run the code above in your browser using DataLab