Helper function to cluster the correlation matrix and return the sorted matrix for plotting.
clust_cormap(
cormat,
na.frac = 0.1,
distfn = function(cm) (1 - cm),
method = "complete",
cor.cluster = 1,
cor.window = NULL,
cor.thr = 0.8,
cor.mar = 0.05,
cut.thr = 0.9,
cut.size = 5,
list.output = FALSE,
verbose = FALSE
)
(numeric
or list
). The correlation matrix or a list containing matrices of correlation values
and P-Values as generated by eset_cor
. If a list then the correlation matrix is expected to be in slot
'cor' and the matrix of P-Values in slot 'pvalues'.
(numeric
). Fraction of missing values allowed per row of the input matrix. Defaults to 0.1
which
means LESS than 10per centof the values in one row are allowed to be NAs.
(function
). Function to calculate the dissimilarity matrix for clustering. Defaults to function(cm) (1-cm)
.
(character
). The agglomeration method used for clustering. See help for hclust
.
Defaults to "complete".
(numeric
). The correlation cluster along the diagonal 'line' in the heatmap that should be
zoomed into. A sliding window of size cor.window
will be moved along the diagonal of the correlation
matrix to find the cluster with the most corelation values meeting core.thr
. Defaults to 1
.
(numeric
). The size of the sliding window (see cor.cluster
). Defaults to NULL
.
Note that this works only for positive correlations.
(numeric
). Correlation threshold to filter the correlation matrix for plotting. Defaults to NULL
meaning
no filtering. See also cor.mar. This value is sign-sensitive: a negative threshold will retain rows and columns of
the correlation matrix with correlation values between -1 and the threshold, a positive value will retain rows and columns
with values between the threshold and 1. Zero (0) is treated as positive.
(numeric
). Margin of the values per row of the correlation matrix the cor.thr filter needs to
meet. Defaults to 0.5
meaning at least 50 per cent of the values in a row need to meet the threshold in order to keep the row.
(numeric
). Threshold at which dendrogram branches are to be cut. Passed on to argument cutHeight
in
cutreeStatic
. Defaults to NULL
meaning no cutting.
(numeric
). Minimum number of objects on a dendrogram branch considered a cluster. Passed on to argument
minSize
in cutreeStatic
. Defaults to 5
.
(logical
). Should the output be a list of different object created in the call? Depends also on input
type. If FALSE
only the (filtered) correlation matrix is returned.
(logical
). Should verbose output be written to the console? Defaults to FALSE
.
A correlation matrix
or a list
or the matrix and other values needed for plotting.