Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporal fix for rworkflow bug #540

Merged
merged 13 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 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 @@ -25,12 +24,12 @@ jobs:
config:
- os: ubuntu-latest
bioc: devel
r: auto
r: 4.4.0
cont: bioconductor/bioconductor_docker:devel
rspm: https://packagemanager.rstudio.com/cran/__linux__/latest/release
- os: macOS-latest
bioc: devel
r: auto
r: 4.4.0
cont: ~
rspm: ~
- os: windows-latest
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
12 changes: 6 additions & 6 deletions man/deprecate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading