This function provides an interface to software SigProfiler. More please see https://github.com/AlexandrovLab/SigProfilerExtractor. Typically, a reference genome is not required because the input is a matrix (my understanding).

sigprofiler_extract(
  nmf_matrix,
  output,
  range = 2:5,
  nrun = 10L,
  refit = FALSE,
  refit_plot = FALSE,
  is_exome = FALSE,
  init_method = c("nndsvd_min", "random", "alexandrov-lab-custom", "nndsvd", "nndsvda",
    "nndsvdar"),
  cores = -1L,
  genome_build = c("hg19", "hg38", "mm10"),
  use_conda = FALSE,
  py_path = NULL,
  sigprofiler_version = "1.1.0"
)

sigprofiler_import(
  output,
  order_by_expo = FALSE,
  type = c("suggest", "refit", "all")
)

Arguments

nmf_matrix

a matrix used for NMF decomposition with rows indicate samples and columns indicate components.

output

output directory.

range

signature number range, i.e. 2:5.

nrun

the number of iteration to be performed to extract each signature number.

refit

if TRUE, then refit the denovo signatures with nnls. Same meaning as optimize option in sig_extract or sig_auto_extract.

refit_plot

if TRUE, SigProfiler will make denovo to COSMIC sigantures decompostion plots. However, this may fail due to some matrix cannot be identified by SigProfiler plot program.

is_exome

if TRUE, the exomes will be extracted.

init_method

the initialization algorithm for W and H matrix of NMF. Options are 'random', 'nndsvd', 'nndsvda', 'nndsvdar', 'alexandrov-lab-custom' and 'nndsvd_min'.

cores

number of cores used for computation.

genome_build

I think this option is useless when input is matrix, keep it in case it is useful.

use_conda

if TRUE, create an independent conda environment to run SigProfiler.

py_path

path to Python executable file, e.g. '/Users/wsx/anaconda3/bin/python'.

sigprofiler_version

version of SigProfilerExtractor. If this package is not installed, the specified package will be installed. If this package is installed, this option is useless.

order_by_expo

if TRUE, order the import signatures by their exposures, e.g. the signature contributed the most exposure in all samples will be named as Sig1.

type

one of 'suggest' (for suggested solution), 'refit' (for refit solution) or 'all' (for all solutions).

Value

For sigprofiler_extract(), returns nothing. See output directory.

For sigprofiler_import(), a list containing Signature object.

Examples

if (FALSE) {
  load(system.file("extdata", "toy_copynumber_tally_M.RData",
    package = "sigminer", mustWork = TRUE
  ))

  reticulate::conda_list()

  sigprofiler_extract(cn_tally_M$nmf_matrix, "~/test/test_sigminer",
    use_conda = TRUE
  )

  sigprofiler_extract(cn_tally_M$nmf_matrix, "~/test/test_sigminer",
    use_conda = FALSE, py_path = "/Users/wsx/anaconda3/bin/python"
  )
}