tests/testthat/test-plot_peaks.R

context("plot_peaks")

test_that("plot_peaks works", {

    library(qtl2geno)
    iron <- read_cross2(system.file("extdata", "iron.zip", package="qtl2geno"))
    map <- insert_pseudomarkers(iron$gmap, step=1)
    probs <- calc_genoprob(iron, map, error_prob=0.002)
    pheno <- iron$pheno
    covar <- match(iron$covar$sex, c("f", "m")) # make numeric
    names(covar) <- rownames(iron$covar)
    Xcovar <- get_x_covar(iron)

    library(qtl2scan)
    out <- scan1(probs, pheno, addcovar=covar, Xcovar=Xcovar)

    # find peaks above lod=3.5 (and calculate 1.5-LOD support intervals)
    peaks <- find_peaks(out, map, threshold=3.5, drop=1.5)

    test_plot_peaks <- function() plot_peaks(peaks, map)

    vdiffr::expect_doppelganger("plot_peaks", test_plot_peaks)

})
rqtl/qtl2plot documentation built on May 28, 2019, 2:36 a.m.