Skip to content

Commit 82173dd

Browse files
authored
added arguments to be passed to adonis2 for parallelism
1 parent 168e6a2 commit 82173dd

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: OmicFlow
22
Title: Fast and Efficient (Automated) Analysis of Sparse Omics Data
3-
Version: 1.6.0.9001
3+
Version: 1.6.0.9002
44
Date: 2026-05-19
55
Authors@R: c(
66
person(
@@ -52,6 +52,7 @@ Suggests:
5252
DT,
5353
downloadthis,
5454
rmarkdown,
55+
parallel,
5556
testthat (>= 3.0.0)
5657
LinkingTo:
5758
Rcpp,

R/pairwise_adonis.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#' @param perm_design A function that takes a data.frame and constructs a permutation design with \link[permute]{how} (default: NULL).
1212
#' @param p.adjust.method P adjust method see \link[stats]{p.adjust}.
1313
#' @param perm Number of permutations to compare against the null hypothesis of adonis2 (default: \code{perm=999}).
14+
#' @param ... Additional arguments passed to \link[vegan]{adonis2}.
1415
#' @seealso \link[vegan]{adonis2}
1516
#' @return A \link[base]{data.frame} of
1617
#' * pairs that are used
@@ -44,7 +45,8 @@ pairwise_adonis <- function(
4445
metadata = NULL,
4546
perm_design = NULL,
4647
p.adjust.method = "bonferroni",
47-
perm = 999){
48+
perm = 999,
49+
...){
4850

4951
## Error handling
5052
#--------------------------------------------------------------------#
@@ -95,13 +97,15 @@ pairwise_adonis <- function(
9597
ad <- vegan::adonis2(
9698
m ~ Fac,
9799
data = tmp_m,
98-
permutations = h1
100+
permutations = h1,
101+
...
99102
)
100103
} else {
101104
ad <- vegan::adonis2(
102105
m ~ Fac,
103106
data = tmp_m,
104-
permutations = perm
107+
permutations = perm,
108+
...
105109
)
106110
}
107111

@@ -117,4 +121,4 @@ pairwise_adonis <- function(
117121
p.adj <- stats::p.adjust(p.value, method = p.adjust.method)
118122
pairw.res <- data.frame(pairs, Df, SumsOfSqs, F.Model, R2, p.value, p.adj)
119123
return(pairw.res)
120-
}
124+
}

R/pairwise_anosim.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#' @param perm_design A function that takes a data.frame and constructs a permutation design with \link[permute]{how} (default: NULL).
1212
#' @param p.adjust.method P adjust method see \link[stats]{p.adjust}
1313
#' @param perm Number of permutations to compare against the null hypothesis of anosim (default: \code{perm=999}).
14+
#' @param ... Additional arguments passed to \link[vegan]{anosim}.
1415
#' @seealso \link[vegan]{anosim}
1516
#' @return A \link[base]{data.frame} of
1617
#' * pairs that are used
@@ -42,7 +43,7 @@ pairwise_anosim <- function(
4243
perm_design = NULL,
4344
p.adjust.method = "bonferroni",
4445
perm = 999
45-
){
46+
...){
4647

4748
## Error handling
4849
#--------------------------------------------------------------------#
@@ -87,13 +88,15 @@ pairwise_anosim <- function(
8788
ano <- vegan::anosim(
8889
x = m,
8990
grouping = groups,
90-
permutations = h1
91+
permutations = h1,
92+
...
9193
)
9294
} else {
9395
ano <- vegan::anosim(
9496
x = m,
9597
grouping = groups[rows_to_keep],
96-
permutations = perm
98+
permutations = perm,
99+
...
97100
)
98101
}
99102

0 commit comments

Comments
 (0)