CRAN Package Check Results for Package seqtrie

Last updated on 2026-08-02 12:52:17 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.4.0 119.93 183.46 303.39 OK
r-devel-linux-x86_64-debian-gcc 0.4.0 112.63 126.97 239.60 NOTE
r-devel-linux-x86_64-fedora-clang 0.4.0 139.00 285.01 424.01 OK
r-devel-linux-x86_64-fedora-gcc 0.4.0 119.00 124.56 243.56 OK
r-devel-windows-x86_64 0.4.0 139.00 194.00 333.00 OK
r-patched-linux-x86_64 0.4.0 147.58 175.83 323.41 OK
r-release-linux-x86_64 0.4.0 148.62 166.93 315.55 OK
r-release-macos-arm64 0.4.0 30.00 39.00 69.00 OK
r-release-macos-x86_64 0.4.0 79.00 185.00 264.00 OK
r-release-windows-x86_64 0.4.0 139.00 197.00 336.00 OK
r-oldrel-macos-arm64 0.4.0 24.00 47.00 71.00 OK
r-oldrel-macos-x86_64 0.4.0 84.00 140.00 224.00 ERROR
r-oldrel-windows-x86_64 0.4.0 168.00 251.00 419.00 OK

Check Details

Version: 0.4.0
Check: for new files in some other directories
Result: NOTE Found the following files/directories: ‘~/tmp/scratch/Rtmp0R54tb’ ‘~/tmp/scratch/Rtmp0ZD6FO’ ‘~/tmp/scratch/Rtmp1BcUDh’ ‘~/tmp/scratch/Rtmp1VnuXw’ ‘~/tmp/scratch/Rtmp21eBDB’ ‘~/tmp/scratch/Rtmp2EaLnR’ ‘~/tmp/scratch/Rtmp2QEhql’ ‘~/tmp/scratch/Rtmp2WYNqD’ ‘~/tmp/scratch/Rtmp4HVuZn’ ‘~/tmp/scratch/Rtmp4Zhtsk’ ‘~/tmp/scratch/Rtmp4bud9f’ ‘~/tmp/scratch/Rtmp4l3S4e’ ‘~/tmp/scratch/Rtmp5BaQdv’ ‘~/tmp/scratch/Rtmp5OevvH’ ‘~/tmp/scratch/Rtmp74j8sP’ ‘~/tmp/scratch/Rtmp7DkhyU’ ‘~/tmp/scratch/Rtmp7Ezvkv’ ‘~/tmp/scratch/Rtmp7JGiVq’ ‘~/tmp/scratch/Rtmp7mBliV’ ‘~/tmp/scratch/Rtmp8Cu62p’ ‘~/tmp/scratch/Rtmp8XGFjb’ ‘~/tmp/scratch/Rtmp8nxzcn’ ‘~/tmp/scratch/Rtmp8wdwoH’ ‘~/tmp/scratch/Rtmp8zMmkh’ ‘~/tmp/scratch/Rtmp96XNrO’ ‘~/tmp/scratch/Rtmp9Aakt9’ ‘~/tmp/scratch/Rtmp9Jkp2l’ ‘~/tmp/scratch/RtmpA9FTIr’ ‘~/tmp/scratch/RtmpAakpMb’ ‘~/tmp/scratch/RtmpAwLgFW’ ‘~/tmp/scratch/RtmpBF6gLH’ ‘~/tmp/scratch/RtmpBTY4x6’ ‘~/tmp/scratch/RtmpBW1PIk’ ‘~/tmp/scratch/RtmpBfIz99’ ‘~/tmp/scratch/RtmpBiS2nw’ ‘~/tmp/scratch/RtmpBw4aJH’ ‘~/tmp/scratch/RtmpBwXTbS’ ‘~/tmp/scratch/RtmpCFg3m7’ ‘~/tmp/scratch/RtmpCJBwtx’ ‘~/tmp/scratch/RtmpDMIrTf’ ‘~/tmp/scratch/RtmpDX0ZHz’ ‘~/tmp/scratch/RtmpDzBJ54’ ‘~/tmp/scratch/RtmpEMXmtU’ ‘~/tmp/scratch/RtmpEdioTp’ ‘~/tmp/scratch/RtmpEiBZ6O’ ‘~/tmp/scratch/RtmpEtzQdg’ ‘~/tmp/scratch/RtmpFmJdP8’ ‘~/tmp/scratch/RtmpFmUylB’ ‘~/tmp/scratch/RtmpFqGivq’ ‘~/tmp/scratch/RtmpFu6K9l’ ‘~/tmp/scratch/RtmpGibJa3’ ‘~/tmp/scratch/RtmpGp6FK6’ ‘~/tmp/scratch/RtmpH0qhv8’ ‘~/tmp/scratch/RtmpH5WbHP’ ‘~/tmp/scratch/RtmpHl30KF’ ‘~/tmp/scratch/RtmpIE3OpM’ ‘~/tmp/scratch/RtmpIJcHY0’ ‘~/tmp/scratch/RtmpIdlaFk’ ‘~/tmp/scratch/RtmpJa1J2N’ ‘~/tmp/scratch/RtmpJmBn3K’ ‘~/tmp/scratch/RtmpK7rzVC’ ‘~/tmp/scratch/RtmpKZaG08’ ‘~/tmp/scratch/RtmpKm5EaG’ ‘~/tmp/scratch/RtmpKoeklh’ ‘~/tmp/scratch/RtmpL2AYrz’ ‘~/tmp/scratch/RtmpLVdHJc’ ‘~/tmp/scratch/RtmpLhavya’ ‘~/tmp/scratch/RtmpMt5mY8’ ‘~/tmp/scratch/RtmpN9pKrm’ ‘~/tmp/scratch/RtmpNKXBSx’ ‘~/tmp/scratch/RtmpNeReUj’ ‘~/tmp/scratch/RtmpNqLNJ2’ ‘~/tmp/scratch/RtmpNrzvp7’ ‘~/tmp/scratch/RtmpOvlqM2’ ‘~/tmp/scratch/RtmpP3HaZE’ ‘~/tmp/scratch/RtmpPeM271’ ‘~/tmp/scratch/RtmpPyqJeO’ ‘~/tmp/scratch/RtmpQWUp7j’ ‘~/tmp/scratch/RtmpRGxMIW’ ‘~/tmp/scratch/RtmpSmFa5g’ ‘~/tmp/scratch/RtmpT3zif6’ ‘~/tmp/scratch/RtmpTAJ8Hy’ ‘~/tmp/scratch/RtmpTRy3oU’ ‘~/tmp/scratch/RtmpTmVFBh’ ‘~/tmp/scratch/RtmpUGODzo’ ‘~/tmp/scratch/RtmpUQYtX4’ ‘~/tmp/scratch/RtmpUkYoUI’ ‘~/tmp/scratch/RtmpUu5iVH’ ‘~/tmp/scratch/RtmpW0vYfl’ ‘~/tmp/scratch/RtmpWTyJ5a’ ‘~/tmp/scratch/RtmpX3HmHw’ ‘~/tmp/scratch/RtmpXrHd6y’ ‘~/tmp/scratch/RtmpY8xKDE’ ‘~/tmp/scratch/RtmpYf8ETT’ ‘~/tmp/scratch/RtmpYgiTzh’ ‘~/tmp/scratch/RtmpYoXf6W’ ‘~/tmp/scratch/RtmpYuQLRo’ ‘~/tmp/scratch/RtmpZfsFRZ’ ‘~/tmp/scratch/RtmpaTWVUi’ ‘~/tmp/scratch/RtmpaVsQ1h’ ‘~/tmp/scratch/RtmpakhzsF’ ‘~/tmp/scratch/RtmpbIkHER’ ‘~/tmp/scratch/RtmpbPoXKY’ ‘~/tmp/scratch/Rtmpc15La6’ ‘~/tmp/scratch/RtmpcuY7cP’ ‘~/tmp/scratch/Rtmpd7f3oi’ ‘~/tmp/scratch/RtmpdCm8br’ ‘~/tmp/scratch/RtmpdNUN15’ ‘~/tmp/scratch/RtmpdSrrmE’ ‘~/tmp/scratch/RtmpdSvBin’ ‘~/tmp/scratch/RtmpdrArIt’ ‘~/tmp/scratch/Rtmpe8X7sd’ ‘~/tmp/scratch/RtmpeHPaL2’ ‘~/tmp/scratch/RtmpeyMTzt’ ‘~/tmp/scratch/RtmpfEX4jX’ ‘~/tmp/scratch/RtmpfNQeB9’ ‘~/tmp/scratch/RtmpfPjIX6’ ‘~/tmp/scratch/Rtmpgafp1c’ ‘~/tmp/scratch/RtmpguobX6’ ‘~/tmp/scratch/Rtmpgxewwd’ ‘~/tmp/scratch/Rtmpix2x6g’ ‘~/tmp/scratch/Rtmpjaf5sW’ ‘~/tmp/scratch/RtmpkGba9i’ ‘~/tmp/scratch/RtmpkMXhFB’ ‘~/tmp/scratch/RtmpkaD7mc’ ‘~/tmp/scratch/Rtmpklkqa6’ ‘~/tmp/scratch/RtmplBnKca’ ‘~/tmp/scratch/RtmplKypR9’ ‘~/tmp/scratch/RtmplXvLh1’ ‘~/tmp/scratch/RtmplsKAfg’ ‘~/tmp/scratch/RtmplyQ5Gz’ ‘~/tmp/scratch/RtmpmGTRGP’ ‘~/tmp/scratch/RtmpmWtZoe’ ‘~/tmp/scratch/RtmpmkQ4UO’ ‘~/tmp/scratch/RtmpmprlUY’ ‘~/tmp/scratch/RtmpmtQkEb’ ‘~/tmp/scratch/RtmpoVvy9V’ ‘~/tmp/scratch/Rtmpos89za’ ‘~/tmp/scratch/RtmpqL8tBU’ ‘~/tmp/scratch/RtmpqOHrhN’ ‘~/tmp/scratch/RtmpqXYDsx’ ‘~/tmp/scratch/Rtmpr74ud8’ ‘~/tmp/scratch/RtmprS413h’ ‘~/tmp/scratch/Rtmprkqd0j’ ‘~/tmp/scratch/RtmpruTILd’ ‘~/tmp/scratch/RtmpsIFydg’ ‘~/tmp/scratch/Rtmpsf66cP’ ‘~/tmp/scratch/Rtmpsw8dSU’ ‘~/tmp/scratch/Rtmpt91msE’ ‘~/tmp/scratch/RtmptGhZVU’ ‘~/tmp/scratch/RtmpuhyuID’ ‘~/tmp/scratch/RtmpuwzMxe’ ‘~/tmp/scratch/RtmpvFrUqX’ ‘~/tmp/scratch/RtmpvIiy6L’ ‘~/tmp/scratch/Rtmpvfnbn0’ ‘~/tmp/scratch/Rtmpvi3rAC’ ‘~/tmp/scratch/RtmpvqzR1e’ ‘~/tmp/scratch/RtmpvsM8lw’ ‘~/tmp/scratch/RtmpvwpNK3’ ‘~/tmp/scratch/RtmpwWIuYs’ ‘~/tmp/scratch/RtmpwXdoNT’ ‘~/tmp/scratch/RtmpwhtYjx’ ‘~/tmp/scratch/RtmpxhhYRd’ ‘~/tmp/scratch/RtmpxkBWpW’ ‘~/tmp/scratch/Rtmpxo1zn7’ ‘~/tmp/scratch/RtmpxzCwk9’ ‘~/tmp/scratch/Rtmpy6BupJ’ ‘~/tmp/scratch/quarto-session38f28c7bd4e5f5dc’ ‘~/tmp/scratch/xvfb-run.0tWxpW’ ‘~/tmp/scratch/xvfb-run.14UHDl’ ‘~/tmp/scratch/xvfb-run.1yOiDr’ ‘~/tmp/scratch/xvfb-run.3rkD40’ ‘~/tmp/scratch/xvfb-run.50X6mm’ ‘~/tmp/scratch/xvfb-run.59Bi7E’ ‘~/tmp/scratch/xvfb-run.7LfejA’ ‘~/tmp/scratch/xvfb-run.7Y3ndx’ ‘~/tmp/scratch/xvfb-run.7ddH2z’ ‘~/tmp/scratch/xvfb-run.8jSD1n’ ‘~/tmp/scratch/xvfb-run.9ZeRNs’ ‘~/tmp/scratch/xvfb-run.AABGcN’ ‘~/tmp/scratch/xvfb-run.AWQSLW’ ‘~/tmp/scratch/xvfb-run.EURCvZ’ ‘~/tmp/scratch/xvfb-run.ElrXpP’ ‘~/tmp/scratch/xvfb-run.HLNJQS’ ‘~/tmp/scratch/xvfb-run.HoyOqX’ ‘~/tmp/scratch/xvfb-run.IeN3FY’ ‘~/tmp/scratch/xvfb-run.ImT5BI’ ‘~/tmp/scratch/xvfb-run.Lj5LbK’ ‘~/tmp/scratch/xvfb-run.OUhbCQ’ ‘~/tmp/scratch/xvfb-run.OqJtUK’ ‘~/tmp/scratch/xvfb-run.PqY7kA’ ‘~/tmp/scratch/xvfb-run.QaaKdY’ ‘~/tmp/scratch/xvfb-run.RwcQuA’ ‘~/tmp/scratch/xvfb-run.SwLih7’ ‘~/tmp/scratch/xvfb-run.T7IIRF’ ‘~/tmp/scratch/xvfb-run.T8Gq5c’ ‘~/tmp/scratch/xvfb-run.TyUNbs’ ‘~/tmp/scratch/xvfb-run.UBTSNZ’ ‘~/tmp/scratch/xvfb-run.VOUIQt’ ‘~/tmp/scratch/xvfb-run.X6g3CX’ ‘~/tmp/scratch/xvfb-run.ZezLqS’ ‘~/tmp/scratch/xvfb-run.ZjbCp2’ ‘~/tmp/scratch/xvfb-run.a3Tm94’ ‘~/tmp/scratch/xvfb-run.asWr7G’ ‘~/tmp/scratch/xvfb-run.atl4eT’ ‘~/tmp/scratch/xvfb-run.bHTtaK’ ‘~/tmp/scratch/xvfb-run.bU2RGu’ ‘~/tmp/scratch/xvfb-run.cBZjym’ ‘~/tmp/scratch/xvfb-run.dnRfVu’ ‘~/tmp/scratch/xvfb-run.e1ru0R’ ‘~/tmp/scratch/xvfb-run.egShll’ ‘~/tmp/scratch/xvfb-run.gKeQHH’ ‘~/tmp/scratch/xvfb-run.gq46bd’ ‘~/tmp/scratch/xvfb-run.gr3Gi0’ ‘~/tmp/scratch/xvfb-run.gwyyhk’ ‘~/tmp/scratch/xvfb-run.hdVRLf’ ‘~/tmp/scratch/xvfb-run.hqkIIv’ ‘~/tmp/scratch/xvfb-run.iKnyax’ ‘~/tmp/scratch/xvfb-run.mW3V5u’ ‘~/tmp/scratch/xvfb-run.mb5NwN’ ‘~/tmp/scratch/xvfb-run.noLxJr’ ‘~/tmp/scratch/xvfb-run.o0KMe5’ ‘~/tmp/scratch/xvfb-run.p7J7Jw’ ‘~/tmp/scratch/xvfb-run.paZoa8’ ‘~/tmp/scratch/xvfb-run.pn1rl6’ ‘~/tmp/scratch/xvfb-run.qEAXxK’ ‘~/tmp/scratch/xvfb-run.tYVpwz’ ‘~/tmp/scratch/xvfb-run.vqy4dO’ ‘~/tmp/scratch/xvfb-run.wyhVHp’ ‘~/tmp/scratch/xvfb-run.y1koea’ ‘~/tmp/scratch/xvfb-run.zwkyLq’ Flavor: r-devel-linux-x86_64-debian-gcc

Version: 0.4.0
Check: tests
Result: ERROR Running ‘test_RadixForest.R’ [4s/4s] Running ‘test_RadixTree.R’ [11s/11s] Running ‘test_StarTree.R’ [71s/66s] Running ‘test_pairwise.R’ [4s/6s] Running the tests in ‘tests/test_pairwise.R’ failed. Complete output: > # This test file tests the `dist_matrix` and `dist_pairwise` functions > # These two functions are simple dynamic programming algorithms for computing pairwise distances and are themselves used to validate > # the RadixTree imeplementation (see test_radix_tree.R) > > runtime <- Sys.time() > > if(requireNamespace("seqtrie", quietly=TRUE) && + requireNamespace("pwalign", quietly=TRUE) + ) { + library(seqtrie) + library(pwalign) + + # Use 2 threads on github actions and CRAN, 4 threads locally + IS_LOCAL <- Sys.getenv("IS_LOCAL") != "" + NTHREADS <- ifelse(IS_LOCAL, 4, 2) + NITER <- ifelse(IS_LOCAL, 3, 1) + NSEQS <- 2500 + MAXSEQLEN <- 200 + CHARSET <- "ACGT" + + test_seed <- Sys.getenv("SEQTRIE_TEST_SEED") + if (nzchar(test_seed)) { + test_seed <- as.integer(test_seed) + } else { + test_seed <- as.integer(as.numeric(Sys.time())) %% .Machine$integer.max + } + cat("Test seed:", test_seed, "\n") + set.seed(test_seed) + + random_strings <- function(N, charset = "abcdefghijklmnopqrstuvwxyz") { + charset <- unlist(strsplit(charset, "", fixed = TRUE)) + len <- sample(0:MAXSEQLEN, N, replace=TRUE) + vapply(len, function(n) { + paste0(sample(charset, n, replace = TRUE), collapse = "") + }, character(1)) + } + + mutate_strings <- function(x, prob = 0.025, indel_prob = 0.025, charset = "abcdefghijklmnopqrstuvwxyz") { + charset <- unlist(strsplit(charset, "")) + xsplit <- strsplit(x, "") + sapply(xsplit, function(a) { + r <- runif(length(a)) < prob + a[r] <- sample(charset, sum(r), replace=TRUE) + ins <- runif(length(a)) < indel_prob + a[ins] <- paste0(sample(charset, sum(ins), replace=TRUE), sample(charset, sum(ins), replace=TRUE)) + del <- runif(length(a)) < indel_prob + a[del] <- "" + paste0(a, collapse = "") + }) + } + + # subject (target) must be of length 1 or equal to pattern (query) + # To get a distance matrix, iterate over target and perform a column bind + # special_zero_case -- if both query and target are empty, Biostrings fails with an error + pairwiseAlignmentFix <- function(pattern, subject, ...) { + results <- rep(0, length(subject)) + special_zero_case <- nchar(pattern) == 0 & nchar(subject) == 0 + if(all(special_zero_case)) { + results + } else { + results[!special_zero_case] <- pwalign::pairwiseAlignment(pattern=pattern[!special_zero_case], subject=subject[!special_zero_case], ...) + results + } + } + + biostrings_matrix_global <- function(query, target, cost_matrix, gap_cost, gap_open_cost = 0) { + substitutionMatrix <- -cost_matrix + rows <- lapply(query, function(x) { + query2 <- rep(x, length(target)) + -pairwiseAlignmentFix(pattern=query2, subject=target, substitutionMatrix = substitutionMatrix, gapOpening=gap_open_cost, gapExtension=gap_cost, scoreOnly=TRUE, type="global") + }) + do.call(rbind, rows) + } + + biostrings_pairwise_global <- function(query, target, cost_matrix, gap_cost, gap_open_cost = 0) { + substitutionMatrix <- -cost_matrix + -pairwiseAlignment(pattern=query, subject=target, substitutionMatrix = substitutionMatrix,gapOpening=gap_open_cost, gapExtension=gap_cost, scoreOnly=TRUE, type="global") + } + + biostrings_matrix_anchored <- function(query, target, query_size, target_size, cost_matrix, gap_cost, gap_open_cost = 0) { + substitutionMatrix <- -cost_matrix + rows <- lapply(seq_along(query), function(i) { + query2 <- substring(query[i], 1, query_size[i,,drop=TRUE]) + target2 <- substring(target, 1, target_size[i,,drop=TRUE]) + -pairwiseAlignmentFix(pattern=query2, subject=target2, substitutionMatrix = substitutionMatrix, gapOpening=gap_open_cost, gapExtension=gap_cost, scoreOnly=TRUE, type="global") + }) + do.call(rbind, rows) + } + + biostrings_pairwise_anchored <- function(query, target, query_size, target_size, cost_matrix, gap_cost, gap_open_cost = 0) { + substitutionMatrix <- -cost_matrix + query2 <- substring(query, 1, query_size) + target2 <- substring(target, 1, target_size) + -pairwiseAlignmentFix(pattern=query2, subject=target2, substitutionMatrix = substitutionMatrix, gapOpening=gap_open_cost, gapExtension=gap_cost, scoreOnly=TRUE, type="global") + } + + hamming_pairwise <- function(query, target) { + vapply(seq_along(query), function(i) { + if(nchar(query[i]) != nchar(target[i])) return(Inf) + sum(strsplit(query[i], "", fixed = TRUE)[[1]] != strsplit(target[i], "", fixed = TRUE)[[1]]) + }, numeric(1)) + } + + hamming_matrix <- function(query, target) { + rows <- lapply(query, function(q) hamming_pairwise(rep(q, length(target)), target)) + do.call(rbind, rows) + } + + unit_cost_matrix <- function(charset) { + chars <- unlist(strsplit(charset, "", fixed = TRUE)) + cost_matrix <- matrix(1L, nrow = length(chars), ncol = length(chars), dimnames = list(chars, chars)) + diag(cost_matrix) <- 0L + cost_matrix + } + + for(. in 1:NITER) { + + print("Checking hamming search correctness") + local({ + # Note: seqtrie returns `NA_integer_` for hamming distance when the lengths are different. + # This is why we need to replace `NA_integer_` with `Inf` when comparing results + + target <- unique(c(random_strings(NSEQS, CHARSET),"")) + query <- sample(c(sample(target, NSEQS/1000), random_strings(NSEQS/1000, CHARSET))) + query <- unique(c(mutate_strings(query, indel_prob=0, charset = CHARSET), "")) + + # Check matrix results + results_seqtrie <- dist_matrix(query, target, mode = "hamming", nthreads=NTHREADS) + results_seqtrie[is.na(results_seqtrie)] <- Inf + results_hamming <- hamming_matrix(query, target) + stopifnot(all(results_seqtrie == results_hamming)) + + # Check pairwise results + query_pairwise <- mutate_strings(target, prob=0.025, indel_prob=0.05, charset = CHARSET) + results_seqtrie <- dist_pairwise(query_pairwise, target, mode = "hamming", nthreads=NTHREADS) + results_seqtrie[is.na(results_seqtrie)] <- Inf + results_hamming <- hamming_pairwise(query_pairwise, target) + stopifnot(all(results_seqtrie == results_hamming)) + }) + + print("Checking levenshtein search correctness") + local({ + target <- unique(c(random_strings(NSEQS, CHARSET),"")) + query <- sample(c(sample(target, NSEQS/1000), random_strings(NSEQS/1000, CHARSET))) + query <- unique(c(mutate_strings(query, indel_prob=0, charset = CHARSET), "")) + + # Check matrix results + results_seqtrie <- dist_matrix(query, target, mode = "levenshtein", nthreads=NTHREADS) + cost_matrix <- unit_cost_matrix(CHARSET) + results_pwalign <- biostrings_matrix_global(query, target, cost_matrix = cost_matrix, gap_cost = 1L) + stopifnot(all(results_seqtrie == results_pwalign)) + + # Check pairwise results + query_pairwise <- mutate_strings(target, prob=0.025, indel_prob=0.05, charset = CHARSET) + results_seqtrie <- dist_pairwise(query_pairwise, target, mode = "levenshtein", nthreads=NTHREADS) + results_pwalign <- biostrings_pairwise_global(query_pairwise, target, cost_matrix = cost_matrix, gap_cost = 1L) + stopifnot(all(results_seqtrie == results_pwalign)) + }) + + print("Checking anchored search correctness") + local({ + # There is no anchored search in pwalign. To get the same results, we + # substring query and target by the seqtrie anchored endpoints and compare + # the resulting global alignments. + + target <- unique(c(random_strings(NSEQS, CHARSET),"")) + query <- sample(c(sample(target, NSEQS/1000), random_strings(NSEQS/1000, CHARSET))) + query <- unique(c(mutate_strings(query, indel_prob=0, charset = CHARSET), "")) + + # Check matrix results + results_seqtrie <- dist_matrix(query, target, mode = "anchored", nthreads=NTHREADS) + query_size <- attr(results_seqtrie, "query_size") + target_size <- attr(results_seqtrie, "target_size") + cost_matrix <- unit_cost_matrix(CHARSET) + results_pwalign <- biostrings_matrix_anchored(query, target, query_size, target_size, cost_matrix = cost_matrix, gap_cost = 1L) + stopifnot(all(results_seqtrie == results_pwalign)) + + # Check pairwise results + query_pairwise <- mutate_strings(target, prob=0.025, indel_prob=0.05, charset = CHARSET) + results_seqtrie <- dist_pairwise(query_pairwise, target, mode = "anchored", nthreads=NTHREADS) + query_size <- attr(results_seqtrie, "query_size") + target_size <- attr(results_seqtrie, "target_size") + results_pwalign <- biostrings_pairwise_anchored(query_pairwise, target, query_size, target_size, cost_matrix = cost_matrix, gap_cost = 1L) + stopifnot(all(results_seqtrie == results_pwalign)) + }) + + print("Checking global search with linear gap for correctness") + local({ + target <- unique(c(random_strings(NSEQS, CHARSET),"")) + query <- sample(c(sample(target, NSEQS/1000), random_strings(NSEQS/1000, CHARSET))) + query <- unique(c(mutate_strings(query, indel_prob=0, charset = CHARSET), "")) + + # Check matrix results + cost_matrix <- matrix(sample(1:3, size = nchar(CHARSET)^2, replace=TRUE), nrow=nchar(CHARSET)) + diag(cost_matrix) <- 0 + colnames(cost_matrix) <- rownames(cost_matrix) <- strsplit(CHARSET, "")[[1]] + gap_cost <- sample(1:3, size = 1) + results_seqtrie <- dist_matrix(query, target, mode = "levenshtein", cost_matrix = cost_matrix, gap_cost = gap_cost, nthreads=NTHREADS) + results_biostrings <- biostrings_matrix_global(query, target, cost_matrix = cost_matrix, gap_cost = gap_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + + # Check pairwise results + query_pairwise <- mutate_strings(target, prob=0.025, indel_prob=0.05, charset = CHARSET) + results_seqtrie <- dist_pairwise(query_pairwise, target, mode = "levenshtein", cost_matrix = cost_matrix, gap_cost = gap_cost, nthreads=NTHREADS) + results_biostrings <- biostrings_pairwise_global(query_pairwise, target, cost_matrix = cost_matrix, gap_cost = gap_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + }) + + print("Checking anchored search with linear gap for correctness") + local({ + target <- unique(c(random_strings(NSEQS, CHARSET),"")) + query <- sample(c(sample(target, NSEQS/1000), random_strings(NSEQS/1000, CHARSET))) + query <- unique(c(mutate_strings(query, indel_prob=0, charset = CHARSET), "")) + + # Check matrix results + cost_matrix <- matrix(sample(1:3, size = nchar(CHARSET)^2, replace=TRUE), nrow=nchar(CHARSET)) + diag(cost_matrix) <- 0 + colnames(cost_matrix) <- rownames(cost_matrix) <- strsplit(CHARSET, "")[[1]] + gap_cost <- sample(1:3, size = 1) + results_seqtrie <- dist_matrix(query, target, mode = "anchored", cost_matrix = cost_matrix, gap_cost = gap_cost, nthreads=NTHREADS) + query_size <- attr(results_seqtrie, "query_size") + target_size <- attr(results_seqtrie, "target_size") + results_biostrings <- biostrings_matrix_anchored(query, target, query_size, target_size, cost_matrix = cost_matrix, gap_cost = gap_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + + # Check pairwise results + query_pairwise <- mutate_strings(target, prob=0.025, indel_prob=0.05, charset = CHARSET) + results_seqtrie <- dist_pairwise(query_pairwise, target, mode = "anchored", cost_matrix = cost_matrix, gap_cost = gap_cost, nthreads=NTHREADS) + query_size <- attr(results_seqtrie, "query_size") + target_size <- attr(results_seqtrie, "target_size") + results_biostrings <- biostrings_pairwise_anchored(query_pairwise, target, query_size, target_size, cost_matrix = cost_matrix, gap_cost = gap_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + }) + + + + print("Checking global search with affine gap for correctness") + local({ + target <- unique(c(random_strings(NSEQS, CHARSET),"")) + query <- sample(c(sample(target, NSEQS/1000), random_strings(NSEQS/1000, CHARSET))) + query <- unique(c(mutate_strings(query, indel_prob=0, charset = CHARSET), "")) + + # Check matrix results + cost_matrix <- matrix(sample(1:3, size = nchar(CHARSET)^2, replace=TRUE), nrow=nchar(CHARSET)) + diag(cost_matrix) <- 0 + colnames(cost_matrix) <- rownames(cost_matrix) <- strsplit(CHARSET, "")[[1]] + gap_cost <- sample(1:3, size = 1) + gap_open_cost <- sample(1:3, size = 1) + results_seqtrie <- dist_matrix(query, target, mode = "levenshtein", cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost, nthreads=NTHREADS) + results_biostrings <- biostrings_matrix_global(query, target, cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + + # Check pairwise results + query_pairwise <- mutate_strings(target, prob=0.025, indel_prob=0.05, charset = CHARSET) + results_seqtrie <- dist_pairwise(query_pairwise, target, mode = "levenshtein", cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost, nthreads=NTHREADS) + results_biostrings <- biostrings_pairwise_global(query_pairwise, target, cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + }) + + print("Checking anchored search with affine gap for correctness") + local({ + target <- unique(c(random_strings(NSEQS, CHARSET),"")) + query <- sample(c(sample(target, NSEQS/1000), random_strings(NSEQS/1000, CHARSET))) + query <- unique(c(mutate_strings(query, indel_prob=0, charset = CHARSET), "")) + + # Check matrix results + cost_matrix <- matrix(sample(1:3, size = nchar(CHARSET)^2, replace=TRUE), nrow=nchar(CHARSET)) + diag(cost_matrix) <- 0 + colnames(cost_matrix) <- rownames(cost_matrix) <- strsplit(CHARSET, "")[[1]] + gap_cost <- sample(1:3, size = 1) + gap_open_cost <- sample(1:3, size = 1) + results_seqtrie <- dist_matrix(query, target, mode = "anchored", cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost, nthreads=NTHREADS) + query_size <- attr(results_seqtrie, "query_size") + target_size <- attr(results_seqtrie, "target_size") + results_biostrings <- biostrings_matrix_anchored(query, target, query_size, target_size, cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + + # Check pairwise results + query_pairwise <- mutate_strings(target, prob=0.025, indel_prob=0.05, charset = CHARSET) + results_seqtrie <- dist_pairwise(query_pairwise, target, mode = "anchored", cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost, nthreads=NTHREADS) + query_size <- attr(results_seqtrie, "query_size") + target_size <- attr(results_seqtrie, "target_size") + results_biostrings <- biostrings_pairwise_anchored(query_pairwise, target, query_size, target_size, cost_matrix = cost_matrix, gap_cost = gap_cost, gap_open_cost=gap_open_cost) + stopifnot(all(results_seqtrie == results_biostrings)) + }) + } + + } Loading required package: BiocGenerics Loading required package: generics Attaching package: 'generics' The following objects are masked from 'package:base': as.difftime, as.factor, as.ordered, intersect, is.element, setdiff, setequal, union Attaching package: 'BiocGenerics' The following objects are masked from 'package:stats': IQR, mad, sd, var, xtabs The following objects are masked from 'package:base': Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append, as.data.frame, basename, cbind, colnames, dirname, do.call, duplicated, eval, evalq, get, grep, grepl, is.unsorted, lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind, rownames, sapply, saveRDS, table, tapply, unique, unsplit, which.max, which.min Loading required package: S4Vectors Loading required package: stats4 Attaching package: 'S4Vectors' The following object is masked from 'package:utils': findMatches The following objects are masked from 'package:base': I, expand.grid, unname Loading required package: IRanges Loading required package: Biostrings Loading required package: XVector Loading required package: GenomeInfoDb Attaching package: 'Biostrings' The following object is masked from 'package:base': strsplit Attaching package: 'pwalign' The following objects are masked from 'package:Biostrings': PairwiseAlignments, PairwiseAlignmentsSingleSubject, aligned, alignedPattern, alignedSubject, compareStrings, deletion, errorSubstitutionMatrices, indel, insertion, mismatchSummary, mismatchTable, nedit, nindel, nucleotideSubstitutionMatrix, pairwiseAlignment, pattern, pid, qualitySubstitutionMatrices, stringDist, unaligned, writePairwiseAlignments Test seed: 1785658563 [1] "Checking hamming search correctness" [1] "Checking levenshtein search correctness" Error in unlist(substitutionMatrix, substitutionMatrix) : 'recursive' must be a length-1 vector Calls: <Anonymous> ... mpi.XStringSet.pairwiseAlignment -> XStringSet.pairwiseAlignment -> array -> unlist Execution halted Flavor: r-oldrel-macos-x86_64