plotCompareCorr: Plot two correlation matrices together

View source: R/plots.R

plotCompareCorrR Documentation

Plot two correlation matrices together

Description

Combined plot of correlation matricies from cases and controls

Usage

plotCompareCorr(
  epiSignal,
  peakIDs,
  testVariable,
  cols,
  size = 5,
  absCorr = FALSE
)

Arguments

epiSignal

matrix or EList of epigentic signal. Rows are features and columns are samples

peakIDs

feature names to extract from rows of epiSignal

testVariable

factor indicating two subsets of the samples to compare

cols

array of color values

size

size of text

absCorr

show absolute correlations

Value

ggplot2 of combined correlation matrix

Examples

library(GenomicRanges)

data('decorateData')

# Evaluate hierarchical clsutering
treeList = runOrderedClusteringGenome( simData, simLocation ) 

# Choose cutoffs and return clusters
treeListClusters = createClusters( treeList, method = "meanClusterSize", meanClusterSize=c( 10, 20) )

# Simulate variable to split dataset by
set.seed(1)
metadata = data.frame( Disease = factor(sample(0:1, ncol(simData), replace=TRUE)))

# get peak ID's from chr1, cluster 1
peakIDs = getFeaturesInCluster( treeListClusters, "chr1", 1, "10")

# plot comparison of correlation matrices for peaks in peakIDs
#  where data is subset by metadata$Disease
plotCompareCorr( simData, peakIDs, metadata$Disease) + ggtitle("chr1: cluster 1")


GabrielHoffman/decorate documentation built on May 23, 2023, 1:29 a.m.