Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
TuomasBorman committed Jul 20, 2023
1 parent f32355a commit d282872
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/testthat/test-6cca.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ test_that("CCA", {
sce <- runCCA(sce, form, full = TRUE)
actual <- reducedDim(sce,"CCA")
res <- attributes(actual)$significance
# Permanova
set.seed(46)
test <- vegan::anova.cca(attributes(actual)$cca, permutations = 999)
expect_equal(res$permanova$model, test)
set.seed(46)
test <- vegan::anova.cca(attributes(actual)$cca, permutations = 999, by = "margin")
expect_equal(res$permanova$variables, test)
# Betadisper (homogeneity of groups)
betadisp <- vegan::betadisper(
vegan::vegdist(t(assay(sce)), method = "euclidean"), group = colData(sce)[["Manure"]])
expect_equal(res$homogeneity$variables$Manure$betadisper, betadisp)
# Significance of betadisper with different permanova and anova
set.seed(46)
test <- vegan::permutest(betadisp, permutations = 999)
expect_equal(res$homogeneity$variables$Manure$permanova, test)
Expand Down

0 comments on commit d282872

Please sign in to comment.