Skip to content

Commit

Permalink
Fix rworkflow (microbiome#544)
Browse files Browse the repository at this point in the history
Signed-off-by: Daena Rys <[email protected]>
  • Loading branch information
Daenarys8 authored May 20, 2024
1 parent fe26b64 commit 1926161
Show file tree
Hide file tree
Showing 30 changed files with 309 additions and 310 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/rworkflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ name: rworkflows
- RELEASE_**
jobs:
rworkflows:
permissions:
contents: write
permissions: write-all
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
container: ${{ matrix.config.cont }}
Expand All @@ -26,8 +25,8 @@ jobs:
- os: ubuntu-latest
bioc: devel
r: auto
cont: bioconductor/bioconductor_docker:devel
rspm: https://packagemanager.rstudio.com/cran/__linux__/latest/release
cont: ghcr.io/bioconductor/bioconductor_docker:devel
rspm: ~
- os: macOS-latest
bioc: devel
r: auto
Expand Down Expand Up @@ -55,4 +54,4 @@ jobs:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
runner_os: ${{ runner.os }}
cache_version: cache-v1
enable_act: ${{ false }}
docker_registry: ghcr.io
20 changes: 10 additions & 10 deletions R/agglomerate.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@
#' to \code{getPrevalence} and \code{getPrevalentTaxa} and used in
#' \code{agglomeratebyPrevalence}
#' \itemize{
#' \item{\code{remove_empty_ranks}}{A single boolean value for selecting
#' \item \code{remove_empty_ranks}: A single boolean value for selecting
#' whether to remove those columns of rowData that include only NAs after
#' agglomeration. (By default: \code{remove_empty_ranks = FALSE})}
#' \item{\code{make_unique}}{A single boolean value for selecting
#' whether to make rownames unique. (By default: \code{make_unique = TRUE})}
#' \item{\code{detection}}{Detection threshold for absence/presence.
#' agglomeration. (By default: \code{remove_empty_ranks = FALSE})
#' \item \code{make_unique}: A single boolean value for selecting
#' whether to make rownames unique. (By default: \code{make_unique = TRUE})
#' \item \code{detection}: Detection threshold for absence/presence.
#' Either an absolute value compared directly to the values of \code{x}
#' or a relative value between 0 and 1, if \code{as_relative = FALSE}.}
#' \item{\code{prevalence}}{Prevalence threshold (in 0 to 1). The
#' or a relative value between 0 and 1, if \code{as_relative = FALSE}.
#' \item \code{prevalence}: Prevalence threshold (in 0 to 1). The
#' required prevalence is strictly greater by default. To include the
#' limit, set \code{include_lowest} to \code{TRUE}.}
#' \item{\code{as.relative}}{Logical scalar: Should the detection
#' limit, set \code{include_lowest} to \code{TRUE}.
#' \item \code{as.relative}: Logical scalar: Should the detection
#' threshold be applied on compositional (relative) abundances?
#' (default: \code{FALSE})}
#' (default: \code{FALSE})
#' }
#'
#' @param altexp String or integer scalar specifying an alternative experiment
Expand Down
8 changes: 4 additions & 4 deletions R/decontam.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
#'
#' @param ...
#' \itemize{
#' \item{for \code{isContaminant}/ \code{isNotContaminant}: }{arguments
#' \item for \code{isContaminant}/ \code{isNotContaminant}: arguments
#' passed on to \code{\link[decontam:isContaminant]{decontam:isContaminant}}
#' or \code{\link[decontam:isNotContaminant]{decontam:isNotContaminant}}}
#' \item{for \code{addContaminantQC}/\code{addNotContaminantQC}: }{arguments
#' passed on to \code{isContaminant}/ \code{isNotContaminant}}
#' or \code{\link[decontam:isNotContaminant]{decontam:isNotContaminant}}
#' \item for \code{addContaminantQC}/\code{addNotContaminantQC}: arguments
#' passed on to \code{isContaminant}/ \code{isNotContaminant}
#' }
#'
#' @return for \code{isContaminant}/ \code{isNotContaminant} a \code{DataFrame}
Expand Down
54 changes: 27 additions & 27 deletions R/estimateDiversity.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@
#'
#' @param ... optional arguments:
#' \itemize{
#' \item{threshold}{ A numeric value in the unit interval,
#' \item threshold: A numeric value in the unit interval,
#' determining the threshold for coverage index. By default,
#' \code{threshold} is 0.9.}
#' \item{quantile}{ Arithmetic abundance classes are evenly cut up to to
#' \code{threshold} is 0.9.
#' \item quantile: Arithmetic abundance classes are evenly cut up to to
#' this quantile of the data. The assumption is that abundances higher than
#' this are not common, and they are classified in their own group.
#' By default, \code{quantile} is 0.5.}
#' \item{num_of_classes}{ The number of arithmetic abundance classes
#' By default, \code{quantile} is 0.5.
#' \item num_of_classes: The number of arithmetic abundance classes
#' from zero to the quantile cutoff indicated by \code{quantile}.
#' By default, \code{num_of_classes} is 50.}
#' \item{only.tips}{ A boolean value specifying whether to remove internal
#' By default, \code{num_of_classes} is 50.
#' \item only.tips: A boolean value specifying whether to remove internal
#' nodes when Faith's index is calculated. When \code{only.tips=TRUE}, those
#' rows that are not tips of tree are removed.
#' (By default: \code{only.tips=FALSE})}
#' (By default: \code{only.tips=FALSE})
#' }
#'
#' @return \code{x} with additional \code{\link{colData}} named \code{*name*}
Expand All @@ -74,11 +74,11 @@
#'
#' \itemize{
#'
#' \item{'coverage' }{Number of species needed to cover a given fraction of
#' \item 'coverage': Number of species needed to cover a given fraction of
#' the ecosystem (50 percent by default). Tune this with the threshold
#' argument.}
#' argument.
#'
#' \item{'faith' }{Faith's phylogenetic alpha diversity index measures how
#' \item 'faith': Faith's phylogenetic alpha diversity index measures how
#' long the taxonomic distance is between taxa that are present in the sample.
#' Larger values represent higher diversity. Using this index requires
#' rowTree. (Faith 1992)
Expand All @@ -87,12 +87,12 @@
#' internal nodes, there are two options. First, you can keep those features,
#' and prune the tree to match features so that each tip can be found from
#' the features. Other option is to remove all features that are not tips.
#' (See \code{only.tips} parameter)}
#' (See \code{only.tips} parameter)
#'
#' \item{'fisher' }{Fisher's alpha; as implemented in
#' \code{\link[vegan:diversity]{vegan::fisher.alpha}}. (Fisher et al. 1943)}
#' \item 'fisher': Fisher's alpha; as implemented in
#' \code{\link[vegan:diversity]{vegan::fisher.alpha}}. (Fisher et al. 1943)
#'
#' \item{'gini_simpson' }{Gini-Simpson diversity i.e. \eqn{1 - lambda},
#' \item 'gini_simpson': Gini-Simpson diversity i.e. \eqn{1 - lambda},
#' where \eqn{lambda} is the
#' Simpson index, calculated as the sum of squared relative abundances.
#' This corresponds to the diversity index
Expand All @@ -101,25 +101,25 @@
#' psychology and management studies. The Gini-Simpson index (1-lambda)
#' should not be
#' confused with Simpson's dominance (lambda), Gini index, or
#' inverse Simpson index (1/lambda).}
#' inverse Simpson index (1/lambda).
#'
#' \item{'inverse_simpson' }{Inverse Simpson diversity:
#' \item 'inverse_simpson': Inverse Simpson diversity:
#' \eqn{1/lambda} where \eqn{lambda=sum(p^2)} and p refers to relative
#' abundances.
#' This corresponds to the diversity index
#' 'invsimpson' in vegan::diversity. Don't confuse this with the
#' closely related Gini-Simpson index}
#' closely related Gini-Simpson index
#'
#' \item{'log_modulo_skewness' }{The rarity index characterizes the
#' \item 'log_modulo_skewness': The rarity index characterizes the
#' concentration of species at low abundance. Here, we use the skewness of
#' the frequency
#' distribution of arithmetic abundance classes (see Magurran & McGill 2011).
#' These are typically right-skewed; to avoid taking log of occasional
#' negative skews, we follow Locey & Lennon (2016) and use the log-modulo
#' transformation that adds a value of one to each measure of skewness to
#' allow logarithmization.}
#' allow logarithmization.
#'
#' \item{'shannon' }{Shannon diversity (entropy).}
#' \item 'shannon': Shannon diversity (entropy).
#'
#' }
#'
Expand Down Expand Up @@ -158,11 +158,11 @@
#' @seealso
#' \code{\link[scater:plotColData]{plotColData}}
#' \itemize{
#' \item{\code{\link[mia:estimateRichness]{estimateRichness}}}
#' \item{\code{\link[mia:estimateEvenness]{estimateEvenness}}}
#' \item{\code{\link[mia:estimateDominance]{estimateDominance}}}
#' \item{\code{\link[vegan:diversity]{diversity}}}
#' \item{\code{\link[vegan:specpool]{estimateR}}}
#' \item \code{\link[mia:estimateRichness]{estimateRichness}}
#' \item \code{\link[mia:estimateEvenness]{estimateEvenness}}
#' \item \code{\link[mia:estimateDominance]{estimateDominance}}
#' \item \code{\link[vegan:diversity]{diversity}}
#' \item \code{\link[vegan:specpool]{estimateR}}
#' }
#'
#' @name estimateDiversity
Expand Down Expand Up @@ -258,7 +258,7 @@ setMethod("estimateDiversity", signature = c(x="SummarizedExperiment"),
"inverse_simpson", "log_modulo_skewness", "shannon")
index_string <- paste0("'", paste0(supported_index, collapse = "', '"), "'")
if ( !all(index %in% supported_index) || !(length(index) > 0)) {
stop("'", paste0("'index' must be from the following options: '",supported_types), "'", call. = FALSE)
stop("'", paste0("'index' must be from the following options: '",index_string), "'", call. = FALSE)
}

if(!.is_non_empty_character(name) || length(name) != length(index)){
Expand Down
34 changes: 17 additions & 17 deletions R/estimateDominance.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
#'
#' \itemize{
#'
#' \item{'absolute' }{Absolute index equals to the absolute abundance of the
#' \item 'absolute': Absolute index equals to the absolute abundance of the
#' most dominant n species of the sample (specify the number with the argument
#' \code{ntaxa}). Index gives positive integer values.}
#' \code{ntaxa}). Index gives positive integer values.
#'
#' \item{'dbp' }{Berger-Parker index (See Berger & Parker 1970) calculation
#' \item 'dbp': Berger-Parker index (See Berger & Parker 1970) calculation
#' is a special case of the 'relative' index. dbp is the relative abundance of
#' the most
#' abundant species of the sample. Index gives values in interval 0 to 1,
Expand All @@ -73,9 +73,9 @@
#' \deqn{dbp = \frac{N_1}{N_{tot}}}{%
#' dbp = N_1/N_tot} where \eqn{N_1} is the absolute abundance of the most
#' dominant species and \eqn{N_{tot}} is the sum of absolute abundances of all
#' species.}
#' species.
#'
#' \item{'core_abundance' }{ Core abundance index is related to core species.
#' \item 'core_abundance': Core abundance index is related to core species.
#' Core species are species that are most abundant in all samples, i.e., in
#' whole data set. Core species are defined as those species that have
#' prevalence over 50\%. It means that in order to belong to core species,
Expand All @@ -87,9 +87,9 @@
#' \deqn{core_abundance = \frac{N_{core}}{N_{tot}}}{%
#' core_abundance = N_core/N_tot} where \eqn{N_{core}} is the sum of absolute
#' abundance of the core species and \eqn{N_{tot}} is the sum of absolute
#' abundances of all species.}
#' abundances of all species.
#'
#' \item{'gini' }{ Gini index is probably best-known from socio-economic
#' \item 'gini': Gini index is probably best-known from socio-economic
#' contexts (Gini 1921). In economics, it is used to measure, for example, how
#' unevenly income is distributed among population. Here, Gini index is used
#' similarly, but income is replaced with abundance.
Expand All @@ -98,19 +98,19 @@
#' that represent large portion of total abundance of microbes, the inequality
#' is large and Gini index closer to 1. If all species has equally large
#' abundances, the equality is perfect and Gini index equals 0. This index
#' should not be confused with Gini-Simpson index, which quantifies diversity.}
#' should not be confused with Gini-Simpson index, which quantifies diversity.
#'
#' \item{'dmn' }{McNaughton’s index is the sum of relative abundances of the two
#' \item 'dmn': McNaughton’s index is the sum of relative abundances of the two
#' most abundant species of the sample (McNaughton & Wolf, 1970). Index gives
#' values in the unit interval:
#'
#' \deqn{dmn = (N_1 + N_2)/N_tot}
#'
#' where \eqn{N_1} and \eqn{N_2} are the absolute
#' abundances of the two most dominant species and \eqn{N_{tot}} is the sum of
#' absolute abundances of all species.}
#' absolute abundances of all species.
#'
#' \item{'relative' }{ Relative index equals to the relative abundance of the
#' \item 'relative': Relative index equals to the relative abundance of the
#' most dominant n species of the sample (specify the number with the
#' argument \code{ntaxa}).
#' This index gives values in interval 0 to 1.
Expand All @@ -119,9 +119,9 @@
#'
#' where \eqn{N_1} is the absolute abundance of the most
#' dominant species and \eqn{N_{tot}} is the sum of absolute abundances of all
#' species.}
#' species.
#'
#' \item{'simpson_lambda' }{ Simpson's (dominance) index or Simpson's lambda is
#' \item 'simpson_lambda': Simpson's (dominance) index or Simpson's lambda is
#' the sum of squared relative abundances. This index gives values in the unit interval.
#' This value equals the probability that two randomly chosen individuals
#' belongs to the
Expand All @@ -136,7 +136,7 @@
#' However, this is not provided and the simpler squared sum of relative
#' abundances is used instead as the alternative index is not in the unit
#' interval and it is highly
#' correlated with the simpler variant implemented here.}
#' correlated with the simpler variant implemented here.
#'
#' }
#'
Expand All @@ -163,9 +163,9 @@
#'
#' @seealso
#' \itemize{
#' \item{\code{\link[mia:estimateRichness]{estimateRichness}}}
#' \item{\code{\link[mia:estimateEvenness]{estimateEvenness}}}
#' \item{\code{\link[mia:estimateDiversity]{estimateDiversity}}}
#' \item \code{\link[mia:estimateRichness]{estimateRichness}}
#' \item \code{\link[mia:estimateEvenness]{estimateEvenness}}
#' \item \code{\link[mia:estimateDiversity]{estimateDiversity}}
#' }
#'
#' @name estimateDominance
Expand Down
18 changes: 9 additions & 9 deletions R/estimateEvenness.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#'
#' @param ... optional arguments:
#' \itemize{
#' \item{threshold}{ a numeric threshold. assay values below or equal
#' to this threshold will be set to zero.}
#' \item threshold: a numeric threshold. assay values below or equal
#' to this threshold will be set to zero.
#' }
#'
#' @return \code{x} with additional \code{\link{colData}} named \code{*name*}
Expand All @@ -42,13 +42,13 @@
#'
#' The available evenness indices include the following (all in lowercase):
#' \itemize{
#' \item{'camargo' }{Camargo's evenness (Camargo 1992)}
#' \item{'simpson_evenness' }{Simpson’s evenness is calculated as inverse Simpson diversity (1/lambda) divided by
#' observed species richness S: (1/lambda)/S.}
#' \item{'pielou' }{Pielou's evenness (Pielou, 1966), also known as Shannon or Shannon-Weaver/Wiener/Weiner
#' evenness; H/ln(S). The Shannon-Weaver is the preferred term; see Spellerberg and Fedor (2003).}
#' \item{'evar' }{Smith and Wilson’s Evar index (Smith & Wilson 1996).}
#' \item{'bulla' }{Bulla’s index (O) (Bulla 1994).}
#' \item 'camargo': Camargo's evenness (Camargo 1992)
#' \item 'simpson_evenness': Simpson’s evenness is calculated as inverse Simpson diversity (1/lambda) divided by
#' observed species richness S: (1/lambda)/S.
#' \item 'pielou': Pielou's evenness (Pielou, 1966), also known as Shannon or Shannon-Weaver/Wiener/Weiner
#' evenness; H/ln(S). The Shannon-Weaver is the preferred term; see Spellerberg and Fedor (2003).
#' \item 'evar': Smith and Wilson’s Evar index (Smith & Wilson 1996).
#' \item 'bulla': Bulla’s index (O) (Bulla 1994).
#' }
#'
#' Desirable statistical evenness metrics avoid strong bias towards very
Expand Down
18 changes: 9 additions & 9 deletions R/estimateRichness.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#'
#' \itemize{
#'
#' \item{'ace' }{Abundance-based coverage estimator (ACE) is another
#' \item 'ace': Abundance-based coverage estimator (ACE) is another
#' nonparametric richness
#' index that uses sample coverage, defined based on the sum of the
#' probabilities
Expand All @@ -72,9 +72,9 @@
#' \code{\link[vegan:specpool]{estimateR}}.
#' For an exact formulation, see \code{\link[vegan:specpool]{estimateR}}.
#' Note that this index comes with an additional column with standard
#' error information.}
#' error information.
#'
#' \item{'chao1' }{This is a nonparametric estimator of species richness. It
#' \item 'chao1': This is a nonparametric estimator of species richness. It
#' assumes that rare species carry information about the (unknown) number
#' of unobserved species. We use here the bias-corrected version
#' (O'Hara 2005, Chiu et al. 2014) implemented in
Expand All @@ -85,21 +85,21 @@
#' This estimator uses only the singleton and doubleton counts, and
#' hence it gives more weight to the low abundance species.
#' Note that this index comes with an additional column with standard
#' error information.}
#' error information.
#'
#' \item{'hill' }{Effective species richness aka Hill index
#' \item 'hill': Effective species richness aka Hill index
#' (see e.g. Chao et al. 2016).
#' Currently only the case 1D is implemented. This corresponds to the exponent
#' of Shannon diversity. Intuitively, the effective richness indicates the
#' number of
#' species whose even distribution would lead to the same diversity than the
#' observed
#' community, where the species abundances are unevenly distributed.}
#' community, where the species abundances are unevenly distributed.
#'
#' \item{'observed' }{The _observed richness_ gives the number of species that
#' \item 'observed': The _observed richness_ gives the number of species that
#' is detected above a given \code{detection} threshold in the observed sample
#' (default 0). This is conceptually the simplest richness index. The
#' corresponding index in the \pkg{vegan} package is "richness".}
#' corresponding index in the \pkg{vegan} package is "richness".
#'
#' }
#'
Expand Down Expand Up @@ -129,7 +129,7 @@
#' @seealso
#' \code{\link[scater:plotColData]{plotColData}}
#' \itemize{
#' \item{\code{\link[vegan:specpool]{estimateR}}}
#' \item \code{\link[vegan:specpool]{estimateR}}
#' }
#'
#' @name estimateRichness
Expand Down
8 changes: 4 additions & 4 deletions R/getCrossAssociation.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@
#'
#' @param ... Additional arguments:
#' \itemize{
#' \item{\code{symmetric}}{ A single boolean value for specifying if
#' \item \code{symmetric}: A single boolean value for specifying if
#' measure is symmetric or not. When \code{symmetric = TRUE}, associations
#' are calculated only for unique variable-pairs, and they are assigned to
#' corresponding variable-pair. This decreases the number of calculations in 2-fold
#' meaning faster execution. (By default: \code{symmetric = FALSE}) }
#' \item{\code{association_FUN}}{ A function that is used to calculate (dis-)similarity
#' meaning faster execution. (By default: \code{symmetric = FALSE})
#' \item \code{association_FUN}: A function that is used to calculate (dis-)similarity
#' between features. Function must take matrix as an input and give numeric
#' values as an output. Adjust \code{method} and other parameters correspondingly.
#' Supported functions are, for example, \code{stats::dist} and \code{vegan::vegdist}.}
#' Supported functions are, for example, \code{stats::dist} and \code{vegan::vegdist}.
#' }
#'
#' @details
Expand Down
Loading

0 comments on commit 1926161

Please sign in to comment.