@@ -27,25 +27,25 @@ test_that("`pairwise_adonis()` -- Behavioral checks", {
2727 expect_equal(round(res $ F .Model , 2 ), 1.68 )
2828 expect_equal(round(res $ R2 , 2 ), 0.17 )
2929
30- # # Testing with permutation design
31- perm_design_func <- function (meta ) {
32- base :: with(
33- data = meta ,
34- expr = permute :: how(
35- nperm = 9 ,
36- plots = permute :: Plots(meta $ SAMPLEPAIR_ID , type = " none" ),
37- within = permute :: Within(type = " free" )
38- )
39- )
40- }
41- expect_no_error(res <- pairwise_adonis(x = distmat , groups = test $ metaData $ CONTRAST_treatment , metadata = test $ metaData , perm_design = perm_design_func ))
42- expect_equal(colnames(res ), c(" pairs" , " Df" , " SumsOfSqs" , " F.Model" , " R2" , " p.value" , " p.adj" ))
43- expect_equal(res $ pairs , " tumor vs control" )
44- expect_equal(res $ Df , 1 )
45- expect_equal(round(res $ SumsOfSqs , 2 ), 1382.68 )
46- expect_equal(round(res $ F .Model , 2 ), 1.68 )
47- expect_equal(round(res $ R2 , 2 ), 0.17 )
48- expect_equal(res $ p.value , 1 )
30+ # # # Testing with permutation design
31+ # perm_design_func <- function(meta) {
32+ # base::with(
33+ # data = meta,
34+ # expr = permute::how(
35+ # nperm = 9,
36+ # plots = permute::Plots(meta$SAMPLEPAIR_ID, type = "none"),
37+ # within = permute::Within(type = "free")
38+ # )
39+ # )
40+ # }
41+ # expect_no_error(res <- pairwise_adonis(x = distmat, groups = test$metaData$CONTRAST_treatment, metadata = test$metaData, perm_design = perm_design_func))
42+ # expect_equal(colnames(res), c("pairs", "Df", "SumsOfSqs", "F.Model", "R2", "p.value", "p.adj"))
43+ # expect_equal(res$pairs, "tumor vs control")
44+ # expect_equal(res$Df, 1)
45+ # expect_equal(round(res$SumsOfSqs, 2), 1382.68)
46+ # expect_equal(round(res$F.Model, 2), 1.68)
47+ # expect_equal(round(res$R2, 2), 0.17)
48+ # expect_equal(res$p.value, 1)
4949})
5050
5151test_that(" `pairwise_anosim()` -- Argument checks" , {
@@ -67,20 +67,20 @@ test_that("`pairwise_anosim()` -- Behavioral checks", {
6767 expect_equal(res $ pairs , " tumor vs control" )
6868 expect_equal(round(res $ anosimR , 2 ), 0.38 )
6969
70- # # Testing with permutation design
71- perm_design_func <- function (meta ) {
72- base :: with(
73- data = meta ,
74- expr = permute :: how(
75- nperm = 9 ,
76- plots = permute :: Plots(meta $ SAMPLEPAIR_ID , type = " none" ),
77- within = permute :: Within(type = " free" )
78- )
79- )
80- }
81- expect_no_error(res <- pairwise_anosim(x = distmat , groups = test $ metaData $ CONTRAST_treatment , metadata = test $ metaData , perm_design = perm_design_func ))
82- expect_equal(colnames(res ), c(" pairs" , " anosimR" , " p.value" , " p.adj" ))
83- expect_equal(res $ pairs , " tumor vs control" )
84- expect_equal(round(res $ anosimR , 2 ), 0.38 )
85- expect_equal(res $ p.value , 1 )
70+ # # # Testing with permutation design
71+ # perm_design_func <- function(meta) {
72+ # base::with(
73+ # data = meta,
74+ # expr = permute::how(
75+ # nperm = 9,
76+ # plots = permute::Plots(meta$SAMPLEPAIR_ID, type = "none"),
77+ # within = permute::Within(type = "free")
78+ # )
79+ # )
80+ # }
81+ # expect_no_error(res <- pairwise_anosim(x = distmat, groups = test$metaData$CONTRAST_treatment, metadata = test$metaData, perm_design = perm_design_func))
82+ # expect_equal(colnames(res), c("pairs", "anosimR", "p.value", "p.adj"))
83+ # expect_equal(res$pairs, "tumor vs control")
84+ # expect_equal(round(res$anosimR, 2), 0.38)
85+ # expect_equal(res$p.value, 1)
8686})
0 commit comments