Learn R Programming

sigminer (version 0.1.11)

sig_extract: Extract variation signatures

Description

Do NMF de-composition and then extract signatures.

Usage

sig_extract(nmf_matrix, n_sig, mode = c("copynumber", "mutation"),
  nrun = 10, cores = 1, method = "brunet", pConstant = NULL,
  seed = 123456)

Arguments

nmf_matrix

a matrix used for NMF decomposition (with rownames and colnames), generate from sig_prepare function.

n_sig

number of signature. Please run sig_prepare to select a suitable value.

mode

variation type to decompose, currently support "copynumber" or "mutation".

nrun

a numeric giving the number of run to perform for each value in range, nrun set to 30~50 is enough to achieve robust result.

cores

number of cpu cores to run NMF.

method

specification of the NMF algorithm. Use 'brunet' as default. Available methods for nmf decompositions are 'brunet', 'lee', 'ls-nmf', 'nsNMF', 'offset'.

pConstant

A small positive value to add to the matrix. Use it ONLY if the functions throws an non-conformable arrays error.

seed

specification of the starting point or seeding method, which will compute a starting point, usually using data from the target matrix in order to provide a good guess.

Value

a list contains NMF object, signature matrix and activity matrix.

References

Gaujoux, Renaud, and Cathal Seoighe. "A flexible R package for nonnegative matrix factorization." BMC bioinformatics 11.1 (2010): 367.

Mayakonda, Anand, et al. "Maftools: efficient and comprehensive analysis of somatic variants in cancer." Genome research 28.11 (2018): 1747-1756.

See Also

Other signature analysis series function: sig_assign_samples, sig_estimate, sig_get_activity, sig_get_correlation, sig_get_similarity, sig_prepare, sig_summarize_subtypes

Examples

Run this code
# NOT RUN {
# Load copy number prepare object
load(system.file("extdata", "toy_copynumber_prepare.RData",
  package = "sigminer", mustWork = TRUE
))
# Extract copy number signatures
res <- sig_extract(cn_prepare$nmf_matrix, 2, mode = "copynumber", nrun = 1)
# }

Run the code above in your browser using DataLab