tests/testthat/test-roxytest-testexamples-sig_auto_extract.R

# Generated by roxytest: do not edit by hand!

# File R/sig_auto_extract.R: @testexamples

test_that("Function sig_auto_extract() @ L98", {
  
  
  load(system.file("extdata", "toy_copynumber_tally_W.RData",
    package = "sigminer", mustWork = TRUE
  ))
  res <- sig_auto_extract(cn_tally_W$nmf_matrix, result_prefix = "Test_copynumber", nrun = 1)
  # At default, all run files are stored in tempdir()
  dir(tempdir(), pattern = "Test_copynumber")
  
  laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
  laml <- read_maf(maf = laml.maf)
  mt_tally <- sig_tally(
    laml,
    ref_genome = "BSgenome.Hsapiens.UCSC.hg19",
    use_syn = TRUE
  )
  
  x <- sig_auto_extract(mt_tally$nmf_matrix,
    strategy = "ms", nrun = 3, ref_sigs = "legacy"
  )
  x
  
  expect_s3_class(res, "Signature")
  res <- sig_auto_extract(cn_tally_W$nmf_matrix, result_prefix = "test",
                          method = "L1KL", nrun = 1)
  expect_s3_class(res, "Signature")
  res <- sig_auto_extract(cn_tally_W$nmf_matrix, result_prefix = "test",
                          method = "L2KL", nrun = 1)
  expect_s3_class(res, "Signature")
  expect_s3_class(x, "Signature")
})
ShixiangWang/sigminer documentation built on March 16, 2024, 12:30 p.m.