get_groups {sigminer} | R Documentation |
Get Sample Groups from Signature Decomposition Information
Description
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.
Usage
get_groups(
Signature,
method = c("consensus", "k-means", "exposure", "samples"),
n_cluster = NULL,
match_consensus = TRUE
)
Arguments
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 |
Details
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.
Value
a data.table
object
See Also
Examples
# 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