Skip to content

Commit

Permalink
Merge pull request #237 from josschavezf/dev
Browse files Browse the repository at this point in the history
fix warnings from biocchek and add github workflow
  • Loading branch information
josschavezf authored Sep 26, 2024
2 parents c0cca85 + a348a4a commit cf5558a
Show file tree
Hide file tree
Showing 25 changed files with 302 additions and 43 deletions.
206 changes: 206 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# 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'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-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 remotes
run: |
Rscript -e "install.packages('remotes')"
- name: Install GiottoUtils
run: |
Rscript -e "remotes::install_github('drieslab/GiottoUtils@dev')"
- name: Install GiottoData
run: |
Rscript -e "remotes::install_github('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')"
- 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 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')"
- 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")'

1 change: 0 additions & 1 deletion R/auxilliary.R
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,6 @@ calculateMetaTableCells <- function(
#' name = "norm_scaled_mean_metafeat"
#' )
#' showGiottoSpatEnrichments(g)
#' @seealso [GiottoVisuals::spatCellPlot()]
#' @export
createMetafeats <- function(
gobject,
Expand Down
3 changes: 2 additions & 1 deletion R/classes.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion R/combine_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 16 additions & 16 deletions R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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_
Expand Down Expand Up @@ -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_
Expand Down
1 change: 0 additions & 1 deletion R/generics.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 6 additions & 3 deletions R/methods-extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -149,15 +149,15 @@ NULL
#' # return as a subset giotto object with drop = FALSE
#' g[[, "raw", drop = FALSE]]
#' g[[spat_unit = "aggregate", drop = FALSE]]
#'
#' @returns giotto subobject
NULL

# --------------------------------------------------------------------------- #

# $ S4 access generic ####

## * coordDataDT ####

#' @describeIn subset_dollar Subset giotto object
setMethod(
"$", signature("giotto"), function(x, name) {
spatValues(x, feats = name)[[name]]
Expand Down Expand Up @@ -1173,6 +1173,7 @@ setMethod(
}
)

#' @describeIn subset_giotto Subset giotto objects
setMethod(
"[", signature(x = "giotto", i = "missing", j = "missing", drop = "missing"),
function(x, ...) {
Expand Down Expand Up @@ -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
Expand All @@ -1494,6 +1496,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, ...
Expand Down
Loading

0 comments on commit cf5558a

Please sign in to comment.