tests/testthat/test_annotateTargets.R

context("annotateTargets") 
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
library(org.Hs.eg.db)
test_coverage <- readCoverageFile(system.file("extdata", "example_normal.txt",
    package = "PureCN"))

test_that("KIF1B is correctly annotated with UCSC chromosome names", {
    x <- head(test_coverage, 100)
    x <- annotateTargets(x, TxDb.Hsapiens.UCSC.hg19.knownGene, 
        org.Hs.eg.db)
    expect_equal(x$Gene[67], "KIF1B")
})

test_that("KIF1B is correctly annotated with NCBI chromosome names", {
    x <- head(test_coverage, 100)
    seqlevelsStyle(x) <- "NCBI"
    x <- annotateTargets(x, TxDb.Hsapiens.UCSC.hg19.knownGene, 
        org.Hs.eg.db)
    expect_equal(x$Gene[67], "KIF1B")
})

Try the PureCN package in your browser

Any scripts or data that you put into this service are public.

PureCN documentation built on Nov. 8, 2020, 5:37 p.m.