Skip to content

Commit 02f26f7

Browse files
committed
fix: remove cmdstanr:: from example, add skip guards for optional deps in tests
- Wrap TIGER example in dontrun and remove cmdstanr::cmdstan_path() call that was still triggering the undeclared import warning - Update man/tiger.Rd to match - Use data(skin, package='netZooR') in tests for robustness - Add skip_if_not_installed() for edgeR and preprocessCore tests
1 parent 8c0d652 commit 02f26f7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

tests/testthat/test-yarn.R

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,55 +97,57 @@ test_that("checkMisAnnotation() returns coordinates without error", {
9797
# ---- Tests using the shipped skin dataset ----
9898

9999
test_that("skin dataset loads and is an ExpressionSet", {
100-
data(skin)
100+
data(skin, package = "netZooR")
101101
expect_s4_class(skin, "ExpressionSet")
102102
expect_true(nrow(skin) > 0)
103103
expect_true(ncol(skin) > 0)
104104
})
105105

106106
test_that("checkTissuesToMerge() works on skin data", {
107-
data(skin)
107+
data(skin, package = "netZooR")
108108
result <- checkTissuesToMerge(skin, "SMTS", "SMTSD", plotFlag = FALSE)
109109
expect_true(!is.null(result))
110110
})
111111

112112
test_that("filterGenes() works on skin data", {
113-
data(skin)
113+
data(skin, package = "netZooR")
114114
filtered <- filterGenes(skin, labels = c("X", "Y", "MT"),
115115
featureName = "chromosome_name")
116116
remaining <- Biobase::fData(filtered)[, "chromosome_name"]
117117
expect_true(!any(remaining %in% c("X", "Y", "MT")))
118118
})
119119

120120
test_that("filterLowGenes() works on skin data", {
121-
data(skin)
121+
skip_if_not_installed("edgeR")
122+
data(skin, package = "netZooR")
122123
filtered <- filterLowGenes(skin, "SMTSD")
123124
expect_true(nrow(filtered) <= nrow(skin))
124125
})
125126

126127
test_that("filterMissingGenes() works on skin data", {
127-
data(skin)
128+
data(skin, package = "netZooR")
128129
filtered <- filterMissingGenes(skin)
129130
expect_s4_class(filtered, "ExpressionSet")
130131
})
131132

132133
test_that("filterSamples() works on skin data", {
133-
data(skin)
134+
data(skin, package = "netZooR")
134135
filtered <- filterSamples(skin, ids = "Skin - Not Sun Exposed (Suprapubic)",
135136
groups = "SMTSD")
136137
remaining <- Biobase::pData(filtered)[, "SMTSD"]
137138
expect_true(!any(remaining == "Skin - Not Sun Exposed (Suprapubic)"))
138139
})
139140

140141
test_that("plotCMDS() works on skin data", {
141-
data(skin)
142+
data(skin, package = "netZooR")
142143
coords <- plotCMDS(skin, comp = 1:2, plotFlag = FALSE)
143144
expect_true(is.matrix(coords) || is.data.frame(coords))
144145
expect_equal(ncol(coords), 2)
145146
})
146147

147148
test_that("normalizeTissueAware() works on skin data", {
148-
data(skin)
149+
skip_if_not_installed("preprocessCore")
150+
data(skin, package = "netZooR")
149151
# Use a small subset for speed
150152
skinSub <- skin[1:100, ]
151153
normalized <- normalizeTissueAware(skinSub, "SMTSD",

0 commit comments

Comments
 (0)