Skip to content

Commit

Permalink
suggests/tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
traversc committed May 3, 2024
1 parent b40c95c commit a2cbf1d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 0.2.8 (2024-05-03)
* Conditionally run tests if required packages are installed

Version 0.2.7 (2024-01-25)
* Add Ankerl unordered_dense conditional on C++17 support
* Add `pwalign` package to suggests field which is responsible for pairwiseAlignment in the biostrings package in BioC 3.19
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: seqtrie
Title: Radix Tree and Trie-Based String Distances
Version: 0.2.7
Date: 2024-04-30
Version: 0.2.8
Date: 2024-05-03
Authors@R: c(
person("Travers", "Ching", email = "[email protected]", role = c("aut", "cre", "cph")),
person("Martin", "Moene", role = c("ctb", "cph"), comment = "span-lite C++ library"),
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ BUILD := $(PACKAGE)_$(VERSION).tar.gz
.PHONY: doc build install test vignette $(BUILD)

check: $(BUILD)
R CMD check --as-cran $<
export _R_CHECK_FORCE_SUGGESTS_=false && R CMD check --as-cran $<

check-no-vignette: $(BUILD)
R CMD check --as-cran --no-build-vignettes --ignore-vignettes --no-manual $<
export _R_CHECK_FORCE_SUGGESTS_=false && R CMD check --as-cran --no-build-vignettes --ignore-vignettes --no-manual $<


check-cran: $(BUILD)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_RadixForest.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
# 1) That insertion and deletion produce the correct results with random strings
# 2) That search (hamming, levenshtein and anchored) produce the same results as the internal `dist_matrix` and `dist_pairwise` functions

if(requireNamespace("seqtrie", quietly=TRUE) &&
requireNamespace("stringi", quietly=TRUE) &&
requireNamespace("stringdist", quietly=TRUE) &&
requireNamespace("dplyr", quietly=TRUE)
) {


library(seqtrie)
library(stringdist)
library(stringi)
Expand Down Expand Up @@ -152,3 +159,5 @@ for(. in 1:NITER) {
stopifnot(identical(results_frac, sd_frac))
})
}

}
8 changes: 8 additions & 0 deletions tests/test_RadixTree.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# 1) That insertion and deletion produce the correct results with random strings
# 2) That search (hamming, levenshtein and anchored) produce the same results as the internal `dist_matrix` and `dist_pairwise` functions

if(requireNamespace("seqtrie", quietly=TRUE) &&
requireNamespace("stringi", quietly=TRUE) &&
requireNamespace("stringdist", quietly=TRUE) &&
requireNamespace("dplyr", quietly=TRUE)
) {

library(seqtrie)
library(stringdist)
library(stringi)
Expand Down Expand Up @@ -294,3 +300,5 @@ for(. in 1:NITER) {
})

}

}
11 changes: 11 additions & 0 deletions tests/test_pairwise.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
# 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)

if(requireNamespace("seqtrie", quietly=TRUE) &&
requireNamespace("stringi", quietly=TRUE) &&
requireNamespace("stringdist", quietly=TRUE) &&
requireNamespace("Biostrings", quietly=TRUE) &&
requireNamespace("dplyr", quietly=TRUE) &&
# pwalign is only required for Biostrings >= 2.72.0 in R 4.4+
( (packageVersion("Biostrings") < "2.72.0") || requireNamespace("pwalign", quietly=TRUE) )
) {

library(seqtrie)
library(stringi)
library(stringdist)
Expand Down Expand Up @@ -261,3 +270,5 @@ for(. in 1:NITER) {
stopifnot(all(results_seqtrie == results_biostrings))
})
}

}

0 comments on commit a2cbf1d

Please sign in to comment.