hierBipartite {hierBipartite} | R Documentation |
Bipartite Graph-based Hierarchical Clustering
Description
Main bipartite graph-based hierarchial clustering algorithm. Visit here for vignette on using the hierBipartite package.
Usage
hierBipartite(
X,
Y,
groups,
link = "ward.D2",
n_subsample = 1,
subsampling_ratio = 1,
p.value = FALSE,
n_perm = 100,
parallel = FALSE,
maxCores = 7,
p_cutoff = 0.1
)
Arguments
X |
an n x p matrix of variable set 1 (e.g. gene expression) |
Y |
an n x q matrix of variable set 2 (e.g. drug sensitivity) |
groups |
a list of starting group membership (e.g. list("1" = c(1,2,3), "2" = c(4,5,6)) means group 1 has samples 1, 2, 3, and group 2 has samples 4, 5, 6. |
link |
string indicating link function as input to hclust(). One of "ward.D", "ward.D2", "single", "complete", "average", "mcquitty", "median", "centroid". |
n_subsample |
number of subsampling to generate matrix B (see paper) |
subsampling_ratio |
fraction of samples to sample for subsampling to generate matrix B (see paper) |
p.value |
boolean for whether to generate p-values for each merge |
n_perm |
number of permutations for generating p-values. Ignored if p.value = FALSE |
parallel |
boolean for whether to parallelize subsampling and p-value generation step |
maxCores |
maximum number of cores to use (only applicable when parallel = TRUE) |
p_cutoff |
p-value cutoff that determines whether merge is significant. If p-value > p_cutoff, p-values will not be calculated for future merges involving current group. Ignored if p.value = FALSE. |
Value
list of results from bipartite graph-based hierarchical clustering, containing up to
hclustObj: hclust object
groupMerges: list of clusters after each merge, in order of merge. Each cluster is indicated by a vector of cell line groups
nodePvals: list of p-value of each new merge, in order of merge. Only available if p.value = TRUE
D: dissimilarity matrix
Examples
# Get a small subset of the test dataset
data(ctrp2)
groups = ctrp2$groups
X = ctrp2$X
Y = ctrp2$Y
groupNames = names(groups)
groupSmall = groups[groupNames[1:3]]
## Not run:
# Basic call of hierBipartite() on small test dataset
result0 = hierBipartite(X, Y, groupSmall)
# Calling hierBipartite() with subsampling
result1 = hierBipartite(X, Y, groupSmall, n_subsample = 100, subsampling_ratio = 0.90)
# Calling hierBipartite() with p-value generation
result2 = hierBipartite(X, Y, groupSmall, n_perm = 100, p.value = TRUE, p_cutoff = 0.10)
# Calling hierBipartite() with both subsampling and p-value generation (expensive)
result3 = hierBipartite(X, Y, groupSmall, n_subsample = 100, subsampling_ratio = 0.90,
n_perm = 100, p.value = TRUE, p_cutoff = 0.10)
## End(Not run)