tests/testthat/test_ipcaps.R

context("test ipcaps")

test_that("test ipcaps", {
    BED.file <-
        system.file("extdata", "ipcaps_example.bed", package = "IPCAPS.BIOC")
    LABEL.file <-
        system.file("extdata", "ipcaps_example_individuals.txt.gz",
                    package = "IPCAPS.BIOC")

    # Test data.type = 'snp'
    res <-
        ipcaps(
            bed = BED.file,
            label.file = LABEL.file,
            lab.col = 2,
            out = tempdir(),
            max.thread = 1,
            silence = TRUE
        )

    expect_type(res, "list")
    expect_length(res, 2)

    unlink(res$output.dir, recursive = TRUE)

    # Test data.type = 'linear'
    res <-
        ipcaps(
            bed = BED.file,
            label.file = LABEL.file,
            lab.col = 2,
            out = tempdir(),
            data.type = 'linear',
            max.thread = 1,
            silence = TRUE
        )

    expect_type(res, "list")
    expect_length(res, 2)

    unlink(res$output.dir, recursive = TRUE)
})
kridsadakorn/ipcaps.bioc documentation built on Jan. 22, 2020, 11:18 p.m.