Plot the observed methylation profile around the binding sites of one motif together with the profile expected from GC content.
Usage
plotExpectedFootprint(
motif,
tf_bindsites,
msites,
sample_name = NULL,
gc_dist,
gcfreqs,
enhancer = NULL,
returnPlotData = FALSE
)Arguments
- motif
Name of the motif, one of
names(tf_bindsites).- tf_bindsites
A
GRangesListnamed by motif. Each element is aGRangesof the occurrences of that motif. The names must include every name innames(gcfreqs). Get it withgetTFbindsites(motifSet = "jaspar2020")from the methylTFRAnnotationHg38 (or methylTFRAnnotationMm10) package, or build a custom set with methylTFRAnnotationBuilder.- msites
A
GRangesobject with one range per CpG (width 1) and the metadata columnsscore(numeric methylation fraction between 0 and 1) andcoverage(read count). Usually produced byreadMethylome.- sample_name
Optional sample label used in the plot title. Default
"sample".- gc_dist
A
GRangesobject of 30-bp genomic windows with an integer metadata columnGC_bin(1 to 5). Get it withgetGenomeGC()from the annotation package.- gcfreqs
A named
listwith one element per motif, named as intf_bindsites. Each element is a numeric matrix with the five GC bins in rows and the positions across the binding-site window in columns. Get it withgetGCfreq(motifSet = ...)from the annotation package.- enhancer
An optional
GRangesobject of regions, for example distal regulatory elements. Binding sites outside these regions are dropped. Any region set imported asGRangesworks, for example the ENCODE candidate cis-regulatory elements (SCREEN) read withrtracklayer::import(). DefaultNULLuses all binding sites.- returnPlotData
Logical. If
TRUE, return the plot data as well as the plot.
See also
plotMotifFootprint for the bias-corrected
profile, computeDeviation for the score it summarises.
Examples
load(system.file("extdata", "BATF_tf_bindsites.rda", package = "methylTFR"))
load(system.file("extdata", "example_data.rda", package = "methylTFR"))
load(system.file("extdata", "BATF_gcfreqs.rda", package = "methylTFR"))
load(system.file("extdata", "gcdist_subset.rda", package = "methylTFR"))
p <- plotExpectedFootprint(
motif = "BATF",
tf_bindsites = tf_bindsites,
msites = msites,
sample_name = "Sample1",
gc_dist = gcdist,
gcfreqs = gcfreqs,
enhancer = NULL,
returnPlotData = FALSE
)
