- using R version 4.5.2 Patched (2026-01-31 r89382)
- using platform: aarch64-apple-darwin20
- R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
- running under: macOS Ventura 13.7.8
- using session charset: UTF-8
- checking for file ‘GMMAT/DESCRIPTION’ ... OK
- this is package ‘GMMAT’ version ‘1.5.0’
- package encoding: UTF-8
- checking package namespace information ... OK
- checking package dependencies ... INFO
Packages suggested but not available for checking:
'SeqArray', 'SeqVarTools'
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for executable files ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking for sufficient/correct file permissions ... OK
- checking whether package ‘GMMAT’ can be installed ... [18s/19s] OK
See the install log for details.
- used C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
- used C++ compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
- used SDK: ‘MacOSX11.3.1.sdk’
- checking installed package size ... INFO
installed size is 7.6Mb
sub-directories of 1Mb or more:
libs 5.7Mb
- checking package directory ... OK
- checking ‘build’ directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [1s/1s] OK
- checking whether the package can be loaded with stated dependencies ... [1s/1s] OK
- checking whether the package can be unloaded cleanly ... [1s/1s] OK
- checking whether the namespace can be loaded with stated dependencies ... [1s/1s] OK
- checking whether the namespace can be unloaded cleanly ... [1s/1s] OK
- checking loading without being on the library search path ... [1s/1s] OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [4s/4s] OK
- checking Rd files ... [0s/0s] OK
- checking Rd metadata ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of ‘data’ directory ... OK
- checking data for non-ASCII characters ... [0s/0s] OK
- checking data for ASCII and uncompressed saves ... OK
- checking line endings in shell scripts ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking line endings in Makefiles ... OK
- checking compilation flags in Makevars ... OK
- checking for GNU extensions in Makefiles ... OK
- checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
- checking use of PKG_*FLAGS in Makefiles ... OK
- checking compiled code ... OK
- checking sizes of PDF files under ‘inst/doc’ ... OK
- checking installed files from ‘inst/doc’ ... OK
- checking files in ‘vignettes’ ... OK
- checking examples ... [1s/1s] OK
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [3s/2s] ERROR
Running ‘testthat.R’ [2s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library(testthat)
> library(GMMAT)
> Sys.setenv(MKL_NUM_THREADS = 1)
>
> test_check("GMMAT")
*** caught segfault ***
address 0x110, cause 'invalid permissions'
*** caught segfault ***
address 0x110, cause 'invalid permissions'
Traceback:
1: eval(c.expr, envir = args, enclos = envir)
2: eval(c.expr, envir = args, enclos = envir)
3: doTryCatch(return(expr), name, parentenv, handler)
Traceback:
1: 4: eval(c.expr, envir = args, enclos = envir)tryCatchOne(expr, names, parentenv, handlers[[1L]])
2:
eval(c.expr, envir = args, enclos = envir) 5:
3: tryCatchList(expr, classes, parentenv, handlers)doTryCatch(return(expr), name, parentenv, handler)
6: 4: tryCatch(eval(c.expr, envir = args, enclos = envir), error = function(e) e)tryCatchOne(expr, names, parentenv, handlers[[1L]])
7:
FUN(X[[i]], ...) 5:
tryCatchList(expr, classes, parentenv, handlers)
8: lapply(X = S, FUN = FUN, ...) 6:
tryCatch(eval(c.expr, envir = args, enclos = envir), error = function(e) e) 9: doTryCatch(return(expr), name, parentenv, handler)
7: 10: FUN(X[[i]], ...)tryCatchOne(expr, names, parentenv, handlers[[1L]])
8:
lapply(X = S, FUN = FUN, ...)11:
9: tryCatchList(expr, classes, parentenv, handlers)doTryCatch(return(expr), name, parentenv, handler)
12: 10: tryCatch(expr, error = function(e) {tryCatchOne(expr, names, parentenv, handlers[[1L]]) call <- conditionCall(e)
if (!is.null(call)) {11: if (identical(call[[1L]], quote(doTryCatch))) tryCatchList(expr, classes, parentenv, handlers) call <- sys.call(-4L)
dcall <- deparse(call, nlines = 1L)12: prefix <- paste("Error in", dcall, ": ")tryCatch(expr, error = function(e) { LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] call <- conditionCall(e) w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (!is.null(call)) { if (is.na(w)) if (identical(call[[1L]], quote(doTryCatch))) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], call <- sys.call(-4L) type = "b") dcall <- deparse(call, nlines = 1L) if (w > LONG) prefix <- paste("Error in", dcall, ": ") prefix <- paste0(prefix, "\n ") LONG <- 75L } sm <- strsplit(conditionMessage(e), "\n")[[1L]] else prefix <- "Error : " w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (is.na(w)) if (!silent && isTRUE(getOption("show.error.messages"))) { w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], cat(msg, file = outFile) type = "b") .Internal(printDeferredWarnings()) if (w > LONG) } prefix <- paste0(prefix, "\n ") invisible(structure(msg, class = "try-error", condition = e)) }}) else prefix <- "Error : "
msg <- paste0(prefix, conditionMessage(e), "\n")13: .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) {try(lapply(X = S, FUN = FUN, ...), silent = TRUE) cat(msg, file = outFile)
.Internal(printDeferredWarnings())14: }sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE)) invisible(structure(msg, class = "try-error", condition = e))
})15:
FUN(X[[i]], ...)13:
try(lapply(X = S, FUN = FUN, ...), silent = TRUE)
16: 14: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))lapply(seq_len(cores), inner.do)
15: 17: FUN(X[[i]], ...)mclapply(argsList, FUN, mc.preschedule = preschedule, mc.set.seed = set.seed,
mc.silent = silent, mc.cores = cores)16:
18: lapply(seq_len(cores), inner.do)e$fun(obj, substitute(ex), parent.frame(), e$data)
19: 17: mclapply(argsList, FUN, mc.preschedule = preschedule, mc.set.seed = set.seed, foreach(i = 1:ncores) %dopar% { mc.silent = silent, mc.cores = cores) if (!is.null(obj$P)) {
if (bgenInfo$LayoutFlag == 2) { .Call(C_glmm_score_bgen13, as.numeric(res), obj$P, 18: infile, paste0(outfile, "_tmp.", i), center2, e$fun(obj, substitute(ex), parent.frame(), e$data) MAF.range[1], MAF.range[2], miss.cutoff, miss.method,
19: nperbatch, select, threadInfo$begin[i], threadInfo$end[i], threadInfo$pos[i], bgenInfo$N, bgenInfo$CompressionFlag, foreach(i = 1:ncores) %dopar% { 1) if (!is.null(obj$P)) { } if (bgenInfo$LayoutFlag == 2) { else { .Call(C_glmm_score_bgen13, as.numeric(res), obj$P, .Call(C_glmm_score_bgen11, as.numeric(res), obj$P, infile, paste0(outfile, "_tmp.", i), center2, infile, paste0(outfile, "_tmp.", i), center2, MAF.range[1], MAF.range[2], miss.cutoff, miss.method, MAF.range[1], MAF.range[2], miss.cutoff, miss.method, nperbatch, select, threadInfo$begin[i], threadInfo$end[i], nperbatch, select, threadInfo$begin[i], threadInfo$end[i], threadInfo$pos[i], bgenInfo$N, bgenInfo$CompressionFlag, threadInfo$pos[i], bgenInfo$N, bgenInfo$CompressionFlag, 1) 1) } } } else { else { .Call(C_glmm_score_bgen11, as.numeric(res), obj$P, if (bgenInfo$LayoutFlag == 2) { infile, paste0(outfile, "_tmp.", i), center2, .Call(C_glmm_score_bgen13_sp, as.numeric(res), obj$Sigma_i, MAF.range[1], MAF.range[2], miss.cutoff, miss.method, obj$Sigma_iX, obj$cov, infile, paste0(outfile, "_tmp.", i), center2, MAF.range[1], MAF.range[2], nperbatch, select, threadInfo$begin[i], threadInfo$end[i], miss.cutoff, miss.method, nperbatch, select, threadInfo$pos[i], bgenInfo$N, bgenInfo$CompressionFlag, threadInfo$begin[i], threadInfo$end[i], threadInfo$pos[i], 1) bgenInfo$N, bgenInfo$CompressionFlag, 1) } } } else { else { .Call(C_glmm_score_bgen11_sp, as.numeric(res), obj$Sigma_i, obj$Sigma_iX, obj$cov, infile, paste0(outfile, if (bgenInfo$LayoutFlag == 2) { "_tmp.", i), center2, MAF.range[1], MAF.range[2], .Call(C_glmm_score_bgen13_sp, as.numeric(res), obj$Sigma_i, miss.cutoff, miss.method, nperbatch, select, obj$Sigma_iX, obj$cov, infile, paste0(outfile, threadInfo$begin[i], threadInfo$end[i], threadInfo$pos[i], "_tmp.", i), center2, MAF.range[1], MAF.range[2], bgenInfo$N, bgenInfo$CompressionFlag, 1) miss.cutoff, miss.method, nperbatch, select, } threadInfo$begin[i], threadInfo$end[i], threadInfo$pos[i], } bgenInfo$N, bgenInfo$CompressionFlag, 1)} }
else {20: .Call(C_glmm_score_bgen11_sp, as.numeric(res), obj$Sigma_i, glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, obj$Sigma_iX, obj$cov, infile, paste0(outfile, outfile = obj1.outfile.bgen.noselect.1.tmp, ncores = 2) "_tmp.", i), center2, MAF.range[1], MAF.range[2],
miss.cutoff, miss.method, nperbatch, select, 21: threadInfo$begin[i], threadInfo$end[i], threadInfo$pos[i], eval(code, test_env) bgenInfo$N, bgenInfo$CompressionFlag, 1) }
}22: }eval(code, test_env)
20: 23: glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, withCallingHandlers({ outfile = obj1.outfile.bgen.noselect.1.tmp, ncores = 2) eval(code, test_env)
new_expectations <- the$test_expectations > starting_expectations21: if (snapshot_skipped) {eval(code, test_env) skip("On CRAN")
}22: else if (!new_expectations && skip_on_empty) {eval(code, test_env) skip_empty()
}23: withCallingHandlers({ eval(code, test_env)}, expectation = handle_expectation, packageNotFoundError = function(e) { new_expectations <- the$test_expectations > starting_expectations if (on_cran()) { if (snapshot_skipped) { skip("On CRAN") skip(paste0("{", e$package, "} is not installed.")) } }}, snapshot_on_cran = function(cnd) { else if (!new_expectations && skip_on_empty) { snapshot_skipped <<- TRUE skip_empty() invokeRestart("muffle_cran_snapshot") }}, skip = handle_skip, warning = handle_warning, message = handle_message, }, expectation = handle_expectation, packageNotFoundError = function(e) { error = handle_error, interrupt = handle_interrupt) if (on_cran()) {
skip(paste0("{", e$package, "} is not installed."))24: }doTryCatch(return(expr), name, parentenv, handler)}, snapshot_on_cran = function(cnd) {
snapshot_skipped <<- TRUE25: invokeRestart("muffle_cran_snapshot")tryCatchOne(expr, names, parentenv, handlers[[1L]])}, skip = handle_skip, warning = handle_warning, message = handle_message,
error = handle_error, interrupt = handle_interrupt)26:
tryCatchList(expr, classes, parentenv, handlers)24:
doTryCatch(return(expr), name, parentenv, handler)27:
tryCatch(withCallingHandlers({25: eval(code, test_env)tryCatchOne(expr, names, parentenv, handlers[[1L]])
new_expectations <- the$test_expectations > starting_expectations26: if (snapshot_skipped) {tryCatchList(expr, classes, parentenv, handlers) skip("On CRAN")
}27: else if (!new_expectations && skip_on_empty) { skip_empty()tryCatch(withCallingHandlers({ } eval(code, test_env)}, expectation = handle_expectation, packageNotFoundError = function(e) { new_expectations <- the$test_expectations > starting_expectations if (on_cran()) { if (snapshot_skipped) { skip(paste0("{", e$package, "} is not installed.")) skip("On CRAN") } }}, snapshot_on_cran = function(cnd) { else if (!new_expectations && skip_on_empty) { snapshot_skipped <<- TRUE skip_empty() invokeRestart("muffle_cran_snapshot") }}, skip = handle_skip, warning = handle_warning, message = handle_message, }, expectation = handle_expectation, packageNotFoundError = function(e) { error = handle_error, interrupt = handle_interrupt), error = handle_fatal) if (on_cran()) {
skip(paste0("{", e$package, "} is not installed."))28: }doWithOneRestart(return(expr), restart)}, snapshot_on_cran = function(cnd) {
snapshot_skipped <<- TRUE29: invokeRestart("muffle_cran_snapshot")withOneRestart(expr, restarts[[1L]])}, skip = handle_skip, warning = handle_warning, message = handle_message,
30: error = handle_error, interrupt = handle_interrupt), error = handle_fatal)withRestarts(tryCatch(withCallingHandlers({
eval(code, test_env)28: new_expectations <- the$test_expectations > starting_expectationsdoWithOneRestart(return(expr), restart) if (snapshot_skipped) {
skip("On CRAN")29: }withOneRestart(expr, restarts[[1L]]) else if (!new_expectations && skip_on_empty) {
skip_empty()30: }withRestarts(tryCatch(withCallingHandlers({}, expectation = handle_expectation, packageNotFoundError = function(e) { eval(code, test_env) if (on_cran()) { new_expectations <- the$test_expectations > starting_expectations skip(paste0("{", e$package, "} is not installed.")) if (snapshot_skipped) { } skip("On CRAN")}, snapshot_on_cran = function(cnd) { } snapshot_skipped <<- TRUE else if (!new_expectations && skip_on_empty) { skip_empty() invokeRestart("muffle_cran_snapshot") }}, skip = handle_skip, warning = handle_warning, message = handle_message, }, expectation = handle_expectation, packageNotFoundError = function(e) { error = handle_error, interrupt = handle_interrupt), error = handle_fatal), if (on_cran()) { end_test = function() { skip(paste0("{", e$package, "} is not installed.")) }) }
}, snapshot_on_cran = function(cnd) {31: snapshot_skipped <<- TRUEtest_code(code, parent.frame()) invokeRestart("muffle_cran_snapshot")
}, skip = handle_skip, warning = handle_warning, message = handle_message, 32: error = handle_error, interrupt = handle_interrupt), error = handle_fatal), test_that("cross-sectional id le 400 binomial", { end_test = function() { plinkfiles <- strsplit(system.file("extdata", "geno.bed", }) package = "GMMAT"), ".bed", fixed = TRUE)[[1]]
bgenfile <- system.file("extdata", "geno.bgen", package = "GMMAT")31: samplefile <- system.file("extdata", "geno.sample", package = "GMMAT")test_code(code, parent.frame()) gdsfile <- system.file("extdata", "geno.gds", package = "GMMAT")
txtfile <- system.file("extdata", "geno.txt", package = "GMMAT")32: txtfile1 <- system.file("extdata", "geno.txt.gz", package = "GMMAT")test_that("cross-sectional id le 400 binomial", { txtfile2 <- system.file("extdata", "geno.txt.bz2", package = "GMMAT") plinkfiles <- strsplit(system.file("extdata", "geno.bed", data(example) package = "GMMAT"), ".bed", fixed = TRUE)[[1]] suppressWarnings(RNGversion("3.5.0")) bgenfile <- system.file("extdata", "geno.bgen", package = "GMMAT") set.seed(123) samplefile <- system.file("extdata", "geno.sample", package = "GMMAT") pheno <- rbind(example$pheno, example$pheno[1:100, ]) gdsfile <- system.file("extdata", "geno.gds", package = "GMMAT") pheno$id <- 1:500 txtfile <- system.file("extdata", "geno.txt", package = "GMMAT") pheno$disease[sample(1:500, 20)] <- NA txtfile1 <- system.file("extdata", "geno.txt.gz", package = "GMMAT") pheno$age[sample(1:500, 20)] <- NA txtfile2 <- system.file("extdata", "geno.txt.bz2", package = "GMMAT") pheno$sex[sample(1:500, 20)] <- NA data(example) pheno <- pheno[sample(1:500, 450), ] suppressWarnings(RNGversion("3.5.0")) pheno <- pheno[pheno$id <= 400, ] set.seed(123) kins <- example$GRM pheno <- rbind(example$pheno, example$pheno[1:100, ]) obj1 <- glmmkin(disease ~ age + sex, data = pheno, kins = kins, pheno$id <- 1:500 id = "id", family = binomial(link = "logit"), method = "REML", pheno$disease[sample(1:500, 20)] <- NA method.optim = "AI") pheno$age[sample(1:500, 20)] <- NA select <- match(1:400, unique(obj1$id_include)) pheno$sex[sample(1:500, 20)] <- NA select[is.na(select)] <- 0 pheno <- pheno[sample(1:500, 450), ] obj1.outfile.bed.noselect.1 <- tempfile() pheno <- pheno[pheno$id <= 400, ] glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.1) kins <- example$GRM obj1.bed.noselect.1 <- read.table(obj1.outfile.bed.noselect.1, obj1 <- glmmkin(disease ~ age + sex, data = pheno, kins = kins, header = TRUE, as.is = TRUE) id = "id", family = binomial(link = "logit"), method = "REML", obj1.outfile.bed.noselect.1.tmp <- tempfile() method.optim = "AI") expect_error(glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.1.tmp, select <- match(1:400, unique(obj1$id_include)) ncores = 2), "Error: parallel computing currently not implemented for PLINK binary format genotypes.") select[is.na(select)] <- 0 unlink(obj1.outfile.bed.noselect.1.tmp) obj1.outfile.bed.noselect.1 <- tempfile() obj1.outfile.bed.select.1 <- tempfile() glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.1) glmm.score(obj1, infile = plinkfiles, select = select, outfile = obj1.outfile.bed.select.1) obj1.bed.noselect.1 <- read.table(obj1.outfile.bed.noselect.1, obj1.bed.select.1 <- read.table(obj1.outfile.bed.select.1, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.bed.noselect.1, obj1.bed.select.1) obj1.outfile.bed.noselect.1.tmp <- tempfile() obj1.outfile.bgen.noselect.1 <- tempfile() expect_error(glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.1.tmp, glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, outfile = obj1.outfile.bgen.noselect.1) ncores = 2), "Error: parallel computing currently not implemented for PLINK binary format genotypes.") obj1.bgen.noselect.1 <- read.table(obj1.outfile.bgen.noselect.1, unlink(obj1.outfile.bed.noselect.1.tmp) header = TRUE, as.is = TRUE) obj1.outfile.bed.select.1 <- tempfile() obj1.outfile.bgen.noselect.1.tmp <- tempfile() glmm.score(obj1, infile = plinkfiles, select = select, outfile = obj1.outfile.bed.select.1) glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, obj1.bed.select.1 <- read.table(obj1.outfile.bed.select.1, outfile = obj1.outfile.bgen.noselect.1.tmp, ncores = 2) header = TRUE, as.is = TRUE) obj1.bgen.noselect.1.tmp <- read.table(obj1.outfile.bgen.noselect.1.tmp, expect_equal(obj1.bed.noselect.1, obj1.bed.select.1) header = TRUE, as.is = TRUE) obj1.outfile.bgen.noselect.1 <- tempfile() expect_equal(obj1.bgen.noselect.1, obj1.bgen.noselect.1.tmp) glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, unlink(obj1.outfile.bgen.noselect.1.tmp) outfile = obj1.outfile.bgen.noselect.1) obj1.outfile.bgen.select.1 <- tempfile() obj1.bgen.noselect.1 <- read.table(obj1.outfile.bgen.noselect.1, glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, header = TRUE, as.is = TRUE) select = select, outfile = obj1.outfile.bgen.select.1) obj1.outfile.bgen.noselect.1.tmp <- tempfile() obj1.bgen.select.1 <- read.table(obj1.outfile.bgen.select.1, glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, header = TRUE, as.is = TRUE) outfile = obj1.outfile.bgen.noselect.1.tmp, ncores = 2) expect_equal(obj1.bgen.noselect.1, obj1.bgen.select.1) obj1.bgen.noselect.1.tmp <- read.table(obj1.outfile.bgen.noselect.1.tmp, expect_equal(obj1.bed.select.1[, c("SNP", "CHR", "POS", "A1", header = TRUE, as.is = TRUE) "A2", "N", "AF", "SCORE", "VAR", "PVAL")], obj1.bgen.select.1[, expect_equal(obj1.bgen.noselect.1, obj1.bgen.noselect.1.tmp) c("SNP", "CHR", "POS", "A1", "A2", "N", "AF", "SCORE", unlink(obj1.outfile.bgen.noselect.1.tmp) "VAR", "PVAL")]) obj1.outfile.bgen.select.1 <- tempfile() if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, select = select, outfile = obj1.outfile.bgen.select.1) quietly = TRUE)) { obj1.bgen.select.1 <- read.table(obj1.outfile.bgen.select.1, obj1.outfile.gds.noselect.1 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.1) expect_equal(obj1.bgen.noselect.1, obj1.bgen.select.1) obj1.gds.noselect.1 <- read.table(obj1.outfile.gds.noselect.1, expect_equal(obj1.bed.select.1[, c("SNP", "CHR", "POS", "A1", header = TRUE, as.is = TRUE) "A2", "N", "AF", "SCORE", "VAR", "PVAL")], obj1.bgen.select.1[, obj1.outfile.gds.noselect.1.tmp <- tempfile() glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.1.tmp, c("SNP", "CHR", "POS", "A1", "A2", "N", "AF", "SCORE", ncores = 2) "VAR", "PVAL")]) obj1.gds.noselect.1.tmp <- read.table(obj1.outfile.gds.noselect.1.tmp, header = TRUE, as.is = TRUE) if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", expect_equal(obj1.gds.noselect.1, obj1.gds.noselect.1.tmp) quietly = TRUE)) { unlink(obj1.outfile.gds.noselect.1.tmp) obj1.outfile.gds.noselect.1 <- tempfile() obj1.outfile.gds.select.1 <- tempfile() glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.1) glmm.score(obj1, infile = gdsfile, select = select, outfile = obj1.outfile.gds.select.1) obj1.gds.select.1 <- read.table(obj1.outfile.gds.select.1, obj1.gds.noselect.1 <- read.table(obj1.outfile.gds.noselect.1, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.gds.noselect.1, obj1.gds.select.1) obj1.outfile.gds.noselect.1.tmp <- tempfile() expect_equal(obj1.bed.select.1$PVAL, signif(obj1.gds.select.1$PVAL)) glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.1.tmp, expect_equal(signif(range(obj1.gds.select.1$PVAL)), signif(c(0.003804942, 0.986534857))) unlink(c(obj1.outfile.gds.noselect.1, obj1.outfile.gds.select.1)) ncores = 2) } obj1.outfile.txt.select.1 <- tempfile() glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.1, obj1.gds.noselect.1.tmp <- read.table(obj1.outfile.gds.noselect.1.tmp, header = TRUE, as.is = TRUE) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, expect_equal(obj1.gds.noselect.1, obj1.gds.noselect.1.tmp) unlink(obj1.outfile.gds.noselect.1.tmp) select = select, infile.header.print = c("SNP", "Allele1", obj1.outfile.gds.select.1 <- tempfile() "Allele2")) glmm.score(obj1, infile = gdsfile, select = select, outfile = obj1.outfile.gds.select.1) obj1.txt.select.1 <- read.table(obj1.outfile.txt.select.1, obj1.gds.select.1 <- read.table(obj1.outfile.gds.select.1, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.bed.select.1$PVAL, obj1.txt.select.1$PVAL) obj1.outfile.txt.select.1.tmp <- tempfile() expect_equal(obj1.gds.noselect.1, obj1.gds.select.1) expect_error(glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.1.tmp, expect_equal(obj1.bed.select.1$PVAL, signif(obj1.gds.select.1$PVAL)) expect_equal(signif(range(obj1.gds.select.1$PVAL)), signif(c(0.003804942, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, 0.986534857))) select = select, infile.header.print = c("SNP", "Allele1", "Allele2"), ncores = 2), "Error: parallel computing currently not implemented for plain text format genotypes.") unlink(c(obj1.outfile.gds.noselect.1, obj1.outfile.gds.select.1)) unlink(obj1.outfile.txt.select.1.tmp) } obj1.outfile.txt1.select.1 <- tempfile() obj1.outfile.txt.select.1 <- tempfile() glmm.score(obj1, infile = txtfile1, outfile = obj1.outfile.txt1.select.1, glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.1, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select = select, infile.header.print = c("SNP", "Allele1", select = select, infile.header.print = c("SNP", "Allele1", "Allele2")) "Allele2")) obj1.txt1.select.1 <- read.table(obj1.outfile.txt1.select.1, obj1.txt.select.1 <- read.table(obj1.outfile.txt.select.1, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.txt.select.1, obj1.txt1.select.1) expect_equal(obj1.bed.select.1$PVAL, obj1.txt.select.1$PVAL) obj1.outfile.txt2.select.1 <- tempfile() obj1.outfile.txt.select.1.tmp <- tempfile() glmm.score(obj1, infile = txtfile2, outfile = obj1.outfile.txt2.select.1, expect_error(glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.1.tmp, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select = select, infile.header.print = c("SNP", "Allele1", select = select, infile.header.print = c("SNP", "Allele1", "Allele2")) "Allele2"), ncores = 2), "Error: parallel computing currently not implemented for plain text format genotypes.") obj1.txt2.select.1 <- read.table(obj1.outfile.txt2.select.1, unlink(obj1.outfile.txt.select.1.tmp) header = TRUE, as.is = TRUE) obj1.outfile.txt1.select.1 <- tempfile() expect_equal(obj1.txt.select.1, obj1.txt2.select.1) glmm.score(obj1, infile = txtfile1, outfile = obj1.outfile.txt1.select.1, unlink(c(obj1.outfile.bed.noselect.1, obj1.outfile.bed.select.1, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj1.outfile.bgen.noselect.1, obj1.outfile.bgen.select.1, select = select, infile.header.print = c("SNP", "Allele1", obj1.outfile.txt.select.1, obj1.outfile.txt1.select.1, "Allele2")) obj1.outfile.txt2.select.1)) obj1.txt1.select.1 <- read.table(obj1.outfile.txt1.select.1, skip_on_cran() header = TRUE, as.is = TRUE) obj2 <- glmmkin(disease ~ age + sex, data = pheno, kins = NULL, expect_equal(obj1.txt.select.1, obj1.txt1.select.1) id = "id", family = binomial(link = "logit"), method = "REML", obj1.outfile.txt2.select.1 <- tempfile() method.optim = "AI") glmm.score(obj1, infile = txtfile2, outfile = obj1.outfile.txt2.select.1, select <- match(1:400, unique(obj2$id_include)) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select[is.na(select)] <- 0 select = select, infile.header.print = c("SNP", "Allele1", obj2.outfile.bed.noselect.1 <- tempfile() "Allele2")) glmm.score(obj2, infile = plinkfiles, outfile = obj2.outfile.bed.noselect.1) obj1.txt2.select.1 <- read.table(obj1.outfile.txt2.select.1, obj2.bed.noselect.1 <- read.table(obj2.outfile.bed.noselect.1, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.txt.select.1, obj1.txt2.select.1) obj2.outfile.bed.select.1 <- tempfile() unlink(c(obj1.outfile.bed.noselect.1, obj1.outfile.bed.select.1, glmm.score(obj2, infile = plinkfiles, select = select, outfile = obj2.outfile.bed.select.1) obj1.outfile.bgen.noselect.1, obj1.outfile.bgen.select.1, obj1.outfile.txt.select.1, obj1.outfile.txt1.select.1, obj2.bed.select.1 <- read.table(obj2.outfile.bed.select.1, obj1.outfile.txt2.select.1)) header = TRUE, as.is = TRUE) skip_on_cran() expect_equal(obj2.bed.noselect.1, obj2.bed.select.1) obj2 <- glmmkin(disease ~ age + sex, data = pheno, kins = NULL, id = "id", family = binomial(link = "logit"), method = "REML", obj2.outfile.bgen.noselect.1 <- tempfile() method.optim = "AI") glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, select <- match(1:400, unique(obj2$id_include)) outfile = obj2.outfile.bgen.noselect.1) select[is.na(select)] <- 0 obj2.bgen.noselect.1 <- read.table(obj2.outfile.bgen.noselect.1, obj2.outfile.bed.noselect.1 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj2, infile = plinkfiles, outfile = obj2.outfile.bed.noselect.1) obj2.outfile.bgen.select.1 <- tempfile() obj2.bed.noselect.1 <- read.table(obj2.outfile.bed.noselect.1, glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, header = TRUE, as.is = TRUE) select = select, outfile = obj2.outfile.bgen.select.1) obj2.outfile.bed.select.1 <- tempfile() obj2.bgen.select.1 <- read.table(obj2.outfile.bgen.select.1, glmm.score(obj2, infile = plinkfiles, select = select, outfile = obj2.outfile.bed.select.1) header = TRUE, as.is = TRUE) obj2.bed.select.1 <- read.table(obj2.outfile.bed.select.1, expect_equal(obj2.bgen.noselect.1, obj2.bgen.select.1) header = TRUE, as.is = TRUE) expect_equal(obj2.bed.select.1[, c("SNP", "CHR", "POS", "A1", expect_equal(obj2.bed.noselect.1, obj2.bed.select.1) "A2", "N", "AF", "SCORE", "VAR", "PVAL")], obj2.bgen.select.1[, obj2.outfile.bgen.noselect.1 <- tempfile() c("SNP", "CHR", "POS", "A1", "A2", "N", "AF", "SCORE", glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, outfile = obj2.outfile.bgen.noselect.1) "VAR", "PVAL")]) obj2.bgen.noselect.1 <- read.table(obj2.outfile.bgen.noselect.1, if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", header = TRUE, as.is = TRUE) quietly = TRUE)) { obj2.outfile.bgen.select.1 <- tempfile() obj2.outfile.gds.noselect.1 <- tempfile() glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, glmm.score(obj2, infile = gdsfile, outfile = obj2.outfile.gds.noselect.1) select = select, outfile = obj2.outfile.bgen.select.1) obj2.gds.noselect.1 <- read.table(obj2.outfile.gds.noselect.1, obj2.bgen.select.1 <- read.table(obj2.outfile.bgen.select.1, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) obj2.outfile.gds.select.1 <- tempfile() expect_equal(obj2.bgen.noselect.1, obj2.bgen.select.1) glmm.score(obj2, infile = gdsfile, select = select, outfile = obj2.outfile.gds.select.1) expect_equal(obj2.bed.select.1[, c("SNP", "CHR", "POS", "A1", obj2.gds.select.1 <- read.table(obj2.outfile.gds.select.1, "A2", "N", "AF", "SCORE", "VAR", "PVAL")], obj2.bgen.select.1[, header = TRUE, as.is = TRUE) c("SNP", "CHR", "POS", "A1", "A2", "N", "AF", "SCORE", expect_equal(obj2.gds.noselect.1, obj2.gds.select.1) "VAR", "PVAL")]) expect_equal(obj2.bed.select.1$PVAL, signif(obj2.gds.select.1$PVAL)) if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", expect_equal(signif(range(obj2.gds.select.1$PVAL)), signif(c(0.003738918, quietly = TRUE)) { 0.996996766))) obj2.outfile.gds.noselect.1 <- tempfile() } glmm.score(obj2, infile = gdsfile, outfile = obj2.outfile.gds.noselect.1) obj2.outfile.txt.select.1 <- tempfile() obj2.gds.noselect.1 <- read.table(obj2.outfile.gds.noselect.1, glmm.score(obj2, infile = txtfile, outfile = obj2.outfile.txt.select.1, header = TRUE, as.is = TRUE) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj2.outfile.gds.select.1 <- tempfile() select = select, infile.header.print = c("SNP", "Allele1", glmm.score(obj2, infile = gdsfile, select = select, outfile = obj2.outfile.gds.select.1) "Allele2")) obj2.gds.select.1 <- read.table(obj2.outfile.gds.select.1, obj2.txt.select.1 <- read.table(obj2.outfile.txt.select.1, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj2.gds.noselect.1, obj2.gds.select.1) expect_equal(obj2.bed.select.1$PVAL, obj2.txt.select.1$PVAL) expect_equal(obj2.bed.select.1$PVAL, signif(obj2.gds.select.1$PVAL)) obj2.outfile.txt1.select.1 <- tempfile() expect_equal(signif(range(obj2.gds.select.1$PVAL)), signif(c(0.003738918, glmm.score(obj2, infile = txtfile1, outfile = obj2.outfile.txt1.select.1, 0.996996766))) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, } select = select, infile.header.print = c("SNP", "Allele1", obj2.outfile.txt.select.1 <- tempfile() "Allele2")) glmm.score(obj2, infile = txtfile, outfile = obj2.outfile.txt.select.1, obj2.txt1.select.1 <- read.table(obj2.outfile.txt1.select.1, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, header = TRUE, as.is = TRUE) select = select, infile.header.print = c("SNP", "Allele1", expect_equal(obj2.txt.select.1, obj2.txt1.select.1) "Allele2")) obj2.outfile.txt2.select.1 <- tempfile() obj2.txt.select.1 <- read.table(obj2.outfile.txt.select.1, glmm.score(obj2, infile = txtfile2, outfile = obj2.outfile.txt2.select.1, header = TRUE, as.is = TRUE) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, expect_equal(obj2.bed.select.1$PVAL, obj2.txt.select.1$PVAL) obj2.outfile.txt1.select.1 <- tempfile() select = select, infile.header.print = c("SNP", "Allele1", glmm.score(obj2, infile = txtfile1, outfile = obj2.outfile.txt1.select.1, "Allele2")) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj2.txt2.select.1 <- read.table(obj2.outfile.txt2.select.1, select = select, infile.header.print = c("SNP", "Allele1", header = TRUE, as.is = TRUE) "Allele2")) expect_equal(obj2.txt.select.1, obj2.txt2.select.1) obj2.txt1.select.1 <- read.table(obj2.outfile.txt1.select.1, idx <- sample(nrow(pheno)) header = TRUE, as.is = TRUE) pheno <- pheno[idx, ] expect_equal(obj2.txt.select.1, obj2.txt1.select.1) obj1 <- glmmkin(disease ~ age + sex, data = pheno, kins = kins, obj2.outfile.txt2.select.1 <- tempfile() id = "id", family = binomial(link = "logit"), method = "REML", glmm.score(obj2, infile = txtfile2, outfile = obj2.outfile.txt2.select.1, method.optim = "AI") infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select <- match(1:400, unique(obj1$id_include)) select = select, infile.header.print = c("SNP", "Allele1", select[is.na(select)] <- 0 "Allele2")) obj1.outfile.bed.noselect.2 <- tempfile() obj2.txt2.select.1 <- read.table(obj2.outfile.txt2.select.1, glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.2) header = TRUE, as.is = TRUE) obj1.bed.noselect.2 <- read.table(obj1.outfile.bed.noselect.2, expect_equal(obj2.txt.select.1, obj2.txt2.select.1) header = TRUE, as.is = TRUE) idx <- sample(nrow(pheno)) expect_equal(obj1.bed.noselect.1, obj1.bed.noselect.2) pheno <- pheno[idx, ] obj1.outfile.bed.select.2 <- tempfile() obj1 <- glmmkin(disease ~ age + sex, data = pheno, kins = kins, glmm.score(obj1, infile = plinkfiles, select = select, outfile = obj1.outfile.bed.select.2) id = "id", family = binomial(link = "logit"), method = "REML", obj1.bed.select.2 <- read.table(obj1.outfile.bed.select.2, method.optim = "AI") header = TRUE, as.is = TRUE) select <- match(1:400, unique(obj1$id_include)) expect_equal(obj1.bed.select.1, obj1.bed.select.2) select[is.na(select)] <- 0 obj1.outfile.bgen.noselect.2 <- tempfile() glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, obj1.outfile.bed.noselect.2 <- tempfile() outfile = obj1.outfile.bgen.noselect.2) glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.2) obj1.bgen.noselect.2 <- read.table(obj1.outfile.bgen.noselect.2, obj1.bed.noselect.2 <- read.table(obj1.outfile.bed.noselect.2, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.bgen.noselect.1, obj1.bgen.noselect.2) expect_equal(obj1.bed.noselect.1, obj1.bed.noselect.2) obj1.outfile.bgen.select.2 <- tempfile() obj1.outfile.bed.select.2 <- tempfile() glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, glmm.score(obj1, infile = plinkfiles, select = select, outfile = obj1.outfile.bed.select.2) select = select, outfile = obj1.outfile.bgen.select.2) obj1.bed.select.2 <- read.table(obj1.outfile.bed.select.2, obj1.bgen.select.2 <- read.table(obj1.outfile.bgen.select.2, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.bed.select.1, obj1.bed.select.2) expect_equal(obj1.bgen.select.1, obj1.bgen.select.2) obj1.outfile.bgen.noselect.2 <- tempfile() if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, quietly = TRUE)) { outfile = obj1.outfile.bgen.noselect.2) obj1.outfile.gds.noselect.2 <- tempfile() obj1.bgen.noselect.2 <- read.table(obj1.outfile.bgen.noselect.2, glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.2) header = TRUE, as.is = TRUE) obj1.gds.noselect.2 <- read.table(obj1.outfile.gds.noselect.2, expect_equal(obj1.bgen.noselect.1, obj1.bgen.noselect.2) header = TRUE, as.is = TRUE) obj1.outfile.bgen.select.2 <- tempfile() expect_equal(obj1.gds.noselect.1, obj1.gds.noselect.2) glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, obj1.outfile.gds.select.2 <- tempfile() select = select, outfile = obj1.outfile.bgen.select.2) glmm.score(obj1, infile = gdsfile, select = select, outfile = obj1.outfile.gds.select.2) obj1.bgen.select.2 <- read.table(obj1.outfile.bgen.select.2, header = TRUE, as.is = TRUE) obj1.gds.select.2 <- read.table(obj1.outfile.gds.select.2, expect_equal(obj1.bgen.select.1, obj1.bgen.select.2) header = TRUE, as.is = TRUE) if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", expect_equal(obj1.gds.select.1, obj1.gds.select.2) quietly = TRUE)) { } obj1.outfile.gds.noselect.2 <- tempfile() obj1.outfile.txt.select.2 <- tempfile() glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.2) glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.2, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj1.gds.noselect.2 <- read.table(obj1.outfile.gds.noselect.2, select = select, infile.header.print = c("SNP", "Allele1", header = TRUE, as.is = TRUE) "Allele2")) expect_equal(obj1.gds.noselect.1, obj1.gds.noselect.2) obj1.txt.select.2 <- read.table(obj1.outfile.txt.select.2, obj1.outfile.gds.select.2 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj1, infile = gdsfile, select = select, outfile = obj1.outfile.gds.select.2) expect_equal(obj1.txt.select.1, obj1.txt.select.2) obj1.gds.select.2 <- read.table(obj1.outfile.gds.select.2, obj1.outfile.txt1.select.2 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj1, infile = txtfile1, outfile = obj1.outfile.txt1.select.2, expect_equal(obj1.gds.select.1, obj1.gds.select.2) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, } select = select, infile.header.print = c("SNP", "Allele1", obj1.outfile.txt.select.2 <- tempfile() "Allele2")) glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.2, obj1.txt1.select.2 <- read.table(obj1.outfile.txt1.select.2, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, header = TRUE, as.is = TRUE) select = select, infile.header.print = c("SNP", "Allele1", expect_equal(obj1.txt1.select.1, obj1.txt1.select.2) "Allele2")) obj1.outfile.txt2.select.2 <- tempfile() obj1.txt.select.2 <- read.table(obj1.outfile.txt.select.2, glmm.score(obj1, infile = txtfile2, outfile = obj1.outfile.txt2.select.2, header = TRUE, as.is = TRUE) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, expect_equal(obj1.txt.select.1, obj1.txt.select.2) select = select, infile.header.print = c("SNP", "Allele1", "Allele2")) obj1.outfile.txt1.select.2 <- tempfile() obj1.txt2.select.2 <- read.table(obj1.outfile.txt2.select.2, glmm.score(obj1, infile = txtfile1, outfile = obj1.outfile.txt1.select.2, header = TRUE, as.is = TRUE) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, expect_equal(obj1.txt2.select.1, obj1.txt2.select.2) select = select, infile.header.print = c("SNP", "Allele1", obj2 <- glmmkin(disease ~ age + sex, data = pheno, kins = NULL, "Allele2")) id = "id", family = binomial(link = "logit"), method = "REML", obj1.txt1.select.2 <- read.table(obj1.outfile.txt1.select.2, method.optim = "AI") header = TRUE, as.is = TRUE) select <- match(1:400, unique(obj2$id_include)) expect_equal(obj1.txt1.select.1, obj1.txt1.select.2) select[is.na(select)] <- 0 obj1.outfile.txt2.select.2 <- tempfile() obj2.outfile.bed.noselect.2 <- tempfile() glmm.score(obj1, infile = txtfile2, outfile = obj1.outfile.txt2.select.2, glmm.score(obj2, infile = plinkfiles, outfile = obj2.outfile.bed.noselect.2) obj2.bed.noselect.2 <- read.table(obj2.outfile.bed.noselect.2, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, header = TRUE, as.is = TRUE) select = select, infile.header.print = c("SNP", "Allele1", expect_equal(obj2.bed.noselect.1, obj2.bed.noselect.2) "Allele2")) obj1.txt2.select.2 <- read.table(obj1.outfile.txt2.select.2, obj2.outfile.bed.select.2 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj2, infile = plinkfiles, select = select, outfile = obj2.outfile.bed.select.2) obj2.bed.select.2 <- read.table(obj2.outfile.bed.select.2, expect_equal(obj1.txt2.select.1, obj1.txt2.select.2) header = TRUE, as.is = TRUE) obj2 <- glmmkin(disease ~ age + sex, data = pheno, kins = NULL, expect_equal(obj2.bed.select.1, obj2.bed.select.2) id = "id", family = binomial(link = "logit"), method = "REML", obj2.outfile.bgen.noselect.2 <- tempfile() method.optim = "AI") select <- match(1:400, unique(obj2$id_include)) glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, select[is.na(select)] <- 0 outfile = obj2.outfile.bgen.noselect.2) obj2.outfile.bed.noselect.2 <- tempfile() obj2.bgen.noselect.2 <- read.table(obj2.outfile.bgen.noselect.2, header = TRUE, as.is = TRUE) expect_equal(obj2.bgen.noselect.1, obj2.bgen.noselect.2) glmm.score(obj2, infile = plinkfiles, outfile = obj2.outfile.bed.noselect.2) obj2.outfile.bgen.select.2 <- tempfile() obj2.bed.noselect.2 <- read.table(obj2.outfile.bed.noselect.2, glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, header = TRUE, as.is = TRUE) select = select, outfile = obj2.outfile.bgen.select.2) expect_equal(obj2.bed.noselect.1, obj2.bed.noselect.2) obj2.outfile.bed.select.2 <- tempfile() obj2.bgen.select.2 <- read.table(obj2.outfile.bgen.select.2, glmm.score(obj2, infile = plinkfiles, select = select, outfile = obj2.outfile.bed.select.2) header = TRUE, as.is = TRUE) obj2.bed.select.2 <- read.table(obj2.outfile.bed.select.2, expect_equal(obj2.bgen.select.1, obj2.bgen.select.2) header = TRUE, as.is = TRUE) if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", expect_equal(obj2.bed.select.1, obj2.bed.select.2) quietly = TRUE)) { obj2.outfile.bgen.noselect.2 <- tempfile() obj2.outfile.gds.noselect.2 <- tempfile() glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, glmm.score(obj2, infile = gdsfile, outfile = obj2.outfile.gds.noselect.2) outfile = obj2.outfile.bgen.noselect.2) obj2.gds.noselect.2 <- read.table(obj2.outfile.gds.noselect.2, obj2.bgen.noselect.2 <- read.table(obj2.outfile.bgen.noselect.2, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj2.gds.noselect.1, obj2.gds.noselect.2) expect_equal(obj2.bgen.noselect.1, obj2.bgen.noselect.2) obj2.outfile.gds.select.2 <- tempfile() obj2.outfile.bgen.select.2 <- tempfile() glmm.score(obj2, infile = gdsfile, select = select, outfile = obj2.outfile.gds.select.2) glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, obj2.gds.select.2 <- read.table(obj2.outfile.gds.select.2, select = select, outfile = obj2.outfile.bgen.select.2) header = TRUE, as.is = TRUE) obj2.bgen.select.2 <- read.table(obj2.outfile.bgen.select.2, expect_equal(obj2.gds.select.1, obj2.gds.select.2) header = TRUE, as.is = TRUE) } expect_equal(obj2.bgen.select.1, obj2.bgen.select.2) obj2.outfile.txt.select.2 <- tempfile() if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", glmm.score(obj2, infile = txtfile, outfile = obj2.outfile.txt.select.2, quietly = TRUE)) { infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj2.outfile.gds.noselect.2 <- tempfile() select = select, infile.header.print = c("SNP", "Allele1", glmm.score(obj2, infile = gdsfile, outfile = obj2.outfile.gds.noselect.2) "Allele2")) obj2.gds.noselect.2 <- read.table(obj2.outfile.gds.noselect.2, obj2.txt.select.2 <- read.table(obj2.outfile.txt.select.2, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj2.gds.noselect.1, obj2.gds.noselect.2) obj2.outfile.gds.select.2 <- tempfile() expect_equal(obj2.txt.select.1, obj2.txt.select.2) glmm.score(obj2, infile = gdsfile, select = select, outfile = obj2.outfile.gds.select.2) obj2.outfile.txt1.select.2 <- tempfile() obj2.gds.select.2 <- read.table(obj2.outfile.gds.select.2, glmm.score(obj2, infile = txtfile1, outfile = obj2.outfile.txt1.select.2, header = TRUE, as.is = TRUE) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, expect_equal(obj2.gds.select.1, obj2.gds.select.2) select = select, infile.header.print = c("SNP", "Allele1", "Allele2")) } obj2.txt1.select.2 <- read.table(obj2.outfile.txt1.select.2, obj2.outfile.txt.select.2 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj2, infile = txtfile, outfile = obj2.outfile.txt.select.2, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, expect_equal(obj2.txt1.select.1, obj2.txt1.select.2) select = select, infile.header.print = c("SNP", "Allele1", obj2.outfile.txt2.select.2 <- tempfile() "Allele2")) glmm.score(obj2, infile = txtfile2, outfile = obj2.outfile.txt2.select.2, obj2.txt.select.2 <- read.table(obj2.outfile.txt.select.2, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, header = TRUE, as.is = TRUE) select = select, infile.header.print = c("SNP", "Allele1", expect_equal(obj2.txt.select.1, obj2.txt.select.2) "Allele2")) obj2.outfile.txt1.select.2 <- tempfile() obj2.txt2.select.2 <- read.table(obj2.outfile.txt2.select.2, header = TRUE, as.is = TRUE) glmm.score(obj2, infile = txtfile1, outfile = obj2.outfile.txt1.select.2, expect_equal(obj2.txt2.select.1, obj2.txt2.select.2) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, idx <- sample(nrow(kins)) select = select, infile.header.print = c("SNP", "Allele1", kins <- kins[idx, idx] "Allele2")) obj1 <- glmmkin(disease ~ age + sex, data = pheno, kins = kins, obj2.txt1.select.2 <- read.table(obj2.outfile.txt1.select.2, id = "id", family = binomial(link = "logit"), method = "REML", header = TRUE, as.is = TRUE) method.optim = "AI") expect_equal(obj2.txt1.select.1, obj2.txt1.select.2) select <- match(1:400, unique(obj1$id_include)) obj2.outfile.txt2.select.2 <- tempfile() select[is.na(select)] <- 0 glmm.score(obj2, infile = txtfile2, outfile = obj2.outfile.txt2.select.2, obj1.outfile.bed.noselect.3 <- tempfile() infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.3) select = select, infile.header.print = c("SNP", "Allele1", obj1.bed.noselect.3 <- read.table(obj1.outfile.bed.noselect.3, "Allele2")) header = TRUE, as.is = TRUE) obj2.txt2.select.2 <- read.table(obj2.outfile.txt2.select.2, expect_equal(obj1.bed.noselect.1, obj1.bed.noselect.3) header = TRUE, as.is = TRUE) obj1.outfile.bed.select.3 <- tempfile() expect_equal(obj2.txt2.select.1, obj2.txt2.select.2) glmm.score(obj1, infile = plinkfiles, select = select, outfile = obj1.outfile.bed.select.3) idx <- sample(nrow(kins)) obj1.bed.select.3 <- read.table(obj1.outfile.bed.select.3, kins <- kins[idx, idx] header = TRUE, as.is = TRUE) obj1 <- glmmkin(disease ~ age + sex, data = pheno, kins = kins, expect_equal(obj1.bed.select.1, obj1.bed.select.3) id = "id", family = binomial(link = "logit"), method = "REML", obj1.outfile.bgen.noselect.3 <- tempfile() method.optim = "AI") glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, select <- match(1:400, unique(obj1$id_include)) outfile = obj1.outfile.bgen.noselect.3) select[is.na(select)] <- 0 obj1.bgen.noselect.3 <- read.table(obj1.outfile.bgen.noselect.3, obj1.outfile.bed.noselect.3 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj1, infile = plinkfiles, outfile = obj1.outfile.bed.noselect.3) expect_equal(obj1.bgen.noselect.1, obj1.bgen.noselect.3) obj1.bed.noselect.3 <- read.table(obj1.outfile.bed.noselect.3, obj1.outfile.bgen.select.3 <- tempfile() header = TRUE, as.is = TRUE) glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, expect_equal(obj1.bed.noselect.1, obj1.bed.noselect.3) select = select, outfile = obj1.outfile.bgen.select.3) obj1.outfile.bed.select.3 <- tempfile() obj1.bgen.select.3 <- read.table(obj1.outfile.bgen.select.3, glmm.score(obj1, infile = plinkfiles, select = select, outfile = obj1.outfile.bed.select.3) header = TRUE, as.is = TRUE) expect_equal(obj1.bgen.select.1, obj1.bgen.select.3) obj1.bed.select.3 <- read.table(obj1.outfile.bed.select.3, if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", header = TRUE, as.is = TRUE) quietly = TRUE)) { expect_equal(obj1.bed.select.1, obj1.bed.select.3) obj1.outfile.gds.noselect.3 <- tempfile() obj1.outfile.bgen.noselect.3 <- tempfile() glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.3) glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, obj1.gds.noselect.3 <- read.table(obj1.outfile.gds.noselect.3, header = TRUE, as.is = TRUE) expect_equal(obj1.gds.noselect.1, obj1.gds.noselect.3) outfile = obj1.outfile.bgen.noselect.3) obj1.outfile.gds.select.3 <- tempfile() obj1.bgen.noselect.3 <- read.table(obj1.outfile.bgen.noselect.3, glmm.score(obj1, infile = gdsfile, select = select, outfile = obj1.outfile.gds.select.3) header = TRUE, as.is = TRUE) obj1.gds.select.3 <- read.table(obj1.outfile.gds.select.3, header = TRUE, as.is = TRUE) expect_equal(obj1.bgen.noselect.1, obj1.bgen.noselect.3) expect_equal(obj1.gds.select.1, obj1.gds.select.3) obj1.outfile.bgen.select.3 <- tempfile() } glmm.score(obj1, infile = bgenfile, BGEN.samplefile = samplefile, obj1.outfile.txt.select.3 <- tempfile() select = select, outfile = obj1.outfile.bgen.select.3) glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.3, obj1.bgen.select.3 <- read.table(obj1.outfile.bgen.select.3, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select = select, infile.header.print = c("SNP", "Allele1", header = TRUE, as.is = TRUE) "Allele2")) expect_equal(obj1.bgen.select.1, obj1.bgen.select.3) obj1.txt.select.3 <- read.table(obj1.outfile.txt.select.3, if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", header = TRUE, as.is = TRUE) quietly = TRUE)) { expect_equal(obj1.txt.select.1, obj1.txt.select.3) obj1.outfile.txt1.select.3 <- tempfile() obj1.outfile.gds.noselect.3 <- tempfile() glmm.score(obj1, infile = txtfile1, outfile = obj1.outfile.txt1.select.3, glmm.score(obj1, infile = gdsfile, outfile = obj1.outfile.gds.noselect.3) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj1.gds.noselect.3 <- read.table(obj1.outfile.gds.noselect.3, select = select, infile.header.print = c("SNP", "Allele1", header = TRUE, as.is = TRUE) "Allele2")) expect_equal(obj1.gds.noselect.1, obj1.gds.noselect.3) obj1.outfile.gds.select.3 <- tempfile() obj1.txt1.select.3 <- read.table(obj1.outfile.txt1.select.3, glmm.score(obj1, infile = gdsfile, select = select, outfile = obj1.outfile.gds.select.3) header = TRUE, as.is = TRUE) obj1.gds.select.3 <- read.table(obj1.outfile.gds.select.3, expect_equal(obj1.txt1.select.1, obj1.txt1.select.3) header = TRUE, as.is = TRUE) obj1.outfile.txt2.select.3 <- tempfile() expect_equal(obj1.gds.select.1, obj1.gds.select.3) glmm.score(obj1, infile = txtfile2, outfile = obj1.outfile.txt2.select.3, } infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj1.outfile.txt.select.3 <- tempfile() select = select, infile.header.print = c("SNP", "Allele1", glmm.score(obj1, infile = txtfile, outfile = obj1.outfile.txt.select.3, "Allele2")) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj1.txt2.select.3 <- read.table(obj1.outfile.txt2.select.3, select = select, infile.header.print = c("SNP", "Allele1", header = TRUE, as.is = TRUE) "Allele2")) expect_equal(obj1.txt2.select.1, obj1.txt2.select.3) obj1.txt.select.3 <- read.table(obj1.outfile.txt.select.3, obj2 <- glmmkin(disease ~ age + sex, data = pheno, kins = NULL, header = TRUE, as.is = TRUE) id = "id", family = binomial(link = "logit"), method = "REML", expect_equal(obj1.txt.select.1, obj1.txt.select.3) obj1.outfile.txt1.select.3 <- tempfile() method.optim = "AI") glmm.score(obj1, infile = txtfile1, outfile = obj1.outfile.txt1.select.3, select <- match(1:400, unique(obj2$id_include)) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select[is.na(select)] <- 0 select = select, infile.header.print = c("SNP", "Allele1", obj2.outfile.bed.noselect.3 <- tempfile() "Allele2")) glmm.score(obj2, infile = plinkfiles, outfile = obj2.outfile.bed.noselect.3) obj1.txt1.select.3 <- read.table(obj1.outfile.txt1.select.3, obj2.bed.noselect.3 <- read.table(obj2.outfile.bed.noselect.3, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj1.txt1.select.1, obj1.txt1.select.3) expect_equal(obj2.bed.noselect.1, obj2.bed.noselect.3) obj1.outfile.txt2.select.3 <- tempfile() glmm.score(obj1, infile = txtfile2, outfile = obj1.outfile.txt2.select.3, obj2.outfile.bed.select.3 <- tempfile() glmm.score(obj2, infile = plinkfiles, select = select, outfile = obj2.outfile.bed.select.3) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select = select, infile.header.print = c("SNP", "Allele1", obj2.bed.select.3 <- read.table(obj2.outfile.bed.select.3, "Allele2")) header = TRUE, as.is = TRUE) obj1.txt2.select.3 <- read.table(obj1.outfile.txt2.select.3, header = TRUE, as.is = TRUE) expect_equal(obj2.bed.select.1, obj2.bed.select.3) expect_equal(obj1.txt2.select.1, obj1.txt2.select.3) obj2.outfile.bgen.noselect.3 <- tempfile() obj2 <- glmmkin(disease ~ age + sex, data = pheno, kins = NULL, glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, id = "id", family = binomial(link = "logit"), method = "REML", outfile = obj2.outfile.bgen.noselect.3) method.optim = "AI") obj2.bgen.noselect.3 <- read.table(obj2.outfile.bgen.noselect.3, select <- match(1:400, unique(obj2$id_include)) header = TRUE, as.is = TRUE) select[is.na(select)] <- 0 expect_equal(obj2.bgen.noselect.1, obj2.bgen.noselect.3) obj2.outfile.bed.noselect.3 <- tempfile() obj2.outfile.bgen.select.3 <- tempfile() glmm.score(obj2, infile = plinkfiles, outfile = obj2.outfile.bed.noselect.3) glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, obj2.bed.noselect.3 <- read.table(obj2.outfile.bed.noselect.3, select = select, outfile = obj2.outfile.bgen.select.3) header = TRUE, as.is = TRUE) obj2.bgen.select.3 <- read.table(obj2.outfile.bgen.select.3, expect_equal(obj2.bed.noselect.1, obj2.bed.noselect.3) header = TRUE, as.is = TRUE) obj2.outfile.bed.select.3 <- tempfile() expect_equal(obj2.bgen.select.1, obj2.bgen.select.3) glmm.score(obj2, infile = plinkfiles, select = select, outfile = obj2.outfile.bed.select.3) if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", obj2.bed.select.3 <- read.table(obj2.outfile.bed.select.3, quietly = TRUE)) { header = TRUE, as.is = TRUE) obj2.outfile.gds.noselect.3 <- tempfile() expect_equal(obj2.bed.select.1, obj2.bed.select.3) glmm.score(obj2, infile = gdsfile, outfile = obj2.outfile.gds.noselect.3) obj2.outfile.bgen.noselect.3 <- tempfile() obj2.gds.noselect.3 <- read.table(obj2.outfile.gds.noselect.3, header = TRUE, as.is = TRUE) glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, expect_equal(obj2.gds.noselect.1, obj2.gds.noselect.3) outfile = obj2.outfile.bgen.noselect.3) obj2.outfile.gds.select.3 <- tempfile() obj2.bgen.noselect.3 <- read.table(obj2.outfile.bgen.noselect.3, glmm.score(obj2, infile = gdsfile, select = select, outfile = obj2.outfile.gds.select.3) header = TRUE, as.is = TRUE) obj2.gds.select.3 <- read.table(obj2.outfile.gds.select.3, expect_equal(obj2.bgen.noselect.1, obj2.bgen.noselect.3) header = TRUE, as.is = TRUE) obj2.outfile.bgen.select.3 <- tempfile() expect_equal(obj2.gds.select.1, obj2.gds.select.3) glmm.score(obj2, infile = bgenfile, BGEN.samplefile = samplefile, } select = select, outfile = obj2.outfile.bgen.select.3) obj2.outfile.txt.select.3 <- tempfile() glmm.score(obj2, infile = txtfile, outfile = obj2.outfile.txt.select.3, obj2.bgen.select.3 <- read.table(obj2.outfile.bgen.select.3, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, header = TRUE, as.is = TRUE) select = select, infile.header.print = c("SNP", "Allele1", expect_equal(obj2.bgen.select.1, obj2.bgen.select.3) "Allele2")) if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", obj2.txt.select.3 <- read.table(obj2.outfile.txt.select.3, quietly = TRUE)) { header = TRUE, as.is = TRUE) obj2.outfile.gds.noselect.3 <- tempfile() expect_equal(obj2.txt.select.1, obj2.txt.select.3) glmm.score(obj2, infile = gdsfile, outfile = obj2.outfile.gds.noselect.3) obj2.outfile.txt1.select.3 <- tempfile() obj2.gds.noselect.3 <- read.table(obj2.outfile.gds.noselect.3, glmm.score(obj2, infile = txtfile1, outfile = obj2.outfile.txt1.select.3, header = TRUE, as.is = TRUE) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, expect_equal(obj2.gds.noselect.1, obj2.gds.noselect.3) select = select, infile.header.print = c("SNP", "Allele1", obj2.outfile.gds.select.3 <- tempfile() "Allele2")) glmm.score(obj2, infile = gdsfile, select = select, outfile = obj2.outfile.gds.select.3) obj2.txt1.select.3 <- read.table(obj2.outfile.txt1.select.3, obj2.gds.select.3 <- read.table(obj2.outfile.gds.select.3, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj2.txt1.select.1, obj2.txt1.select.3) obj2.outfile.txt2.select.3 <- tempfile() expect_equal(obj2.gds.select.1, obj2.gds.select.3) glmm.score(obj2, infile = txtfile2, outfile = obj2.outfile.txt2.select.3, } obj2.outfile.txt.select.3 <- tempfile() infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, glmm.score(obj2, infile = txtfile, outfile = obj2.outfile.txt.select.3, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, select = select, infile.header.print = c("SNP", "Allele1", select = select, infile.header.print = c("SNP", "Allele1", "Allele2")) "Allele2")) obj2.txt2.select.3 <- read.table(obj2.outfile.txt2.select.3, obj2.txt.select.3 <- read.table(obj2.outfile.txt.select.3, header = TRUE, as.is = TRUE) header = TRUE, as.is = TRUE) expect_equal(obj2.txt2.select.1, obj2.txt2.select.3) expect_equal(obj2.txt.select.1, obj2.txt.select.3) unlink(c(obj2.outfile.bed.noselect.1, obj2.outfile.bed.select.1, obj2.outfile.txt1.select.3 <- tempfile() obj2.outfile.bgen.noselect.1, obj2.outfile.bgen.select.1, glmm.score(obj2, infile = txtfile1, outfile = obj2.outfile.txt1.select.3, obj2.outfile.txt.select.1, obj2.outfile.txt1.select.1, infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, obj2.outfile.txt2.select.1)) select = select, infile.header.print = c("SNP", "Allele1", unlink(c(obj1.outfile.bed.noselect.2, obj1.outfile.bed.select.2, "Allele2")) obj1.outfile.bgen.noselect.2, obj1.outfile.bgen.select.2, obj2.txt1.select.3 <- read.table(obj2.outfile.txt1.select.3, obj1.outfile.txt.select.2, obj1.outfile.txt1.select.2, header = TRUE, as.is = TRUE) obj1.outfile.txt2.select.2)) expect_equal(obj2.txt1.select.1, obj2.txt1.select.3) unlink(c(obj2.outfile.bed.noselect.2, obj2.outfile.bed.select.2, obj2.outfile.txt2.select.3 <- tempfile() obj2.outfile.bgen.noselect.2, obj2.outfile.bgen.select.2, glmm.score(obj2, infile = txtfile2, outfile = obj2.outfile.txt2.select.3, obj2.outfile.txt.select.2, obj2.outfile.txt1.select.2, obj2.outfile.txt2.select.2)) infile.nrow.skip = 5, infile.ncol.skip = 3, infile.ncol.print = 1:3, unlink(c(obj1.outfile.bed.noselect.3, obj1.outfile.bed.select.3, obj1.outfile.bgen.noselect.3, obj1.outfile.bgen.select.3, select = select, infile.header.print = c("SNP", "Allele1", obj1.outfile.txt.select.3, obj1.outfile.txt1.select.3, "Allele2")) obj1.outfile.txt2.select.3)) obj2.txt2.select.3 <- read.table(obj2.outfile.txt2.select.3, unlink(c(obj2.outfile.bed.noselect.3, obj2.outfile.bed.select.3, header = TRUE, as.is = TRUE) obj2.outfile.bgen.noselect.3, obj2.outfile.bgen.select.3, expect_equal(obj2.txt2.select.1, obj2.txt2.select.3) obj2.outfile.txt.select.3, obj2.outfile.txt1.select.3, unlink(c(obj2.outfile.bed.noselect.1, obj2.outfile.bed.select.1, obj2.outfile.txt2.select.3)) obj2.outfile.bgen.noselect.1, obj2.outfile.bgen.select.1, if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", obj2.outfile.txt.select.1, obj2.outfile.txt1.select.1, quietly = TRUE)) obj2.outfile.txt2.select.1)) unlink(c(obj2.outfile.gds.noselect.1, obj2.outfile.gds.select.1, unlink(c(obj1.outfile.bed.noselect.2, obj1.outfile.bed.select.2, obj1.outfile.gds.noselect.2, obj1.outfile.gds.select.2, obj1.outfile.bgen.noselect.2, obj1.outfile.bgen.select.2, obj2.outfile.gds.noselect.2, obj2.outfile.gds.select.2, obj1.outfile.txt.select.2, obj1.outfile.txt1.select.2, obj1.outfile.gds.noselect.3, obj1.outfile.gds.select.3, obj1.outfile.txt2.select.2)) obj2.outfile.gds.noselect.3, obj2.outfile.gds.select.3)) unlink(c(obj2.outfile.bed.noselect.2, obj2.outfile.bed.select.2, }) obj2.outfile.bgen.noselect.2, obj2.outfile.bgen.select.2,
obj2.outfile.txt.select.2, obj2.outfile.txt1.select.2, 33: obj2.outfile.txt2.select.2))eval(code, test_env) unlink(c(obj1.outfile.bed.noselect.3, obj1.outfile.bed.select.3,
obj1.outfile.bgen.noselect.3, obj1.outfile.bgen.select.3, 34: obj1.outfile.txt.select.3, obj1.outfile.txt1.select.3, eval(code, test_env) obj1.outfile.txt2.select.3))
unlink(c(obj2.outfile.bed.noselect.3, obj2.outfile.bed.select.3, 35: obj2.outfile.bgen.noselect.3, obj2.outfile.bgen.select.3, withCallingHandlers({ obj2.outfile.txt.select.3, obj2.outfile.txt1.select.3, eval(code, test_env) obj2.outfile.txt2.select.3)) if (requireNamespace("SeqArray", quietly = TRUE) && requireNamespace("SeqVarTools", new_expectations <- the$test_expectations > starting_expectations quietly = TRUE)) if (snapshot_skipped) { unlink(c(obj2.outfile.gds.noselect.1, obj2.outfile.gds.select.1, skip("On CRAN") obj1.outfile.gds.noselect.2, obj1.outfile.gds.select.2, } obj2.outfile.gds.noselect.2, obj2.outfile.gds.select.2, else if (!new_expectations && skip_on_empty) { obj1.outfile.gds.noselect.3, obj1.outfile.gds.select.3, skip_empty() obj2.outfile.gds.noselect.3, obj2.outfile.gds.select.3)) }})}, expectation = handle_expectation, packageNotFoundError = function(e) {
if (on_cran()) {33: skip(paste0("{", e$package, "} is not installed."))eval(code, test_env) }
}, snapshot_on_cran = function(cnd) {34: snapshot_skipped <<- TRUEeval(code, test_env) invokeRestart("muffle_cran_snapshot")
}, skip = handle_skip, warning = handle_warning, message = handle_message, 35: error = handle_error, interrupt = handle_interrupt)withCallingHandlers({
eval(code, test_env)36: new_expectations <- the$test_expectations > starting_expectationsdoTryCatch(return(expr), name, parentenv, handler) if (snapshot_skipped) {
skip("On CRAN")37: } else if (!new_expectations && skip_on_empty) { skip_empty()tryCatchOne(expr, names, parentenv, handlers[[1L]]) }}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) {
skip(paste0("{", e$package, "} is not installed."))38: }}, snapshot_on_cran = function(cnd) {tryCatchList(expr, classes, parentenv, handlers) snapshot_skipped <<- TRUE
invokeRestart("muffle_cran_snapshot")39: }, skip = handle_skip, warning = handle_warning, message = handle_message, tryCatch(withCallingHandlers({ error = handle_error, interrupt = handle_interrupt) eval(code, test_env)
new_expectations <- the$test_expectations > starting_expectations36: if (snapshot_skipped) {doTryCatch(return(expr), name, parentenv, handler)
skip("On CRAN")37: }tryCatchOne(expr, names, parentenv, handlers[[1L]]) else if (!new_expectations && skip_on_empty) {
38: tryCatchList(expr, classes, parentenv, handlers) skip_empty()
}39: tryCatch(withCallingHandlers({}, expectation = handle_expectation, packageNotFoundError = function(e) { if (on_cran()) { eval(code, test_env) skip(paste0("{", e$package, "} is not installed.")) new_expectations <- the$test_expectations > starting_expectations } if (snapshot_skipped) {}, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot") skip("On CRAN") }}, skip = handle_skip, warning = handle_warning, message = handle_message, else if (!new_expectations && skip_on_empty) { error = handle_error, interrupt = handle_interrupt), error = handle_fatal) skip_empty()
}40: }, expectation = handle_expectation, packageNotFoundError = function(e) {doWithOneRestart(return(expr), restart)
if (on_cran()) {41: skip(paste0("{", e$package, "} is not installed."))withOneRestart(expr, restarts[[1L]]) }
}, snapshot_on_cran = function(cnd) {42: snapshot_skipped <<- TRUEwithRestarts(tryCatch(withCallingHandlers({ invokeRestart("muffle_cran_snapshot") eval(code, test_env) new_expectations <- the$test_expectations > starting_expectations}, skip = handle_skip, warning = handle_warning, message = handle_message, if (snapshot_skipped) { error = handle_error, interrupt = handle_interrupt), error = handle_fatal) skip("On CRAN")
} else if (!new_expectations && skip_on_empty) {40: skip_empty()doWithOneRestart(return(expr), restart) }
}, expectation = handle_expectation, packageNotFoundError = function(e) {41: if (on_cran()) {withOneRestart(expr, restarts[[1L]]) skip(paste0("{", e$package, "} is not installed.")) }
}, snapshot_on_cran = function(cnd) {42: snapshot_skipped <<- TRUE invokeRestart("muffle_cran_snapshot")withRestarts(tryCatch(withCallingHandlers({ eval(code, test_env)}, skip = handle_skip, warning = handle_warning, message = handle_message, new_expectations <- the$test_expectations > starting_expectations error = handle_error, interrupt = handle_interrupt), error = handle_fatal), if (snapshot_skipped) { end_test = function() { skip("On CRAN") })
}43: test_code(code = exprs, env = env, reporter = get_reporter() %||% else if (!new_expectations && skip_on_empty) { StopReporter$new()) skip_empty()
}44: }, expectation = handle_expectation, packageNotFoundError = function(e) {source_file(path, env = env(env), desc = desc, shuffle = shuffle, if (on_cran()) { error_call = error_call) skip(paste0("{", e$package, "} is not installed."))
}45: }, snapshot_on_cran = function(cnd) { snapshot_skipped <<- TRUEFUN(X[[i]], ...) invokeRestart("muffle_cran_snapshot")
}, skip = handle_skip, warning = handle_warning, message = handle_message, 46: error = handle_error, interrupt = handle_interrupt), error = handle_fatal), lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle, end_test = function() { error_call = error_call) })
47: doTryCatch(return(expr), name, parentenv, handler)43:
test_code(code = exprs, env = env, reporter = get_reporter() %||% 48: StopReporter$new())tryCatchOne(expr, names, parentenv, handlers[[1L]])
44: 49: source_file(path, env = env(env), desc = desc, shuffle = shuffle, tryCatchList(expr, classes, parentenv, handlers) error_call = error_call)
50: 45: tryCatch(code, testthat_abort_reporter = function(cnd) {FUN(X[[i]], ...) cat(conditionMessage(cnd), "\n")
NULL46: })lapply(test_paths, test_one_file, env = env, desc = desc, shuffle = shuffle,
error_call = error_call)51:
with_reporter(reporters$multi, lapply(test_paths, test_one_file, 47: env = env, desc = desc, shuffle = shuffle, error_call = error_call))doTryCatch(return(expr), name, parentenv, handler)
52: 48: test_files_serial(test_dir = test_dir, test_package = test_package, tryCatchOne(expr, names, parentenv, handlers[[1L]]) test_paths = test_paths, load_helpers = load_helpers, reporter = reporter,
env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, 49: desc = desc, load_package = load_package, shuffle = shuffle, tryCatchList(expr, classes, parentenv, handlers) error_call = error_call)
53: 50: test_files(test_dir = path, test_paths = test_paths, test_package = package, tryCatch(code, testthat_abort_reporter = function(cnd) { reporter = reporter, load_helpers = load_helpers, env = env, cat(conditionMessage(cnd), "\n") stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, NULL load_package = load_package, parallel = parallel, shuffle = shuffle)})
54:
51: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")with_reporter(reporters$multi, lapply(test_paths, test_one_file,
env = env, desc = desc, shuffle = shuffle, error_call = error_call))55:
test_check("GMMAT")52:
test_files_serial(test_dir = test_dir, test_package = test_package, An irrecoverable exception occurred. R is aborting now ...
test_paths = test_paths, load_helpers = load_helpers, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, desc = desc, load_package = load_package, shuffle = shuffle, error_call = error_call)
53: test_files(test_dir = path, test_paths = test_paths, test_package = package, reporter = reporter, load_helpers = load_helpers, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, load_package = load_package, parallel = parallel, shuffle = shuffle)
54: test_dir("testthat", package = package, reporter = reporter, ..., load_package = "installed")
55: test_check("GMMAT")
An irrecoverable exception occurred. R is aborting now ...
Saving _problems/test_glmm.score-37.R
The following SNPs have been removed due to inconsistent alleles across studies:
[1] "L10" "L12" "L15"
[ FAIL 1 | WARN 2 | SKIP 30 | PASS 3 ]
══ Skipped tests (30) ══════════════════════════════════════════════════════════
• On CRAN (28): 'test_SMMAT.R:56:2', 'test_SMMAT.R:103:2',
'test_SMMAT.R:149:2', 'test_SMMAT.R:196:2', 'test_SMMAT.R:236:2',
'test_SMMAT.R:276:2', 'test_SMMAT.meta.R:45:2', 'test_SMMAT.meta.R:77:2',
'test_SMMAT.meta.R:108:2', 'test_SMMAT.meta.R:140:2',
'test_SMMAT.meta.R:165:2', 'test_glmm.score.R:317:2',
'test_glmm.score.R:616:2', 'test_glmm.score.R:914:2',
'test_glmm.score.R:1213:2', 'test_glmm.score.R:1505:2',
'test_glmm.score.R:1797:2', 'test_glmm.wald.R:2:2', 'test_glmm.wald.R:805:2',
'test_glmm.wald.R:1609:2', 'test_glmm.wald.R:1761:2', 'test_glmmkin.R:2:2',
'test_glmmkin.R:82:2', 'test_glmmkin.R:163:2', 'test_glmmkin.R:245:2',
'test_glmmkin.R:328:2', 'test_glmmkin.R:362:2', 'test_glmmkin.R:396:2'
• {SeqArray} is not installed (2): 'test_SMMAT.R:2:9', 'test_SMMAT.meta.R:2:2'
══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test_glmm.score.R:37:2'): cross-sectional id le 400 binomial ────────
Error in `file(outfile, "w")`: cannot open the connection
Backtrace:
▆
1. └─GMMAT::glmm.score(...) at test_glmm.score.R:37:9
2. └─base::file(outfile, "w")
[ FAIL 1 | WARN 2 | SKIP 30 | PASS 3 ]
Error:
! Test failures.
Execution halted
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [62s/52s] OK
- checking PDF version of manual ... [4s/4s] OK
- DONE
Status: 1 ERROR