Argument Description
signalFiles paths to either BAM files or bigwig files. More than one path can be in this character vector, but all paths in one function call must point to be either all BAM files or all bigWig files, not a combination of the two.
testRanges A character vector with paths to BED files.
format character string of “bam”, “bigwig”, “RleList” or “PWM”
style a character string, “percentOfRegion” (default) for normalized length divided into bins set by the ‘nOfWindows’ argument, “point” for per base pair plot where the number of base pairs per bin is set by the ‘bin_size’ argument, and “region” for combined plot
nOfWindows The number of windows/bins the normalised ranges will be divided into if ‘style’ is set to ‘percentOfRegion’. Default is 100.
bin_size If ‘style’ is set to ‘point’ then this will determine the size of each bin over which signal is quantified. The default is 20 base pairs.
distanceAround If ‘style’ is ‘percentOfRegion’, then this controls the distance around the region that is included. Default is 100, meaning that a distance equal to 100 percent of that particular region on either side of the region will be included in the heatmap.
pass to the ‘regionPlot’ funtion within the soGGi package

Example

Assign path to bed file to a variable

testRanges <- "K27ac_top10_HUES64.bed"

Read in the paths to the signal files (either bigwig or BAM files)

  • To get bigwig files, go here
  • Scroll/search for samples E016 (stem cells) and E013 (mesoderm) and download H3K27ac, H3K4me1, and H3K4me3 for each sample
  • if this becomes a talk, need to probably shrink these and put into data people can access
library(profileplyr)
library(grid)

esc_files <- list.files("HUES64_E016/", full.names = TRUE)
meso_files <- list.files("meso_HUES64_E013/", full.names = TRUE)

esc_bigwigs <- esc_files[grepl("bigwig", esc_files)]
meso_bigwigs <- meso_files[grepl("bigwig", meso_files)]

signalFiles <- c(esc_bigwigs, meso_bigwigs)

Quantify bigwig signal over peaks in bed file

  • Quantify the signal with ‘BamBigwig_to_chipProfile’ function (makes a chipProfile object from soGGi package)
  • Convert chipProfile object to profileplyr object
# chunk not evaluated
chipProfile <- BamBigwig_to_chipProfile(signalFiles = signalFiles, 
                         testRanges = testRanges, 
                         format = "bigwig", 
                         style = "percentOfRegion",
                         nOfWindows = 50,
                         distanceAround = 100)

# Convert this output to profileplyr object
proplyr_object <- as_profileplyr(chipProfile)