GenomicDistributions: Calculate and plot distributions of genomic ranges across the genome

Nathan Sheffield, PhD
www.databio.org/slides

GenomicDistributions

# Vision: Modular plotting functions ### Integrated: ``` myData = GRanges(...) package::distPlot(myData) ``` ### Modular: ``` myData = GRanges(...) myDistCalc = GenomicDistributions::calculateDist(myData) GenomicDistributions::plotDist(myDistCalc) ``` Advantage: You can easily manipulate the data and plot separately.
# Implementation - *calculate* functions, named `calc____()` * *plot* functions, named `plot____()`
# Getting some data ```R library("GenomicDistributions") queryFile = system.file("extdata", "vistaEnhancers.bed.gz", package="GenomicDistributions") query = rtracklayer::import(queryFile) ```
# Chromosome distribution plots ``` # First, calculate the distribution: x = aggregateOverGenomeBins(query, "hg19") # Then, plot the result: plotGenomeAggregate(x) ```
# Plot multiple GRanges with a GRangesList ``` query2 = GenomicRanges::shift(query, 1e6) queryList = GRangesList(vistaEnhancers=query, shifted=query2) x2 = aggregateOverGenomeBins(queryList, "hg19") plotGenomeAggregate(x2) ```
# Feature distance distribution plots ``` # Calculate the distances: TSSDist = TSSDistance(query, "hg19") # Then plot the result: plotFeatureDist(TSSDist, featureName="TSS") ```
# Partition distribution plots ``` gp = genomicPartitions(query, "hg19") plotPartitions(gp) ```
# Using custom features These helper calculate functions have all used a string to indicate a common reference: ``` gp = genomicPartitions(query, "hg19") x = aggregateOverGenomeBins(query, "hg19") TSSDist = TSSDistance(query, "hg19") ``` What if we want to plot a feature distance relative to something else?
# Using custom features