An R package for organizing, analyzing, and visualizing quantitative genomic data sets in two-dimensional matrices.
genmat provides a function matMake
to organize genomic data such as signals (wiggle, bedGraph) and intervals (e.g. bed, narrowPeak) into two-dimensional matrices by aligning such data at defined set of regions in the genome. Each row in a matrix corresponds to a particular region in the genome aligned at some feature, and each column is a base or window within that region. For example, one could align ChIP-seq read densities aligned at transcription start sites. Genomic data organized in this way is convenient for performaing calculations and generating visualizations such as those included in this package..
matMake
contains many options to define how data is organized into matrices, such as:
- taking into account strandedness of features
- aligning at particular parts of intervals
- setting the genomic size each row represents
- windowing of data, take into account missing data
- metafeature matrices, where genomic intervals of varying sizes are scaled to the same size and a matrix is generated of data within and surrounding these scaled features.
- fragment size matrices, where matrices of bed intervals also store information on the size of the bed interval. These are useful for creating so called "vplots" (Henikoff et. al, 2011 PNAS).
genmat also provides functions for analyzing, visualizing, and performing calculations on matrices generated with matMake
:
matCor
calculates pairwise correlations among a set of matricesmatHeamap
generates heatmaps of matricesmatHist
plots a histogram of scores in matricesmatIqrNorm
normalizes matrices to have a specified interquartile rangematLoess
applies loess smoothing to matricesmatOps
performs a wide variety of calculations on single matrices (e.g. transformations ) and sets of matrices (e.g. averages, differences, variance, ratios)matPlotAverages
generates aggregate line plots by plotting column meansmatPlotRows
generates line plots of specific intervals (rows)matQuantileNorm
normalizes matrices with quantile normalizationmatRead
reads matrices into R as a numeric matrixmatTileGrid
generates average line plots of sets of rows depending on their patterns in two other matricesmatWindow
smooths matrices using sliding window averagesmatWrite
save matrix R objects as files
Install devtools if not installed already:
install.packages("devtools")
Then install github-hosted R dependencies and genmat:
# install conifur (convenience functions for R)
devtools::install_github("dvera/conifur")
# install gyro (genomic wrapper scripts in R)
devtools::install_github("dvera/gyro")
# install travis (R Utilities for Bed and BEdgRaphs
devtools::install_github("dvera/travis")
# install genmat
devtools::install_github("dvera/genmat")
The following R packages are recommended:
devtools::install_github("dvera/converge")