plotCompareCorr: Plot two correlation matrices together

Description Usage Arguments Value Examples

View source: R/plots.R

Description

Combined plot of correlation matricies from cases and controls

Usage

1
2
3
4
5
6
7
8
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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 July 26, 2021, 12:18 a.m.