tests/testthat/test-bam_to_bigwig.R

## test conversion of BAM to BigWig
if (!xfun::is_windows()) {
    test_that("test conversion of BAM to bw", {

        ## Create the bigwig file
        new_files <- bam_to_bigwig(
            pkg_file("tests", "test.bam"),
            overwrite = TRUE
        )

        ## Check the md5sum
        expect_equal(
            unname(tools::md5sum(new_files["all.bw"])),
            unname(tools::md5sum(pkg_file("tests", "test.bam.all.bw")))
        )
        expect_error(
            bam_to_bigwig(pkg_file("tests", "test.bam")),
            "The following files already exist"
        )
    })
}

Try the megadepth package in your browser

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

megadepth documentation built on Feb. 5, 2021, 2:03 a.m.