Skip to content

Commit

Permalink
commented out snpClust examples (thread pb?) and fixed OMP thread lim…
Browse files Browse the repository at this point in the history
…its in more tests
  • Loading branch information
Nathalie Vialaneix committed Jan 12, 2024
1 parent a119842 commit d863cf6
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions R/snpClust.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@
#'
#'
#' @examples
#' \dontshow{Sys.setenv("OMP_THREAD_LIMIT" = 2)}
#' ## a very small example
#' if (requireNamespace("snpStats", quietly = TRUE)) {
#' \dontrun{
#' data(testdata, package = "snpStats")
#'
#' # input as snpStats::SnpMatrix
Expand Down
3 changes: 1 addition & 2 deletions man/snpClust.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/testthat/test_chac.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("Methods of class 'chac'", {
Sys.setenv("OMP_THREAD_LIMIT" = 2)
data("iris")
dissim <- dist(iris[, 1:4])^2
sim <- 1-as.matrix(dissim)/2
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test_modify.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
context("Correctness of handling general similarity matrices")

Sys.setenv("OMP_THREAD_LIMIT" = 2)
data("iris")
dissim <- dist(iris[1:10,1:4])^2
sim <- 1-as.matrix(dissim)/2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
context("Equivalence between similarity and dissimilarity implementations")

Sys.setenv("OMP_THREAD_LIMIT" = 2)
data("iris")
dissim <- as.matrix(dist(iris[1:10,1:4]))
sim <- 12-dissim^2/2
Expand Down
4 changes: 4 additions & 0 deletions tests/testthat/test_snpClust_NA-in-LD.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ test_that("NA values in LD estimates gives a warning/error in 'snpClust'", {
skip_if_not_installed("snpStats")
check_missing_ld()

Sys.setenv("OMP_THREAD_LIMIT" = 2)
data("ld.example", package = "snpStats")
p <- ncol(ceph.1mb)
h <- p - 1
Expand All @@ -38,6 +39,7 @@ test_that("NA values in LD estimates gives a warning/error in 'snpClust' (second
# when check_missing_ld() skips the previous test: it means that snpClust does not produce NA
skip_if_not_installed("snpStats")

Sys.setenv("OMP_THREAD_LIMIT" = 2)
data("ld.example", package = "snpStats")
p <- ncol(ceph.1mb)
h <- p - 1
Expand All @@ -57,6 +59,7 @@ test_that("Dropping a SNP yielding NA values in LD fixes the NA problem", {
skip_if_not_installed("snpStats")
check_missing_ld()

Sys.setenv("OMP_THREAD_LIMIT" = 2)
geno <- ceph.1mb[, -316] ## drop one SNP leading to one missing LD value
p <- ncol(geno)
h <- p - 1
Expand All @@ -78,6 +81,7 @@ test_that("Modifying one genotype also fixes the NA problem", {
skip_if_not_installed("snpStats")
check_missing_ld()

Sys.setenv("OMP_THREAD_LIMIT" = 2)
data("ld.example", package = "snpStats")
p <- ncol(ceph.1mb)
h <- p - 1
Expand Down

0 comments on commit d863cf6

Please sign in to comment.