get_groups | R Documentation |
One of key results from signature analysis is to cluster samples into different
groups. This function takes Signature
object as input
and return the membership in each cluster.
get_groups(
Signature,
method = c("consensus", "k-means", "exposure", "samples"),
n_cluster = NULL,
match_consensus = TRUE
)
Signature |
a |
method |
grouping method, more see details, could be one of the following:
|
n_cluster |
only used when the |
match_consensus |
only used when the |
Users may find there are bigger differences between using method 'samples' and 'exposure' but they use a similar idear to find dominant signature, here goes the reason:
Method 'samples' using data directly from NMF decomposition, this means the two matrix
W
(basis matrix or signature matrix) and H
(coefficient matrix or exposure matrix) are
the results of NMF. For method 'exposure', it uses the signature exposure loading matrix.
In this situation, each signture represents a number of mutations (alterations)
about implementation please see source code of sig_extract()
function.
a data.table
object
NMF::predict()
, show_groups.
# Load copy number prepare object
load(system.file("extdata", "toy_copynumber_tally_W.RData",
package = "sigminer", mustWork = TRUE
))
# Extract copy number signatures
library(NMF)
sig <- sig_extract(cn_tally_W$nmf_matrix, 2,
nrun = 10
)
# Methods 'consensus' and 'samples' are from NMF::predict()
g1 <- get_groups(sig, method = "consensus", match_consensus = TRUE)
g1
g2 <- get_groups(sig, method = "samples")
g2
# Use k-means clustering
g3 <- get_groups(sig, method = "k-means")
g3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.