diff --git a/DESCRIPTION b/DESCRIPTION index 00b5903..d92575e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -25,4 +25,7 @@ Description: This package is intended to be used to explore the curated datasets License: Apache License (>= 2) Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 \ No newline at end of file +RoxygenNote: 7.3.1 +Suggests: + testthat (>= 3.0.0) +Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 25d0dc8..3d5f477 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -14,6 +14,7 @@ export(getComputeResult) export(getComputeResultWithMetadata) export(getCuratedDatasetNames) export(rankedAbundance) +export(selfCorrelation) exportMethods(getComputeResult) exportMethods(getComputeResultWithMetadata) importFrom(microbiomeComputations,DifferentialAbundanceResult) @@ -22,6 +23,7 @@ importFrom(microbiomeComputations,betaDiv) importFrom(microbiomeComputations,correlation) importFrom(microbiomeComputations,differentialAbundance) importFrom(microbiomeComputations,rankedAbundance) +importFrom(microbiomeComputations,selfCorrelation) importFrom(microbiomeData,BONUS) importFrom(microbiomeData,Bangladesh) importFrom(microbiomeData,DiabImmune) diff --git a/R/computes.R b/R/computes.R index f2579f4..ffadde1 100644 --- a/R/computes.R +++ b/R/computes.R @@ -17,3 +17,7 @@ microbiomeComputations::differentialAbundance #' @importFrom microbiomeComputations correlation #' @export microbiomeComputations::correlation + +#' @importFrom microbiomeComputations selfCorrelation +#' @export +microbiomeComputations::selfCorrelation diff --git a/man/reexports.Rd b/man/reexports.Rd index b9ff453..a187386 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -8,6 +8,7 @@ \alias{betaDiv} \alias{differentialAbundance} \alias{correlation} +\alias{selfCorrelation} \alias{DiabImmune} \alias{FARMM} \alias{Bangladesh} @@ -21,7 +22,7 @@ These objects are imported from other packages. Follow the links below to see their documentation. \describe{ - \item{microbiomeComputations}{\code{\link[microbiomeComputations]{alphaDiv}}, \code{\link[microbiomeComputations]{betaDiv}}, \code{\link[microbiomeComputations]{correlation}}, \code{\link[microbiomeComputations]{differentialAbundance}}, \code{\link[microbiomeComputations]{rankedAbundance}}} + \item{microbiomeComputations}{\code{\link[microbiomeComputations]{alphaDiv}}, \code{\link[microbiomeComputations]{betaDiv}}, \code{\link[microbiomeComputations]{correlation}}, \code{\link[microbiomeComputations]{differentialAbundance}}, \code{\link[microbiomeComputations]{rankedAbundance}}, \code{\link[microbiomeComputations]{selfCorrelation}}} \item{microbiomeData}{\code{\link[microbiomeData]{Bangladesh}}, \code{\link[microbiomeData]{BONUS}}, \code{\link[microbiomeData]{DiabImmune}}, \code{\link[microbiomeData]{FARMM}}, \code{\link[microbiomeData]{HMP_WGS}}, \code{\link[microbiomeData]{NICU_NEC}}} }} diff --git a/tests/testthat/test-GetComputeResult.R b/tests/testthat/test-GetComputeResult.R index 9edf762..9a16f1d 100644 --- a/tests/testthat/test-GetComputeResult.R +++ b/tests/testthat/test-GetComputeResult.R @@ -1,5 +1,5 @@ test_that("we can get compute results in different formats", { - mbioDataset <- microbiomeData::DiabImmune + mbioDataset <- MicrobiomeDB::DiabImmune genus <- getCollection(mbioDataset, "16S Genus", continuousMetadataOnly = TRUE) # make sure metadata dont contain IRIs @@ -28,23 +28,23 @@ test_that("we can get compute results in different formats", { ) ) ) - diffAbundOutput <- microbiomeComputations::differentialAbundance(getCollection(mbioDataset, "16S Genus"), comparatorVariable, method='Maaslin', verbose=FALSE) + diffAbundOutput <- MicrobiomeDB::differentialAbundance(getCollection(mbioDataset, "16S Genus"), comparatorVariable, method='Maaslin', verbose=FALSE) expect_equal(inherits(diffAbundOutput, "ComputeResult"), TRUE) - correlationOutput <- microbiomeComputations::selfCorrelation(getCollection(mbioDataset, "16S Genus"), method='spearman', verbose=FALSE) + correlationOutput <- MicrobiomeDB::selfCorrelation(getCollection(mbioDataset, "16S Genus"), method='spearman', verbose=FALSE) correlationDT <- getComputeResult(correlationOutput, "data.table") expect_equal(inherits(correlationDT, "data.table"), TRUE) expect_equal(all(c('data1', 'data2', 'correlationCoef', 'pValue') %in% names(correlationDT)), TRUE) # make sure continuousMetadataOnly flag works so we can do taxa X metadata correlations - correlationOutput <- microbiomeComputations::correlation(genus, method='spearman', verbose=FALSE) + correlationOutput <- MicrobiomeDB::correlation(genus, method='spearman', verbose=FALSE) expect_equal(inherits(correlationOutput, "ComputeResult"), TRUE) correlationIGraph <- getComputeResult(correlationOutput, "igraph") expect_equal(inherits(correlationIGraph, "igraph"), TRUE) # make sure getComputeResultWithMetadata works - alphaDivOutput <- microbiomeComputations::alphaDiv(getCollection(mbioDataset, "16S Genus"), method='shannon', verbose=FALSE) + alphaDivOutput <- MicrobiomeDB::alphaDiv(getCollection(mbioDataset, "16S Genus"), method='shannon', verbose=FALSE) expect_equal(inherits(alphaDivOutput, "ComputeResult"), TRUE) alphaDivDT <- getComputeResultWithMetadata(alphaDivOutput, mbioDataset, metadataVariables = c('country', 'delivery_mode')) expect_equal(inherits(alphaDivDT, "data.table"), TRUE)