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

# Generated by roxytest: Do not edit by hand!

context("File R/circos.R: @testexamples")

test_that("Function gcap.plotCircos() @ L46", {
  
  
  library(gcap)
  if (require("circlize") && require("scales")) {
    data("ascn")
    data = ascn
  
    # Create fake data
    set.seed(1234)
    data$sample = sample(LETTERS[1:10], nrow(data), replace = TRUE)
    rv = gcap.ASCNworkflow(data, outdir = tempdir(), model = "XGB11")
  
    gcap.plotCircos(rv)
  
    # Select genes to highlight in plot
    r1 = rv$getGeneSummary()
    gcap.plotCircos(rv, r1[circular == 1]$gene_id[1:10])
  
    gcap.plotCircos(rv, rv$data[, .(label = .N), by = .(band)][1:10])
    gcap.plotCircos(
      rv,
      rv$data[, .(label = .N, cluster = gsub("(.*):.*", "\\1", band)),
        by = .(band)
      ][1:10]
    )
  }
  
  expect_equal(5, 5)
})
ShixiangWang/gcaputils documentation built on Feb. 14, 2023, 5:58 a.m.