Skip to contents

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 ) 
#> 
Evaluating:chr20          
#> 

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

# 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")