Extract sample-level correlation scores
Source:R/extractCorrelationScores.R
extractCorrelationScores.Rd
Extract sample-level correlation scores for each cluster
Usage
extractCorrelationScores(
epiSignal,
gRanges,
clustList,
method = c("deltaSLE", "Delaneau"),
method.corr = c("pearson", "kendall", "spearman"),
BPPARAM = SerialParam(),
rho = 0.1,
sumabs = 1
)
Arguments
- epiSignal
matrix or EList of epigentic signal. Rows are features and columns are samples
- gRanges
GenomciRanges corresponding to the rows of epiSignal
- clustList
list of cluster assignments
- method
"deltaSLE", "Delaneau"
- method.corr
Specify type of correlation: "pearson", "kendall", "spearman"
- BPPARAM
parameters for parallel evaluation
- rho
used only for sle.score(). A positive constant such that cor(Y) + diag(rep(rho,p)) is positive definite. See sLED::sLED()
- sumabs
used only for sle.score(). regularization paramter. Value of 1 gives no regularization, sumabs*sqrt(p) is the upperbound of the L_1 norm of v, controlling the sparsity of solution. Must be between 1/sqrt(p) and 1. See sLED::sLED()
Examples
library(GenomicRanges)
# load data
data('decorateData')
# Evaluate hierarchical clustering
# adjacentCount is the number of adjacent peaks considered in correlation
treeList = runOrderedClusteringGenome( simData, simLocation)
#>
Evaluating:chr20
#>
# Choose cutoffs and return cluster
treeListClusters = createClusters( treeList, method = "meanClusterSize", meanClusterSize=c( 10, 20, 30, 40, 50) )
#> Method:meanClusterSize
# Evaluate strength of correlation for each cluster
clstScore = scoreClusters(treeList, treeListClusters )
#> Evaluating strength of each cluster...
#>
#> Dividing work into 5 chunks...
# Filter to retain only strong clusters
clustInclude = retainClusters( clstScore, "LEF", 0.30 )
#> Using cutoffs:
#> Cluster set cutoff
#> 10 0.3
#> 20 0.3
#> 30 0.3
#> 40 0.3
#> 50 0.3
#>
# get retained clusters
treeListClusters_filter = filterClusters( treeListClusters, clustInclude)
# collapse similar clusters
treeListClusters_collapse = collapseClusters( treeListClusters_filter, simLocation)
#> Identifying redundant clusters...
# get correlation scores for each sample for each cluster
corScores = extractCorrelationScores( simData, simLocation, treeListClusters_collapse )