From ccee165898aec4a0234571005012af93aa2528f7 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 11:35:28 -0400 Subject: [PATCH 01/13] try new workflow --- .github/workflows/R-CMD-check.yaml | 155 +++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 .github/workflows/R-CMD-check.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 00000000..8a07ede2 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,155 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [dev] + pull_request: + branches: [dev] + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + + + - name: Install reticulate + run: | + Rscript -e "install.packages('reticulate')" + + - name: Create miniconda + run: | + Rscript -e "reticulate::install_miniconda()" + Rscript -e "reticulate::conda_install(packages = 'scipy')" + + - name: Install pak + run: | + Rscript -e "install.packages('pak')" + + - name: Install GiottoUtils + run: | + Rscript -e "pak::pkg_install('drieslab/GiottoUtils')" + + - name: Install GiottoData + run: | + Rscript -e "pak::pkg_install('drieslab/GiottoData')" + + - name: Install rcmdcheck + run: | + Rscript -e "install.packages('rcmdcheck')" + + - name: Install knitr + run: | + Rscript -e "install.packages('knitr')" + + - name: Install rmarkdown + run: | + Rscript -e "install.packages('rmarkdown')" + + - name: Install testthat + run: | + Rscript -e "install.packages('testthat')" + + - name: Install BiocCheck + run: | + Rscript -e "install.packages('BiocManager')" + Rscript -e "BiocManager::install('BiocCheck')" + + - name: Install dbscan + run: | + Rscript -e "BiocManager::install('dbscan')" + + - name: Install deldir + run: | + Rscript -e "BiocManager::install('deldir')" + + - name: Install igraph + run: | + Rscript -e "BiocManager::install('igraph')" + + - name: Install magick + run: | + Rscript -e "BiocManager::install('magick')" + + - name: Install matrixStats + run: | + Rscript -e "BiocManager::install('matrixStats')" + + - name: Install sp + run: | + Rscript -e "BiocManager::install('sp')" + + - name: Install terra + run: | + Rscript -e "BiocManager::install('terra')" + + - name: Install scattermore + run: | + Rscript -e "install.packages('scattermore')" + + - name: Install exactextractr + run: | + Rscript -e "install.packages('exactextractr')" + + - name: Install future.apply + run: | + Rscript -e "BiocManager::install('future.apply')" + + - name: Install stars + run: | + Rscript -e "BiocManager::install('stars')" + + - name: Install qs + run: | + Rscript -e "BiocManager::install('qs')" + + - name: Install RTriangle + run: | + Rscript -e "BiocManager::install('RTriangle')" + + - name: Install geometry + run: | + Rscript -e "BiocManager::install('geometry')" + + - name: Install Seurat + run: | + Rscript -e "BiocManager::install('Seurat')" + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' + + + + - name: Run BiocCheck + run: | + Rscript -e "BiocCheck::BiocCheck()" + + From 7e3c0fac464ea228ba0ff0a337302b0d02d078c4 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 12:09:44 -0400 Subject: [PATCH 02/13] add packages --- .github/workflows/R-CMD-check.yaml | 52 ++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 8a07ede2..9149d7d4 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -140,6 +140,58 @@ jobs: - name: Install Seurat run: | Rscript -e "BiocManager::install('Seurat')" + + - name: Install chihaya + run: | + Rscript -e "BiocManager::install('chihaya')" + + - name: Install DelayedArray + run: | + Rscript -e "BiocManager::install('DelayedArray')" + + - name: Install DelayedMatrixStats + run: | + Rscript -e "BiocManager::install('DelayedMatrixStats')" + + - name: Install HDF5Array + run: | + Rscript -e "BiocManager::install('HDF5Array')" + + - name: Install remotes + run: | + Rscript -e "BiocManager::install('remotes')" + + - name: Install rgl + run: | + Rscript -e "BiocManager::install('rgl')" + + - name: Install rhdf5 + run: | + Rscript -e "BiocManager::install('rhdf5')" + + - name: Install S4Vectors + run: | + Rscript -e "BiocManager::install('S4Vectors')" + + - name: Install ScaledMatrix + run: | + Rscript -e "BiocManager::install('ScaledMatrix')" + + - name: Install SingleCellExperiment + run: | + Rscript -e "BiocManager::install('SingleCellExperiment')" + + - name: Install SpatialExperiment + run: | + Rscript -e "BiocManager::install('SpatialExperiment')" + + - name: Install STexampleData + run: | + Rscript -e "BiocManager::install('STexampleData')" + + - name: Install SummarizedExperiment + run: | + Rscript -e "BiocManager::install('SummarizedExperiment')" - uses: r-lib/actions/check-r-package@v2 with: From ba03ade9ba334420d9529e95357261fa85b828f5 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 13:27:51 -0400 Subject: [PATCH 03/13] remove reference to Giottovisuals function to avoid warning in rcmdcheck --- R/auxilliary.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/auxilliary.R b/R/auxilliary.R index f0df486b..45d407e1 100644 --- a/R/auxilliary.R +++ b/R/auxilliary.R @@ -1346,7 +1346,6 @@ calculateMetaTableCells <- function( #' name = "norm_scaled_mean_metafeat" #' ) #' showGiottoSpatEnrichments(g) -#' @seealso [GiottoVisuals::spatCellPlot()] #' @export createMetafeats <- function( gobject, From 0fcfcecfc99944816e4f829eca1e6eb4783c8867 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 13:29:47 -0400 Subject: [PATCH 04/13] remove calling for Giotto --- tests/testthat/test-interoperability.R | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/testthat/test-interoperability.R b/tests/testthat/test-interoperability.R index df9e944c..80dd20d8 100644 --- a/tests/testthat/test-interoperability.R +++ b/tests/testthat/test-interoperability.R @@ -1,5 +1,4 @@ library(testthat) -library(Giotto) library(Seurat) giotto_obj <- GiottoData::loadGiottoMini("visium") From f61cbe516c29d24ade2591d02b0531fab2819de1 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 13:40:50 -0400 Subject: [PATCH 05/13] remove calling to GiottoVisuals --- man/createMetafeats.Rd | 3 --- 1 file changed, 3 deletions(-) diff --git a/man/createMetafeats.Rd b/man/createMetafeats.Rd index 537e1267..f86e1c9d 100644 --- a/man/createMetafeats.Rd +++ b/man/createMetafeats.Rd @@ -161,6 +161,3 @@ g <- createMetafeats( ) showGiottoSpatEnrichments(g) } -\seealso{ -\code{\link[GiottoVisuals:spatCellPlot]{GiottoVisuals::spatCellPlot()}} -} From 5b67180a1b303c3dbcf5b26af045cbcad508b0f5 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 13:47:07 -0400 Subject: [PATCH 06/13] add returns value --- R/methods-extract.R | 1 + man/as.list.Rd | 3 +++ 2 files changed, 4 insertions(+) diff --git a/R/methods-extract.R b/R/methods-extract.R index 72d5b333..dae973f3 100644 --- a/R/methods-extract.R +++ b/R/methods-extract.R @@ -1494,6 +1494,7 @@ sliceGiotto <- function( #' `"spatial_info", "spatial_locs", "spatial_network", "feat_info", #' "expression", "cell_metadata", "feat_metadata", "spatial_enrichment", #' "nn_network", "dimension_reduction", "multiomics"` +#' @returns list #' @export setMethod("as.list", signature("giotto"), function( x, slots, spat_unit = NULL, feat_type = NULL, name = NULL, ... diff --git a/man/as.list.Rd b/man/as.list.Rd index 602635e0..9e1bcb0c 100644 --- a/man/as.list.Rd +++ b/man/as.list.Rd @@ -20,6 +20,9 @@ details} \item{\dots}{additional arguments} } +\value{ +list +} \description{ Generic to coerce to a list if possible } From ab21cb9cf79dafafbb11d94071a96820d07d399b Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 13:48:36 -0400 Subject: [PATCH 07/13] add OS --- .github/workflows/R-CMD-check.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 9149d7d4..f2a15d2d 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -21,6 +21,8 @@ jobs: matrix: config: - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'release'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} From a56d6020f6fb5b2ecd2a801a121c0a5cba45ce6f Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 14:06:15 -0400 Subject: [PATCH 08/13] install dev --- .github/workflows/R-CMD-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index f2a15d2d..38d0aaac 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -56,7 +56,7 @@ jobs: - name: Install GiottoUtils run: | - Rscript -e "pak::pkg_install('drieslab/GiottoUtils')" + Rscript -e "pak::pkg_install('drieslab/GiottoUtils@dev')" - name: Install GiottoData run: | From 1872b987d444638e15189431f95ef6909fb7ec85 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 14:30:50 -0400 Subject: [PATCH 09/13] remove calling to Giotto package --- R/classes.R | 2 +- R/combine_metadata.R | 2 +- R/create.R | 32 ++++++++++++++++---------------- R/generics.R | 1 - R/python_environment.R | 10 +++++----- man/combineMetadata.Rd | 2 +- man/giotto-class.Rd | 2 +- man/giotto_python.Rd | 10 +++++----- 8 files changed, 30 insertions(+), 31 deletions(-) diff --git a/R/classes.R b/R/classes.R index 3d480243..c709575e 100644 --- a/R/classes.R +++ b/R/classes.R @@ -507,7 +507,7 @@ updateGiottoObject <- function(gobject) { # ! Any slot modifications should also be reflected in packedGiotto class ! #' @title S4 giotto Class -#' @description \pkg{Giotto}'s core object that encapsulates all the components +#' @description Giotto's core object that encapsulates all the components #' of a spatial-omic project and facilitates analyses. #' @concept giotto object #' @slot expression expression information diff --git a/R/combine_metadata.R b/R/combine_metadata.R index 60edcf7c..7611e1e8 100644 --- a/R/combine_metadata.R +++ b/R/combine_metadata.R @@ -9,7 +9,7 @@ #' @title combineMetadata #' @name combineMetadata #' @description This function combines the cell metadata with spatial locations -#' and enrichment results from \code{\link[Giotto]{runSpatialEnrich}} +#' and enrichment results from runSpatialEnrich. #' @param gobject Giotto object #' @param spat_unit spatial unit #' @param feat_type feature type diff --git a/R/create.R b/R/create.R index bfd88f41..d8c72b90 100644 --- a/R/create.R +++ b/R/create.R @@ -1297,8 +1297,8 @@ create_expr_obj <- function( provenance = NULL, misc = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_expr_obj()", - with = "Giotto::createExprObj()" + what = "create_expr_obj()", + with = "createExprObj()" ) if (is.null(exprMat)) exprMat <- matrix() @@ -1370,8 +1370,8 @@ create_cell_meta_obj <- function( feat_type = "rna", provenance = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_cell_meta_obj()", - with = "Giotto::createCellMetaObj()" + what = "create_cell_meta_obj()", + with = "createCellMetaObj()" ) if (is.null(col_desc)) col_desc <- NA_character_ @@ -1450,8 +1450,8 @@ create_feat_meta_obj <- function( feat_type = "rna", provenance = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_feat_meta_obj()", - with = "Giotto::createFeatMetaObj()" + what = "create_feat_meta_obj()", + with = "createFeatMetaObj()" ) if (is.null(col_desc)) col_desc <- NA_character_ @@ -1541,8 +1541,8 @@ create_dim_obj <- function( misc = NULL, my_rownames = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_dim_obj()", - with = "Giotto::createDimObj()" + what = "create_dim_obj()", + with = "createDimObj()" ) if (is.null(reduction_method)) reduction_method <- NA_character_ @@ -1638,8 +1638,8 @@ create_nn_net_obj <- function( provenance = NULL, misc = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_nn_net_obj()", - with = "Giotto::createNearestNetObj()" + what = "create_nn_net_obj()", + with = "createNearestNetObj()" ) if (is.null(nn_type)) nn_type <- NA_character_ @@ -1717,8 +1717,8 @@ create_spat_locs_obj <- function( provenance = NULL, misc = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_spat_locs_obj()", - with = "Giotto::createSpatLocsObj()" + what = "create_spat_locs_obj()", + with = "createSpatLocsObj()" ) # DT vars @@ -1826,8 +1826,8 @@ create_spat_net_obj <- function( provenance = NULL, misc = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_spat_net_obj()", - with = "Giotto::createSpatNetObj()" + what = "create_spat_net_obj()", + with = "createSpatNetObj()" ) if (is.null(method)) method <- NA_character_ @@ -1912,8 +1912,8 @@ create_spat_enr_obj <- function( provenance = NULL, misc = NULL) { deprecate_soft("3.3.0", - what = "Giotto::create_spat_enr_obj()", - with = "Giotto::createSpatEnrObj()" + what = "create_spat_enr_obj()", + with = "createSpatEnrObj()" ) if (is.null(method)) method <- NA_character_ diff --git a/R/generics.R b/R/generics.R index 6b76b940..87752166 100644 --- a/R/generics.R +++ b/R/generics.R @@ -64,7 +64,6 @@ setGeneric("reconnect", function(x, ...) standardGeneric("reconnect")) if (!isGeneric("nrow")) setOldClass("nrow") if (!isGeneric("ncol")) setOldClass("ncol") if (!isGeneric("dim")) setOldClass("dim") -# if(!isGeneric('t')) setOldClass('t', where = as.environment("package:Giotto")) ## colnames and rownames generics #### if (!isGeneric("colnames")) setOldClass("colnames") diff --git a/R/python_environment.R b/R/python_environment.R index 56101ba7..80d5fbaf 100644 --- a/R/python_environment.R +++ b/R/python_environment.R @@ -1,7 +1,7 @@ #' @title Giotto python environment #' @name giotto_python #' @description -#' \pkg{Giotto} has several functions that utilize python packages. To +#' Giotto has several functions that utilize python packages. To #' facilitate this, utilities are provided for creating, removing, and #' attaching python environments. Python environments are currently handled #' entirely through \pkg{reticulate}. @@ -82,7 +82,7 @@ #' repository for advanced installation and convenience. To install the most #' up-to-date Giotto environment using a .yml file, open a shell compatible #' with conda/miniconda and navigate to the directory specified by -#' `system.file(package = "Giotto", "python/configuration")`. Once in this +#' system.file(package = "Giotto", "python/configuration"). Once in this #' directory, run the following to create your environment in one step: #' #' \preformatted{conda env create -n giotto_env -f ./genv.yml} @@ -109,10 +109,10 @@ NULL #' @describeIn giotto_python #' #' - Based on `envname`, detect if there a conda or miniconda environment -#' accessible by \pkg{Giotto}. By default, the `envname` `"giotto_env"`, then +#' accessible by Giotto. By default, the `envname` `"giotto_env"`, then #' the option `"giotto.py_path"` is checked, but an alternative can be #' provided. -#' - Setting `envname` as `":auto:"` will let \pkg{Giotto} autodetect a python +#' - Setting `envname` as `":auto:"` will let Giotto autodetect a python #' env to use. See section for `set_giotto_python_path()` for details on the #' autodetection. #' - Returns `TRUE` if an env is detected and accessible by Giotto. `FALSE` @@ -475,7 +475,7 @@ checkGiottoEnvironment <- function(envname = NULL, #' \pkg{reticulate}. By default, the envname used will be `"giotto_env"`. If #' another name is used, you will have to provide that envname at the start of #' a session (see **Choosing an environment** above). \cr This includes a -#' miniconda installation and also a set of python packages that \pkg{Giotto} +#' miniconda installation and also a set of python packages that Giotto #' may often use. See details for further information on setting up an #' environment with a .yml #' - Returns `NULL` diff --git a/man/combineMetadata.Rd b/man/combineMetadata.Rd index 2de3c1ae..c55fd4d2 100644 --- a/man/combineMetadata.Rd +++ b/man/combineMetadata.Rd @@ -31,7 +31,7 @@ Extended cell metadata in data.table format. } \description{ This function combines the cell metadata with spatial locations -and enrichment results from \code{\link[Giotto]{runSpatialEnrich}} +and enrichment results from runSpatialEnrich. } \examples{ g <- GiottoData::loadGiottoMini("visium") diff --git a/man/giotto-class.Rd b/man/giotto-class.Rd index 2172cff7..2993377d 100644 --- a/man/giotto-class.Rd +++ b/man/giotto-class.Rd @@ -9,7 +9,7 @@ giotto object } \description{ -\pkg{Giotto}'s core object that encapsulates all the components +Giotto's core object that encapsulates all the components of a spatial-omic project and facilitates analyses. } \details{ diff --git a/man/giotto_python.Rd b/man/giotto_python.Rd index 25c1b6f0..fe59dd3e 100644 --- a/man/giotto_python.Rd +++ b/man/giotto_python.Rd @@ -76,7 +76,7 @@ executable.} \item{initialize}{force initialization of set python path. Default = TRUE.} } \description{ -\pkg{Giotto} has several functions that utilize python packages. To +Giotto has several functions that utilize python packages. To facilitate this, utilities are provided for creating, removing, and attaching python environments. Python environments are currently handled entirely through \pkg{reticulate}. @@ -127,10 +127,10 @@ function, which will find an environment and then initialize it. \itemize{ \item \code{checkGiottoEnvironment()}: \itemize{ \item Based on \code{envname}, detect if there a conda or miniconda environment -accessible by \pkg{Giotto}. By default, the \code{envname} \code{"giotto_env"}, then +accessible by Giotto. By default, the \code{envname} \code{"giotto_env"}, then the option \code{"giotto.py_path"} is checked, but an alternative can be provided. -\item Setting \code{envname} as \code{":auto:"} will let \pkg{Giotto} autodetect a python +\item Setting \code{envname} as \code{":auto:"} will let Giotto autodetect a python env to use. See section for \code{set_giotto_python_path()} for details on the autodetection. \item Returns \code{TRUE} if an env is detected and accessible by Giotto. \code{FALSE} @@ -142,7 +142,7 @@ if not. Will not initialize a python environment during detection. \pkg{reticulate}. By default, the envname used will be \code{"giotto_env"}. If another name is used, you will have to provide that envname at the start of a session (see \strong{Choosing an environment} above). \cr This includes a -miniconda installation and also a set of python packages that \pkg{Giotto} +miniconda installation and also a set of python packages that Giotto may often use. See details for further information on setting up an environment with a .yml \item Returns \code{NULL} @@ -212,7 +212,7 @@ Please note that multiple .yml files are provided in the repository for advanced installation and convenience. To install the most up-to-date Giotto environment using a .yml file, open a shell compatible with conda/miniconda and navigate to the directory specified by -\code{system.file(package = "Giotto", "python/configuration")}. Once in this +system.file(package = "Giotto", "python/configuration"). Once in this directory, run the following to create your environment in one step: \preformatted{conda env create -n giotto_env -f ./genv.yml} From dca0c4e688f1afd016843d475bedea8564d5ffd6 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 15:37:58 -0400 Subject: [PATCH 10/13] fix documentation warnings --- R/methods-extract.R | 4 +++- R/methods-nesting.R | 4 ++++ man/featType-generic.Rd | 5 +++++ man/spatUnit-generic.Rd | 5 +++++ man/subset_dollar.Rd | 8 ++++++++ man/subset_giotto.Rd | 8 ++++++++ 6 files changed, 33 insertions(+), 1 deletion(-) diff --git a/R/methods-extract.R b/R/methods-extract.R index dae973f3..20a355c0 100644 --- a/R/methods-extract.R +++ b/R/methods-extract.R @@ -157,7 +157,7 @@ NULL # $ S4 access generic #### ## * coordDataDT #### - +#' @describeIn subset_dollar Subset giotto object setMethod( "$", signature("giotto"), function(x, name) { spatValues(x, feats = name)[[name]] @@ -1173,6 +1173,7 @@ setMethod( } ) +#' @describeIn subset_giotto Subset giotto objects setMethod( "[", signature(x = "giotto", i = "missing", j = "missing", drop = "missing"), function(x, ...) { @@ -1481,6 +1482,7 @@ sliceGiotto <- function( #' @name as.list #' @title Coerce to a list +#' @aliases as.list,giotto #' @description Generic to coerce to a list if possible #' @param x the object to coerce #' @param slots character vector. Which data slots to include in list. See diff --git a/R/methods-nesting.R b/R/methods-nesting.R index 8670e34c..b2953ccc 100644 --- a/R/methods-nesting.R +++ b/R/methods-nesting.R @@ -65,6 +65,8 @@ NULL # spatUnit #### # default for unknown types +#' @describeIn spatUnit-generic Get spatial unit information +#' @export setMethod("spatUnit", signature("ANY"), function(x) { NA_character_ }) @@ -109,6 +111,8 @@ setMethod("spatUnit<-", signature("giottoPolygon"), function(x, value) { # featType #### # default for unknown types +#' @describeIn featType-generic Get feature type information +#' @export setMethod("featType", signature("ANY"), function(x) { NA_character_ }) diff --git a/man/featType-generic.Rd b/man/featType-generic.Rd index d1887f8d..1ff4d1a5 100644 --- a/man/featType-generic.Rd +++ b/man/featType-generic.Rd @@ -4,11 +4,14 @@ \alias{featType-generic} \alias{featType} \alias{featType<-} +\alias{featType,ANY-method} \alias{featType,list-method} \alias{featType,featData-method} \alias{featType<-,featData-method} \title{Feature type information} \usage{ +\S4method{featType}{ANY}(x) + \S4method{featType}{list}(x) \S4method{featType}{featData}(x) @@ -28,6 +31,8 @@ access and set feat_type slot of S4 subobject } \section{Functions}{ \itemize{ +\item \code{featType(ANY)}: Get feature type information + \item \code{featType(featData)}: Get feature type information \item \code{featType(featData) <- value}: Set feature type information diff --git a/man/spatUnit-generic.Rd b/man/spatUnit-generic.Rd index 79372945..2434f1fb 100644 --- a/man/spatUnit-generic.Rd +++ b/man/spatUnit-generic.Rd @@ -4,6 +4,7 @@ \alias{spatUnit-generic} \alias{spatUnit} \alias{spatUnit<-} +\alias{spatUnit,ANY-method} \alias{spatUnit,list-method} \alias{spatUnit,spatData-method} \alias{spatUnit,giottoPolygon-method} @@ -11,6 +12,8 @@ \alias{spatUnit<-,giottoPolygon-method} \title{Spatial unit information} \usage{ +\S4method{spatUnit}{ANY}(x) + \S4method{spatUnit}{list}(x) \S4method{spatUnit}{spatData}(x) @@ -34,6 +37,8 @@ access and set spat_unit slot of S4 subobject } \section{Functions}{ \itemize{ +\item \code{spatUnit(ANY)}: Get spatial unit information + \item \code{spatUnit(spatData)}: Get spatial unit information \item \code{spatUnit(giottoPolygon)}: Get spatial unit information diff --git a/man/subset_dollar.Rd b/man/subset_dollar.Rd index 554a9bd4..ba52ebe0 100644 --- a/man/subset_dollar.Rd +++ b/man/subset_dollar.Rd @@ -3,6 +3,7 @@ \name{subset_dollar} \alias{subset_dollar} \alias{`$`} +\alias{$,giotto-method} \alias{$,coordDataDT-method} \alias{$,spatEnrObj-method} \alias{$,dimObj-method} @@ -11,6 +12,8 @@ \alias{$,affine2d-method} \title{Subset part of an object with \code{$}} \usage{ +\S4method{$}{giotto}(x, name) + \S4method{$}{coordDataDT}(x, name) \S4method{$}{spatEnrObj}(x, name) @@ -35,6 +38,11 @@ vector of values from a requested column \description{ Subset values from a Giotto Class using \code{$} operator. } +\section{Functions}{ +\itemize{ +\item \code{$}: Subset giotto object + +}} \section{\code{`$`} methods}{ diff --git a/man/subset_giotto.Rd b/man/subset_giotto.Rd index 929ad547..43e6c239 100644 --- a/man/subset_giotto.Rd +++ b/man/subset_giotto.Rd @@ -6,6 +6,7 @@ \alias{[,giotto,gIndex,missing,missing-method} \alias{[,giotto,missing,gIndex,missing-method} \alias{[,giotto,gIndex,gIndex,missing-method} +\alias{[,giotto,missing,missing,missing-method} \alias{subset,giotto-method} \title{Subset a \code{giotto} object} \usage{ @@ -15,6 +16,8 @@ \S4method{[}{giotto,gIndex,gIndex,missing}(x, i, j, ..., drop = TRUE) +\S4method{[}{giotto,missing,missing,missing}(x, i, j, ..., drop = TRUE) + \S4method{subset}{giotto}( x, subset, @@ -62,6 +65,11 @@ Subset a giotto object with \code{[} or \code{subset()} generic. The implementation is different from \code{\link[=subsetGiotto]{subsetGiotto()}} in that all spatial units will always be affected. The feature type to subset can be specified. } +\section{Functions}{ +\itemize{ +\item \code{x[i}: Subset giotto objects + +}} \examples{ g <- GiottoData::loadGiottoMini("visium") From 7de30e23748b0de52c0492b6d56b042d09bb6a1e Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 15:38:11 -0400 Subject: [PATCH 11/13] change installation instruction --- .github/workflows/R-CMD-check.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 38d0aaac..521905a8 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -54,13 +54,17 @@ jobs: run: | Rscript -e "install.packages('pak')" + - name: Install remotes + run: | + Rscript -e "install.packages('remotes')" + - name: Install GiottoUtils run: | - Rscript -e "pak::pkg_install('drieslab/GiottoUtils@dev')" + Rscript -e "remotes::install_github('drieslab/GiottoUtils@dev')" - name: Install GiottoData run: | - Rscript -e "pak::pkg_install('drieslab/GiottoData')" + Rscript -e "remotes::install_github('drieslab/GiottoData')" - name: Install rcmdcheck run: | @@ -159,10 +163,6 @@ jobs: run: | Rscript -e "BiocManager::install('HDF5Array')" - - name: Install remotes - run: | - Rscript -e "BiocManager::install('remotes')" - - name: Install rgl run: | Rscript -e "BiocManager::install('rgl')" From dcc8ec5c36e1f2f4a996d953ad88e67a4840cb96 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Wed, 25 Sep 2024 15:56:48 -0400 Subject: [PATCH 12/13] run first bioccheck --- .github/workflows/R-CMD-check.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 521905a8..46f4e531 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -195,15 +195,12 @@ jobs: run: | Rscript -e "BiocManager::install('SummarizedExperiment')" + - name: Run BiocCheck + run: | + Rscript -e "BiocCheck::BiocCheck()" + - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' - - - - name: Run BiocCheck - run: | - Rscript -e "BiocCheck::BiocCheck()" - - From a348a4a6f9a898509346cbba7cabbee69a9e6f12 Mon Sep 17 00:00:00 2001 From: josschavezf Date: Thu, 26 Sep 2024 15:39:06 -0400 Subject: [PATCH 13/13] add returns value --- R/classes.R | 1 + R/methods-extract.R | 4 ++-- R/methods-nesting.R | 1 + R/methods-show.R | 2 ++ R/python_environment.R | 2 +- man/as.character.Rd | 3 +++ man/as.list.Rd | 1 + man/giottoAffineImage-class.Rd | 3 +++ man/giotto_python.Rd | 4 +++- man/objectlist_name_utils.Rd | 3 +++ man/show.Rd | 3 +++ man/subset_giotto.Rd | 4 +++- man/subset_giotto_subobjects.Rd | 4 +++- 13 files changed, 29 insertions(+), 6 deletions(-) diff --git a/R/classes.R b/R/classes.R index c709575e..604abfe9 100644 --- a/R/classes.R +++ b/R/classes.R @@ -1670,6 +1670,7 @@ giottoLargeImage <- setClass( #' transforms #' @slot funs list of functions associated with the object. Primarily to #' perform the delayed/lazy operations +#' @returns giottoAffineImage setClass( "giottoAffineImage", contains = c("giottoLargeImage"), diff --git a/R/methods-extract.R b/R/methods-extract.R index 20a355c0..8437f6c2 100644 --- a/R/methods-extract.R +++ b/R/methods-extract.R @@ -117,7 +117,7 @@ NULL #' cell_ids = c("GAATCGCCGGACACGG-1", "GAGGGCATCGCGTATC-1") #' ) #' subset(g, Gfap + Gna12 > 10) -#' +#' @returns giotto object NULL #' @title Subset `giotto` subobjects @@ -149,7 +149,7 @@ NULL #' # return as a subset giotto object with drop = FALSE #' g[[, "raw", drop = FALSE]] #' g[[spat_unit = "aggregate", drop = FALSE]] -#' +#' @returns giotto subobject NULL # --------------------------------------------------------------------------- # diff --git a/R/methods-nesting.R b/R/methods-nesting.R index b2953ccc..a95dbdbf 100644 --- a/R/methods-nesting.R +++ b/R/methods-nesting.R @@ -273,6 +273,7 @@ NULL #' @param force_replace logical. default = FALSE. Whether to replace the #' names of objects for which the name already has a name for #' @keywords internal +#' @returns list assign_objnames_2_list <- function(obj_list, force_replace = FALSE) { if (is.null(obj_list)) { return(obj_list) diff --git a/R/methods-show.R b/R/methods-show.R index ca0b72b6..39227cfe 100644 --- a/R/methods-show.R +++ b/R/methods-show.R @@ -7,6 +7,7 @@ NULL #' Create a text representation of an object #' @param x object #' @param ... additional params to pass (none implemented) +#' @returns character #' @examples #' img <- GiottoData::loadSubObjectMini("giottoLargeImage") #' as.character(img) @@ -628,6 +629,7 @@ setMethod( ## giottoPoints #### #' @rdname show +#' @returns giotto slot setMethod("show", signature = "giottoPoints", function(object) { cat("An object of class giottoPoints\n") .show_feat(object) diff --git a/R/python_environment.R b/R/python_environment.R index 80d5fbaf..35b3124e 100644 --- a/R/python_environment.R +++ b/R/python_environment.R @@ -500,7 +500,7 @@ checkGiottoEnvironment <- function(envname = NULL, #' temp_env <- tempdir() #' installGiottoEnvironment(mini_install_path = temp_env) #' } -#' +#' @returns installed Giotto environment #' @export installGiottoEnvironment <- function( packages_to_install = c( diff --git a/man/as.character.Rd b/man/as.character.Rd index a7a56969..21b006ee 100644 --- a/man/as.character.Rd +++ b/man/as.character.Rd @@ -15,6 +15,9 @@ \item{...}{additional params to pass (none implemented)} } +\value{ +character +} \description{ Create a text representation of an object } diff --git a/man/as.list.Rd b/man/as.list.Rd index 9e1bcb0c..9dca3c99 100644 --- a/man/as.list.Rd +++ b/man/as.list.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/methods-extract.R \name{as.list} \alias{as.list} +\alias{as.list,giotto} \title{Coerce to a list} \usage{ \S4method{as.list}{giotto}(x, slots, spat_unit = NULL, feat_type = NULL, name = NULL, ...) diff --git a/man/giottoAffineImage-class.Rd b/man/giottoAffineImage-class.Rd index d0b229d2..c145f43b 100644 --- a/man/giottoAffineImage-class.Rd +++ b/man/giottoAffineImage-class.Rd @@ -4,6 +4,9 @@ \name{giottoAffineImage-class} \alias{giottoAffineImage-class} \title{S4 giottoAffineImage Class} +\value{ +giottoAffineImage +} \description{ Class extending \code{giottoLargeImage}. When \code{shear()} or \code{spin()} operations are performed on diff --git a/man/giotto_python.Rd b/man/giotto_python.Rd index fe59dd3e..0f24ebdf 100644 --- a/man/giotto_python.Rd +++ b/man/giotto_python.Rd @@ -75,6 +75,9 @@ executable.} \item{initialize}{force initialization of set python path. Default = TRUE.} } +\value{ +installed Giotto environment +} \description{ Giotto has several functions that utilize python packages. To facilitate this, utilities are provided for creating, removing, and @@ -241,7 +244,6 @@ if (FALSE) { temp_env <- tempdir() installGiottoEnvironment(mini_install_path = temp_env) } - # detect AND initialize a python environment if (FALSE) { set_giotto_python_path() diff --git a/man/objectlist_name_utils.Rd b/man/objectlist_name_utils.Rd index cfa5026d..0d494250 100644 --- a/man/objectlist_name_utils.Rd +++ b/man/objectlist_name_utils.Rd @@ -28,6 +28,9 @@ used when printing verbose messages about what was made unique} \item{verbose}{be verbose} } +\value{ +list +} \description{ Name wrangling for subobject lists } diff --git a/man/show.Rd b/man/show.Rd index f32bad5f..2d8bfeab 100644 --- a/man/show.Rd +++ b/man/show.Rd @@ -61,6 +61,9 @@ \arguments{ \item{object}{object to show} } +\value{ +giotto slot +} \description{ Show methods for Giotto classes } diff --git a/man/subset_giotto.Rd b/man/subset_giotto.Rd index 43e6c239..8b136430 100644 --- a/man/subset_giotto.Rd +++ b/man/subset_giotto.Rd @@ -60,6 +60,9 @@ are selected} that may not be recommended since NSE output can be unexpected when not used interactively.} } +\value{ +giotto object +} \description{ Subset a giotto object with \code{[} or \code{subset()} generic. The implementation is different from \code{\link[=subsetGiotto]{subsetGiotto()}} in that all spatial units @@ -85,5 +88,4 @@ subset(g, nr_feats > 300, cell_ids = c("GAATCGCCGGACACGG-1", "GAGGGCATCGCGTATC-1") ) subset(g, Gfap + Gna12 > 10) - } diff --git a/man/subset_giotto_subobjects.Rd b/man/subset_giotto_subobjects.Rd index 144c16c1..2c489bd5 100644 --- a/man/subset_giotto_subobjects.Rd +++ b/man/subset_giotto_subobjects.Rd @@ -32,6 +32,9 @@ \item{j}{character. Indicates the subobject name} } +\value{ +giotto subobject +} \description{ Subset a \code{giotto} object with \code{[[} to disassemble it into a list of Giotto S4 subobjects. If \code{drop} is \code{FALSE}, the selected subobjects @@ -52,5 +55,4 @@ g[["expression", spat_unit = "aggregate"]] # return as a subset giotto object with drop = FALSE g[[, "raw", drop = FALSE]] g[[spat_unit = "aggregate", drop = FALSE]] - }