Takes in data annotated peak files that include expression information to produce a Cumulative Fraction Plot showing log2FoldChange vs. cumulative fraction of genes included.

CumulativeFractionPlot(peaks.list, res, by = "Nearest.Ensembl",
  boxplot = FALSE)

Arguments

res

Results used to annotate gene expression (with same log2FoldChanges) to calculate "Remaining Genes" distribution. Must have a column labeled with your joining parameter to peaks and "log2FoldChange" (assumed to be ENSEMBL, thus `Nearest.Ensembl`)

by

Argument for dplyr::left_join to combine peaks and results frame

boxplot

Plot a boxplot instead of a CDF.

peaks

Output from HOMER findPeaks and annotatePeaks.pl. Must have a column with a gene identifier that corresponds to `by` (default uses ENSEMBL, `Nearest.Ensembl`)

Value

ggplot2 showing cumulative fraction plot.

Details

Peaks should be annotated using the annotatePeaks.pl script in HOMER and paired with expression data using the -gene argument. An example command might look like: annotatePeaks.pl regions.txt mm10 -ann genes_ens2.gtf -gene results.txt

For multiple regions:expression pairings, separate peak files should be read in, rather than performing multiple runs of annotatePeaks.pl. A list (with names) should be provided.

Ensure that every columns in your expression file has a column name! Else ReadPeaks will get tripped up and not work.

Examples

res <- data.frame(Nearest.Ensembl = rownames(results(dds)), results(dds))
tf <- ReadPeaks(TF.peaks, TF.peaks.exp.anno)
CumulativeFractionPlot(tf, res)
se <- ReadPeaks("data-raw/G_43/superEnhancers.txt", "data-raw/G_43/superEnhancers_gene_anno.txt")
te <- ReadPeaks("data-raw/G_43/typical.txt", "data-raw/G_43/typical_gene_anno.txt")
CumulativeFractionPlot(list(se = se, te = te), res)