From c603c7656263bcb2868a78ef6c71d33052454497 Mon Sep 17 00:00:00 2001 From: George Chen <72078254+jiajic@users.noreply.github.com> Date: Mon, 28 Oct 2024 00:29:12 -0400 Subject: [PATCH 01/14] chore: deprecated accessor docs cleanup --- R/slot_accessors.R | 38 ++++++++++++++++++- man/get_NearestNetwork.Rd | 39 ------------------- man/get_cell_id.Rd | 30 --------------- man/get_cell_metadata.Rd | 41 -------------------- man/get_dimReduction.Rd | 43 --------------------- man/get_expression_values.Rd | 39 ------------------- man/get_feat_id.Rd | 49 ------------------------ man/get_feature_info.Rd | 35 ----------------- man/get_feature_metadata.Rd | 40 -------------------- man/get_giottoImage.Rd | 21 ----------- man/get_giottoImage_MG.Rd | 20 ---------- man/get_giottoLargeImage.Rd | 20 ---------- man/get_polygon_info.Rd | 37 ------------------ man/get_spatialGrid.Rd | 36 ------------------ man/get_spatialNetwork.Rd | 46 ----------------------- man/get_spatial_enrichment.Rd | 40 -------------------- man/get_spatial_locations.Rd | 46 ----------------------- man/setCellMetadata.Rd | 2 - man/setDimReduction.Rd | 2 - man/setExpression.Rd | 2 - man/setFeatureInfo.Rd | 2 - man/setFeatureMetadata.Rd | 2 - man/setGiotto.Rd | 2 - man/setGiottoImage.Rd | 2 - man/setMultiomics.Rd | 2 - man/setNearestNetwork.Rd | 2 - man/setPolygonInfo.Rd | 2 - man/setSpatialEnrichment.Rd | 2 - man/setSpatialGrid.Rd | 2 - man/setSpatialLocations.Rd | 2 - man/setSpatialNetwork.Rd | 2 - man/set_NearestNetwork.Rd | 51 ------------------------- man/set_cell_id.Rd | 51 ------------------------- man/set_cell_metadata.Rd | 46 ----------------------- man/set_dimReduction.Rd | 52 ------------------------- man/set_expression_values.Rd | 46 ----------------------- man/set_feat_id.Rd | 71 ----------------------------------- man/set_feature_info.Rd | 40 -------------------- man/set_feature_metadata.Rd | 46 ----------------------- man/set_giottoImage.Rd | 43 --------------------- man/set_giottoImage_MG.Rd | 25 ------------ man/set_giottoLargeImage.Rd | 25 ------------ man/set_multiomics.Rd | 4 +- man/set_polygon_info.Rd | 33 ---------------- man/set_spatialGrid.Rd | 39 ------------------- man/set_spatialNetwork.Rd | 43 --------------------- man/set_spatial_enrichment.Rd | 46 ----------------------- man/set_spatial_locations.Rd | 55 --------------------------- 48 files changed, 37 insertions(+), 1327 deletions(-) delete mode 100644 man/get_NearestNetwork.Rd delete mode 100644 man/get_cell_id.Rd delete mode 100644 man/get_cell_metadata.Rd delete mode 100644 man/get_dimReduction.Rd delete mode 100644 man/get_expression_values.Rd delete mode 100644 man/get_feat_id.Rd delete mode 100644 man/get_feature_info.Rd delete mode 100644 man/get_feature_metadata.Rd delete mode 100644 man/get_giottoImage.Rd delete mode 100644 man/get_giottoImage_MG.Rd delete mode 100644 man/get_giottoLargeImage.Rd delete mode 100644 man/get_polygon_info.Rd delete mode 100644 man/get_spatialGrid.Rd delete mode 100644 man/get_spatialNetwork.Rd delete mode 100644 man/get_spatial_enrichment.Rd delete mode 100644 man/get_spatial_locations.Rd delete mode 100644 man/set_NearestNetwork.Rd delete mode 100644 man/set_cell_id.Rd delete mode 100644 man/set_cell_metadata.Rd delete mode 100644 man/set_dimReduction.Rd delete mode 100644 man/set_expression_values.Rd delete mode 100644 man/set_feat_id.Rd delete mode 100644 man/set_feature_info.Rd delete mode 100644 man/set_feature_metadata.Rd delete mode 100644 man/set_giottoImage.Rd delete mode 100644 man/set_giottoImage_MG.Rd delete mode 100644 man/set_giottoLargeImage.Rd delete mode 100644 man/set_polygon_info.Rd delete mode 100644 man/set_spatialGrid.Rd delete mode 100644 man/set_spatialNetwork.Rd delete mode 100644 man/set_spatial_enrichment.Rd delete mode 100644 man/set_spatial_locations.Rd diff --git a/R/slot_accessors.R b/R/slot_accessors.R index ea49f966..fa70fd05 100644 --- a/R/slot_accessors.R +++ b/R/slot_accessors.R @@ -208,6 +208,7 @@ read_s4_nesting <- function(x) { #' setters for this slot directly retrieve (get) or replace (set) this slot. #' @seealso set_cell_id #' @keywords internal +#' @noRd get_cell_id <- function(gobject, spat_unit = NULL, set_defaults = TRUE) { @@ -251,6 +252,7 @@ get_cell_id <- function(gobject, #' on the giotto object. #' @seealso get_cell_id #' @keywords internal +#' @noRd set_cell_id <- function(gobject, spat_unit = NULL, cell_IDs, @@ -331,6 +333,7 @@ set_cell_id <- function(gobject, #' @seealso set_feat_id #' @family functions to set data in giotto object #' @keywords internal +#' @noRd get_feat_id <- function(gobject, feat_type = NULL, set_defaults = TRUE) { @@ -380,6 +383,7 @@ get_feat_id <- function(gobject, #' @seealso get_feat_id #' @family functions to set data in giotto object #' @keywords internal +#' @noRd set_feat_id <- function(gobject, feat_type = NULL, feat_IDs, @@ -581,7 +585,7 @@ set_feat_id <- function(gobject, #' @keywords internal #' @description Get cell metadata from giotto object #' @returns a data.table or cellMetaObj -#' @seealso pDataDT +#' @noRd get_cell_metadata <- function(gobject, spat_unit = NULL, feat_type = NULL, @@ -775,6 +779,7 @@ setCellMetadata <- function(gobject, #' @param verbose be verbose #' @returns giotto object #' @keywords internal +#' @noRd set_cell_metadata <- function(gobject, metadata, spat_unit = NULL, @@ -1001,6 +1006,7 @@ set_cell_metadata <- function(gobject, #' @returns a data.table or featMetaObj #' @seealso fDataDT #' @keywords internal +#' @noRd get_feature_metadata <- function(gobject, spat_unit = NULL, feat_type = NULL, @@ -1183,6 +1189,7 @@ setFeatureMetadata <- function(gobject, #' @param verbose be verbose #' @returns giotto object #' @keywords internal +#' @noRd set_feature_metadata <- function(gobject, metadata, spat_unit = NULL, @@ -1483,7 +1490,9 @@ getExpression <- function( #' @param output what object type to retrieve the expression as. Currently #' either matrix' for the matrix object contained in the exprObj or #' 'exprObj' (default) for the exprObj itself are allowed. +#' @keywords internal #' @returns exprObj or matrix depending on output param +#' @noRd get_expression_values <- function( gobject, spat_unit = NULL, @@ -1743,7 +1752,9 @@ setExpression <- function(gobject, #' @param verbose be verbose #' @param initialize (default = FALSE) whether to initialize the gobject before #' returning. Will be set to TRUE when called by the external +#' @keywords internal #' @returns giotto object +#' @noRd set_expression_values <- function(gobject, values, spat_unit = NULL, @@ -2236,6 +2247,7 @@ getSpatialLocations <- function(gobject, #' @param simplify logical. Whether or not to take object out of a list when #' there is a length of 1. #' @returns data.table with coordinates or spatLocsObj depending on \code{output} +#' @noRd get_spatial_locations <- function(gobject, spat_unit = NULL, spat_loc_name = NULL, @@ -2506,6 +2518,7 @@ setSpatialLocations <- function(gobject, #' the \code{spatLocsObj} will be nested by spat_unit 'nucleus' instead and #' its spat_unit slot will be changed to 'nucleus' #' @returns giotto object +#' @noRd set_spatial_locations <- function(gobject, spatlocs, spat_unit = NULL, @@ -2632,7 +2645,9 @@ set_spatial_locations <- function(gobject, #' @param output object type to return as. Either 'dimObj' (default) or 'matrix' #' of the embedding coordinates. #' @description Function to get a dimension reduction object +#' @keywords internal #' @returns dim reduction object (default) or dim reduction coordinates +#' @noRd get_dimReduction <- function(gobject, spat_unit = NULL, feat_type = NULL, @@ -2943,7 +2958,9 @@ setDimReduction <- function(gobject, #' @param dimObject dimension object result to set #' @param provenance provenance information (optional) #' @param verbose be verbose +#' @keywords internal #' @returns giotto object +#' @noRd set_dimReduction <- function(gobject, dimObject, spat_unit = NULL, @@ -3109,6 +3126,7 @@ set_dimReduction <- function(gobject, #' @param network_name name of NN network to be used #' @param output return a igraph or data.table object. Default 'igraph' #' @returns igraph or data.table object +#' @noRd get_NearestNetwork <- function(gobject, spat_unit = NULL, feat_type = NULL, @@ -3419,6 +3437,7 @@ setNearestNetwork <- function(gobject, #' @param verbose be verbose #' @returns giotto object #' @keywords internal +#' @noRd set_NearestNetwork <- function(gobject, nn_network, spat_unit = NULL, @@ -3568,6 +3587,7 @@ set_NearestNetwork <- function(gobject, #' @param simplify logical. Whether or not to take object out of a list when #' there is a length of 1. #' @returns spatialNetworkObj of data.table +#' @noRd get_spatialNetwork <- function(gobject, spat_unit = NULL, name = NULL, @@ -3913,6 +3933,7 @@ setSpatialNetwork <- function(gobject, #' @param spatial_network spatial network #' @param verbose be verbose #' @returns giotto object +#' @noRd set_spatialNetwork <- function(gobject, spatial_network, spat_unit = NULL, @@ -4033,6 +4054,7 @@ set_spatialNetwork <- function(gobject, #' @param name name of spatial grid #' @param return_grid_Obj return grid object (default = FALSE) #' @returns spatialGridObj +#' @noRd get_spatialGrid <- function(gobject, spat_unit = NULL, feat_type = NULL, @@ -4173,6 +4195,7 @@ getSpatialGrid <- function(gobject, #' @param name name of spatial grid #' @param verbose be verbose #' @returns giotto object +#' @noRd set_spatialGrid <- function(gobject, spatial_grid, spat_unit = NULL, @@ -4314,6 +4337,7 @@ setSpatialGrid <- function(gobject, #' @param simplify logical. Whether or not to take object out of a list when #' there is a length of 1. #' @returns spatVector +#' @noRd get_polygon_info <- function(gobject, polygon_name = NULL, polygon_overlap = NULL, @@ -4646,6 +4670,7 @@ setPolygonInfo <- function(gobject, #' @param gpolygon giottoPolygon object #' @param verbose be verbose #' @returns giotto object +#' @noRd set_polygon_info <- function(gobject, gpolygon, polygon_name = "cell", @@ -4843,6 +4868,7 @@ getFeatureInfo <- function(gobject = gobject, #' @description Get giotto points spatVector #' @returns a SpatVector (default) or giottoPoints object depending on value of #' return_giottoPoints +#' @noRd get_feature_info <- function(gobject, feat_type = NULL, set_defaults = TRUE, @@ -5023,6 +5049,7 @@ setFeatureInfo <- function(gobject, #' @param gpolygon typo do not use #' @param verbose be verbose #' @returns giotto object +#' @noRd set_feature_info <- function(gobject, gpoints, feat_type = NULL, @@ -5187,6 +5214,7 @@ set_feature_info <- function(gobject, #' @inheritParams data_access_params #' @param enrichm_name name of spatial enrichment results. Default "DWLS" #' @returns spatEnrObj or data.table with fractions +#' @noRd get_spatial_enrichment <- function(gobject, spat_unit = NULL, feat_type = NULL, @@ -5460,6 +5488,7 @@ setSpatialEnrichment <- function(gobject, #' @param provenance provenance information (optional) #' @param verbose be verbose #' @returns giotto object +#' @noRd set_spatial_enrichment <- function(gobject, spatenrichment, spat_unit = NULL, @@ -5596,6 +5625,7 @@ set_spatial_enrichment <- function(gobject, #' @param name name of giottoImage \code{\link{showGiottoImageNames}} #' @returns a giottoImage #' @keywords internal +#' @noRd get_giottoImage_MG <- function(gobject, name = NULL) { g_image_names <- list_images(gobject, img_type = "image") @@ -5629,6 +5659,7 @@ get_giottoImage_MG <- function(gobject, #' @param verbose be verbose #' @returns giotto object #' @keywords internal +#' @noRd set_giottoImage_MG <- function(gobject, image_object, name = NULL, @@ -5668,6 +5699,7 @@ set_giottoImage_MG <- function(gobject, #' @param name name of giottoLargeImage \code{\link{showGiottoImageNames}} #' @returns a giottoLargeImage #' @keywords internal +#' @noRd get_giottoLargeImage <- function(gobject, name = NULL) { g_image_names <- list_images(gobject, img_type = "largeImage") @@ -5701,6 +5733,7 @@ get_giottoLargeImage <- function(gobject, #' @param verbose be verbose #' @returns giotto object #' @keywords internal +#' @noRd set_giottoLargeImage <- function(gobject, largeImage_object, name = NULL, @@ -5742,6 +5775,7 @@ set_giottoLargeImage <- function(gobject, #' @param image_type deprecated #' @param name name of a giotto image object \code{\link{showGiottoImageNames}} #' @returns a giotto image object +#' @noRd get_giottoImage <- function(gobject = NULL, image_type = NULL, name = NULL) { @@ -5842,7 +5876,7 @@ get_giotto_image_list <- function(gobject, #' @param name name of giotto image object #' @param verbose be verbose #' @returns giotto object -#' @seealso \code{\link{addGiottoImage}} +#' @noRd set_giottoImage <- function(gobject = NULL, image = NULL, image_type = NULL, diff --git a/man/get_NearestNetwork.Rd b/man/get_NearestNetwork.Rd deleted file mode 100644 index e95b3d8d..00000000 --- a/man/get_NearestNetwork.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_NearestNetwork} -\alias{get_NearestNetwork} -\title{Get nearest network} -\usage{ -get_NearestNetwork( - gobject, - spat_unit = NULL, - feat_type = NULL, - nn_network_to_use = NULL, - network_name = NULL, - output = c("nnNetObj", "igraph", "data.table"), - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{nn_network_to_use}{"kNN" or "sNN"} - -\item{network_name}{name of NN network to be used} - -\item{output}{return a igraph or data.table object. Default 'igraph'} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -igraph or data.table object -} -\description{ -Get a NN-network from a Giotto object -} diff --git a/man/get_cell_id.Rd b/man/get_cell_id.Rd deleted file mode 100644 index bf3dd4c7..00000000 --- a/man/get_cell_id.Rd +++ /dev/null @@ -1,30 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_cell_id} -\alias{get_cell_id} -\title{Get cell IDs for a given spatial unit} -\usage{ -get_cell_id(gobject, spat_unit = NULL, set_defaults = TRUE) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -character vector of cell_IDs -} -\description{ -Data for each spatial unit is expected to agree on a single -set of cell_IDs that are shared across any feature types. These cell_IDs -are stored within the giotto object's \code{cell_ID} slot. Getters and -setters for this slot directly retrieve (get) or replace (set) this slot. -} -\seealso{ -set_cell_id -} -\keyword{internal} diff --git a/man/get_cell_metadata.Rd b/man/get_cell_metadata.Rd deleted file mode 100644 index c4f708cb..00000000 --- a/man/get_cell_metadata.Rd +++ /dev/null @@ -1,41 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_cell_metadata} -\alias{get_cell_metadata} -\title{Get cell metadata} -\usage{ -get_cell_metadata( - gobject, - spat_unit = NULL, - feat_type = NULL, - output = c("cellMetaObj", "data.table"), - copy_obj = TRUE, - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{output}{return as either 'data.table' or 'cellMetaObj'} - -\item{copy_obj}{whether to deep copy/duplicate when getting the object -(default = TRUE)} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -a data.table or cellMetaObj -} -\description{ -Get cell metadata from giotto object -} -\seealso{ -pDataDT -} -\keyword{internal} diff --git a/man/get_dimReduction.Rd b/man/get_dimReduction.Rd deleted file mode 100644 index fcece087..00000000 --- a/man/get_dimReduction.Rd +++ /dev/null @@ -1,43 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_dimReduction} -\alias{get_dimReduction} -\title{Get dimension reduction} -\usage{ -get_dimReduction( - gobject, - spat_unit = NULL, - feat_type = NULL, - reduction = c("cells", "feats"), - reduction_method = NULL, - name = NULL, - output = c("dimObj", "matrix"), - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{reduction}{reduction on cells or features (e.g. "cells", "feats")} - -\item{reduction_method}{reduction method (e.g. "pca", "umap", "tsne")} - -\item{name}{name of reduction results} - -\item{output}{object type to return as. Either 'dimObj' (default) or 'matrix' -of the embedding coordinates.} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -dim reduction object (default) or dim reduction coordinates -} -\description{ -Function to get a dimension reduction object -} diff --git a/man/get_expression_values.Rd b/man/get_expression_values.Rd deleted file mode 100644 index 110a6d19..00000000 --- a/man/get_expression_values.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_expression_values} -\alias{get_expression_values} -\title{get_expression_values} -\usage{ -get_expression_values( - gobject, - spat_unit = NULL, - feat_type = NULL, - values = c("raw", "normalized", "scaled"), - output = c("exprObj", "matrix"), - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{values}{expression values to -extract (e.g. "raw", "normalized", "scaled")} - -\item{output}{what object type to retrieve the expression as. Currently -either matrix' for the matrix object contained in the exprObj or -'exprObj' (default) for the exprObj itself are allowed.} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -exprObj or matrix depending on output param -} -\description{ -get_expression_values -} diff --git a/man/get_feat_id.Rd b/man/get_feat_id.Rd deleted file mode 100644 index c56ac215..00000000 --- a/man/get_feat_id.Rd +++ /dev/null @@ -1,49 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_feat_id} -\alias{get_feat_id} -\title{Get feat IDs for a given feature type} -\usage{ -get_feat_id(gobject, feat_type = NULL, set_defaults = TRUE) -} -\arguments{ -\item{gobject}{giotto object} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -character -} -\description{ -Across a single modality/feature type, all feature information -is expected to share a single set of feat_IDs. These feat_IDs are stored -within the giotto object's \code{feat_ID} slot. Getters and setters for this -slot directly (get) or replace (set) this slot. -} -\seealso{ -set_feat_id - -Other functions to set data in giotto object: -\code{\link{setCellMetadata}()}, -\code{\link{setDimReduction}()}, -\code{\link{setExpression}()}, -\code{\link{setFeatureInfo}()}, -\code{\link{setFeatureMetadata}()}, -\code{\link{setGiotto}()}, -\code{\link{setGiottoImage}()}, -\code{\link{setMultiomics}()}, -\code{\link{setNearestNetwork}()}, -\code{\link{setPolygonInfo}()}, -\code{\link{setSpatialEnrichment}()}, -\code{\link{setSpatialGrid}()}, -\code{\link{setSpatialLocations}()}, -\code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, -\code{\link{set_multiomics}()} -} -\concept{functions to set data in giotto object} -\keyword{internal} diff --git a/man/get_feature_info.Rd b/man/get_feature_info.Rd deleted file mode 100644 index d124327e..00000000 --- a/man/get_feature_info.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_feature_info} -\alias{get_feature_info} -\title{Get feature info} -\usage{ -get_feature_info( - gobject, - feat_type = NULL, - set_defaults = TRUE, - return_giottoPoints = FALSE, - simplify = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{return_giottoPoints}{return as a giottoPoints object} - -\item{simplify}{logical. Whether or not to take object out of a list when -there is a length of 1.} -} -\value{ -a SpatVector (default) or giottoPoints object depending on value of -return_giottoPoints -} -\description{ -Get giotto points spatVector -} diff --git a/man/get_feature_metadata.Rd b/man/get_feature_metadata.Rd deleted file mode 100644 index 72f57c29..00000000 --- a/man/get_feature_metadata.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_feature_metadata} -\alias{get_feature_metadata} -\title{Get feature metadata} -\usage{ -get_feature_metadata( - gobject, - spat_unit = NULL, - feat_type = NULL, - output = c("featMetaObj", "data.table"), - copy_obj = TRUE, - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{output}{return as either 'data.table' or 'featMetaObj'} - -\item{copy_obj}{whether to perform a deepcopy of the data.table information} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -a data.table or featMetaObj -} -\description{ -Get feature metadata from giotto object -} -\seealso{ -fDataDT -} -\keyword{internal} diff --git a/man/get_giottoImage.Rd b/man/get_giottoImage.Rd deleted file mode 100644 index 6bbde027..00000000 --- a/man/get_giottoImage.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_giottoImage} -\alias{get_giottoImage} -\title{Get giotto image object} -\usage{ -get_giottoImage(gobject = NULL, image_type = NULL, name = NULL) -} -\arguments{ -\item{gobject}{giotto object} - -\item{image_type}{deprecated} - -\item{name}{name of a giotto image object \code{\link{showGiottoImageNames}}} -} -\value{ -a giotto image object -} -\description{ -Get giotto image object from gobject -} diff --git a/man/get_giottoImage_MG.Rd b/man/get_giottoImage_MG.Rd deleted file mode 100644 index 3a28437c..00000000 --- a/man/get_giottoImage_MG.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_giottoImage_MG} -\alias{get_giottoImage_MG} -\title{Get \emph{magick}-based giotto \code{image}} -\usage{ -get_giottoImage_MG(gobject, name = NULL) -} -\arguments{ -\item{gobject}{giotto object} - -\item{name}{name of giottoImage \code{\link{showGiottoImageNames}}} -} -\value{ -a giottoImage -} -\description{ -Get a giottoImage from a giotto object -} -\keyword{internal} diff --git a/man/get_giottoLargeImage.Rd b/man/get_giottoLargeImage.Rd deleted file mode 100644 index bd3af696..00000000 --- a/man/get_giottoLargeImage.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_giottoLargeImage} -\alias{get_giottoLargeImage} -\title{Get \emph{terra}-based giotto \code{largeImage}} -\usage{ -get_giottoLargeImage(gobject, name = NULL) -} -\arguments{ -\item{gobject}{giotto object} - -\item{name}{name of giottoLargeImage \code{\link{showGiottoImageNames}}} -} -\value{ -a giottoLargeImage -} -\description{ -Set a giottoLargeImage from a giottoObject -} -\keyword{internal} diff --git a/man/get_polygon_info.Rd b/man/get_polygon_info.Rd deleted file mode 100644 index dbdd8286..00000000 --- a/man/get_polygon_info.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_polygon_info} -\alias{get_polygon_info} -\title{Get polygon info} -\usage{ -get_polygon_info( - gobject, - polygon_name = NULL, - polygon_overlap = NULL, - return_giottoPolygon = FALSE, - verbose = TRUE, - simplify = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{polygon_name}{name of polygons. Default "cell"} - -\item{polygon_overlap}{if not NULL, return specified polygon overlap -information} - -\item{return_giottoPolygon}{(Defaults to FALSE) Return as giottoPolygon S4 -object} - -\item{verbose}{be verbose} - -\item{simplify}{logical. Whether or not to take object out of a list when -there is a length of 1.} -} -\value{ -spatVector -} -\description{ -Get giotto polygon spatVector -} diff --git a/man/get_spatialGrid.Rd b/man/get_spatialGrid.Rd deleted file mode 100644 index 5089f89b..00000000 --- a/man/get_spatialGrid.Rd +++ /dev/null @@ -1,36 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_spatialGrid} -\alias{get_spatialGrid} -\title{Get spatial grid} -\usage{ -get_spatialGrid( - gobject, - spat_unit = NULL, - feat_type = NULL, - name = NULL, - return_grid_Obj = FALSE, - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{name}{name of spatial grid} - -\item{return_grid_Obj}{return grid object (default = FALSE)} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -spatialGridObj -} -\description{ -Function to get spatial grid -} diff --git a/man/get_spatialNetwork.Rd b/man/get_spatialNetwork.Rd deleted file mode 100644 index e1b8e893..00000000 --- a/man/get_spatialNetwork.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_spatialNetwork} -\alias{get_spatialNetwork} -\title{Get spatial network} -\usage{ -get_spatialNetwork( - gobject, - spat_unit = NULL, - name = NULL, - output = c("spatialNetworkObj", "networkDT", "networkDT_before_filter", "outputObj"), - set_defaults = TRUE, - copy_obj = TRUE, - verbose = TRUE, - simplify = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{name}{name of spatial network} - -\item{output}{object type to return as. Options: -'spatialNetworkObj' (default), -'networkDT' and 'networkDT_before_filter' for data.table outputs.} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{copy_obj}{whether to copy/duplicate when getting the -object (default = TRUE)} - -\item{verbose}{be verbose} - -\item{simplify}{logical. Whether or not to take object out of a list when -there is a length of 1.} -} -\value{ -spatialNetworkObj of data.table -} -\description{ -Function to get a spatial network -} diff --git a/man/get_spatial_enrichment.Rd b/man/get_spatial_enrichment.Rd deleted file mode 100644 index 7dd0a1ac..00000000 --- a/man/get_spatial_enrichment.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_spatial_enrichment} -\alias{get_spatial_enrichment} -\title{Get spatial enrichment} -\usage{ -get_spatial_enrichment( - gobject, - spat_unit = NULL, - feat_type = NULL, - enrichm_name = "DWLS", - output = c("spatEnrObj", "data.table"), - copy_obj = TRUE, - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{enrichm_name}{name of spatial enrichment results. Default "DWLS"} - -\item{output}{what format in which to get information (e.g. "data.table")} - -\item{copy_obj}{whether to deep copy/duplicate when getting the object -(default = TRUE)} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -spatEnrObj or data.table with fractions -} -\description{ -Function to get a spatial enrichment data.table -} diff --git a/man/get_spatial_locations.Rd b/man/get_spatial_locations.Rd deleted file mode 100644 index ac08e1e5..00000000 --- a/man/get_spatial_locations.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{get_spatial_locations} -\alias{get_spatial_locations} -\title{Get spatial locations} -\usage{ -get_spatial_locations( - gobject, - spat_unit = NULL, - spat_loc_name = NULL, - output = c("spatLocsObj", "data.table"), - copy_obj = TRUE, - verbose = TRUE, - set_defaults = TRUE, - simplify = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{spat_loc_name}{name of spatial -locations (defaults to first name in spatial_locs slot, e.g. "raw")} - -\item{output}{what object type to get the spatial locations as. Default is as -a 'spatLocsObj'. Returning as 'data.table' is also possible.} - -\item{copy_obj}{whether to copy/duplicate when getting the -object (default = TRUE)} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{simplify}{logical. Whether or not to take object out of a list when -there is a length of 1.} -} -\value{ -data.table with coordinates or spatLocsObj depending on \code{output} -} -\description{ -Function to get a spatial location data.table -} diff --git a/man/setCellMetadata.Rd b/man/setCellMetadata.Rd index c1740f5d..e534933d 100644 --- a/man/setCellMetadata.Rd +++ b/man/setCellMetadata.Rd @@ -52,7 +52,6 @@ setCellMetadata(gobject = g, x = createCellMetaObj(m2)) } \seealso{ Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, \code{\link{setFeatureInfo}()}, @@ -66,7 +65,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setDimReduction.Rd b/man/setDimReduction.Rd index 9dd191e2..37818c2a 100644 --- a/man/setDimReduction.Rd +++ b/man/setDimReduction.Rd @@ -61,7 +61,6 @@ Other dimensional reduction data accessor functions: \code{\link{getDimReduction}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setExpression}()}, \code{\link{setFeatureInfo}()}, @@ -75,7 +74,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{dimensional reduction data accessor functions} diff --git a/man/setExpression.Rd b/man/setExpression.Rd index cf1344a3..cc7be0ea 100644 --- a/man/setExpression.Rd +++ b/man/setExpression.Rd @@ -58,7 +58,6 @@ Other expression accessor functions: \code{\link{getExpression}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setFeatureInfo}()}, @@ -72,7 +71,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{expression accessor functions} diff --git a/man/setFeatureInfo.Rd b/man/setFeatureInfo.Rd index 5710d4fd..b19037ac 100644 --- a/man/setFeatureInfo.Rd +++ b/man/setFeatureInfo.Rd @@ -45,7 +45,6 @@ Other feature info data accessor functions: \code{\link{getFeatureInfo}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -59,7 +58,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{feature info data accessor functions} diff --git a/man/setFeatureMetadata.Rd b/man/setFeatureMetadata.Rd index 8edceeb7..a7f8bf91 100644 --- a/man/setFeatureMetadata.Rd +++ b/man/setFeatureMetadata.Rd @@ -52,7 +52,6 @@ setFeatureMetadata(gobject = g, x = createFeatMetaObj(m2)) } \seealso{ Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -66,7 +65,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setGiotto.Rd b/man/setGiotto.Rd index 93faebe6..67caab60 100644 --- a/man/setGiotto.Rd +++ b/man/setGiotto.Rd @@ -66,7 +66,6 @@ setGiotto(gobject = g, x = g_expression) } \seealso{ Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -80,7 +79,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setGiottoImage.Rd b/man/setGiottoImage.Rd index b74e9f0c..15106fed 100644 --- a/man/setGiottoImage.Rd +++ b/man/setGiottoImage.Rd @@ -46,7 +46,6 @@ Other image data accessor functions: \code{\link{getGiottoImage}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -60,7 +59,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setMultiomics.Rd b/man/setMultiomics.Rd index ef3d33eb..78d9a352 100644 --- a/man/setMultiomics.Rd +++ b/man/setMultiomics.Rd @@ -54,7 +54,6 @@ Other multiomics accessor functions: \code{\link{set_multiomics}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -68,7 +67,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setNearestNetwork.Rd b/man/setNearestNetwork.Rd index ca1059d3..2ee260f4 100644 --- a/man/setNearestNetwork.Rd +++ b/man/setNearestNetwork.Rd @@ -58,7 +58,6 @@ Other expression space nearest network accessor functions: \code{\link{getNearestNetwork}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -72,7 +71,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{expression space nearest network accessor functions} diff --git a/man/setPolygonInfo.Rd b/man/setPolygonInfo.Rd index 4c405996..20aeb3cd 100644 --- a/man/setPolygonInfo.Rd +++ b/man/setPolygonInfo.Rd @@ -60,7 +60,6 @@ Other polygon info data accessor functions: \code{\link{getPolygonInfo}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -74,7 +73,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setSpatialEnrichment.Rd b/man/setSpatialEnrichment.Rd index 1426738d..8b9ed631 100644 --- a/man/setSpatialEnrichment.Rd +++ b/man/setSpatialEnrichment.Rd @@ -54,7 +54,6 @@ Other spatial enrichment data accessor functions: \code{\link{getSpatialEnrichment}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -68,7 +67,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setSpatialGrid.Rd b/man/setSpatialGrid.Rd index 9eb7886a..6d91c9fc 100644 --- a/man/setSpatialGrid.Rd +++ b/man/setSpatialGrid.Rd @@ -52,7 +52,6 @@ Other spatial grid data accessor functions: \code{\link{getSpatialGrid}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -66,7 +65,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialEnrichment}()}, \code{\link{setSpatialLocations}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setSpatialLocations.Rd b/man/setSpatialLocations.Rd index c32e8eb2..44cf7c62 100644 --- a/man/setSpatialLocations.Rd +++ b/man/setSpatialLocations.Rd @@ -57,7 +57,6 @@ Other spatial location data accessor functions: \code{\link{getSpatialLocations}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -71,7 +70,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialEnrichment}()}, \code{\link{setSpatialGrid}()}, \code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/setSpatialNetwork.Rd b/man/setSpatialNetwork.Rd index 1c35d3a8..f1ddfd74 100644 --- a/man/setSpatialNetwork.Rd +++ b/man/setSpatialNetwork.Rd @@ -51,7 +51,6 @@ Other spatial network data accessor functions: \code{\link{getSpatialNetwork}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -65,7 +64,6 @@ Other functions to set data in giotto object: \code{\link{setSpatialEnrichment}()}, \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, -\code{\link{set_feat_id}()}, \code{\link{set_multiomics}()} } \concept{functions to set data in giotto object} diff --git a/man/set_NearestNetwork.Rd b/man/set_NearestNetwork.Rd deleted file mode 100644 index 9c1dffe3..00000000 --- a/man/set_NearestNetwork.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_NearestNetwork} -\alias{set_NearestNetwork} -\title{Set nearest network} -\usage{ -set_NearestNetwork( - gobject, - nn_network, - spat_unit = NULL, - feat_type = NULL, - nn_network_to_use = "sNN", - network_name = "sNN.pca", - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{nn_network}{nnNetObj or igraph nearest network object. Data.table not -yet supported.} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{nn_network_to_use}{"kNN" or "sNN"} - -\item{network_name}{name of NN network to be used} - -\item{provenance}{provenance information (optional)} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Set a NN-network for a Giotto object -} -\keyword{internal} diff --git a/man/set_cell_id.Rd b/man/set_cell_id.Rd deleted file mode 100644 index 581a2d5c..00000000 --- a/man/set_cell_id.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_cell_id} -\alias{set_cell_id} -\title{Set cell IDs for a given spatial unit} -\usage{ -set_cell_id( - gobject, - spat_unit = NULL, - cell_IDs, - set_defaults = TRUE, - verbose = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{cell_IDs}{character vector of cell IDs to set. (See details)} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{verbose}{be verbose} -} -\value{ -giotto object with set cell_ID slot -} -\description{ -Setter function for the cell_ID slot. Directly replaces (sets) -this slot -} -\details{ -Data for each spatial unit is expected to agree on a single set of cell_IDs -that are shared across any feature types. These cell_IDs are stored within -the giotto object's \code{cell_ID} slot. \cr - -Pass \code{NULL} to \code{cell_IDs} param in order to delete the entry. \cr -Pass \code{'initialize'} to \code{cell_IDs} param in order to initialize the -specified entry. \cr - -\strong{NOTE:} The main purpose of the setter is to initialize, as cell_ID -values are AUTOMATICALLY updated every time \code{initialize()} is called -on the giotto object. -} -\seealso{ -get_cell_id -} -\keyword{internal} diff --git a/man/set_cell_metadata.Rd b/man/set_cell_metadata.Rd deleted file mode 100644 index 077a9a13..00000000 --- a/man/set_cell_metadata.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_cell_metadata} -\alias{set_cell_metadata} -\title{Set cell metadata} -\usage{ -set_cell_metadata( - gobject, - metadata, - spat_unit = NULL, - feat_type = NULL, - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{metadata}{cellMetaObj or data.table containing cell metadata. -Setting NULL will remove the object. Passing 'initialize' will reset -the object.} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{provenance}{provenance information to set} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Function to set cell metadata information into giotto object -} -\keyword{internal} diff --git a/man/set_dimReduction.Rd b/man/set_dimReduction.Rd deleted file mode 100644 index ebd3948e..00000000 --- a/man/set_dimReduction.Rd +++ /dev/null @@ -1,52 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_dimReduction} -\alias{set_dimReduction} -\title{Set dimension reduction} -\usage{ -set_dimReduction( - gobject, - dimObject, - spat_unit = NULL, - feat_type = NULL, - reduction = c("cells", "feats"), - reduction_method = c("pca", "umap", "tsne"), - name = "pca", - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{dimObject}{dimension object result to set} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{reduction}{reduction on cells or features} - -\item{reduction_method}{reduction method (e.g. "pca")} - -\item{name}{name of reduction results} - -\item{provenance}{provenance information (optional)} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Function to set a dimension reduction slot -} diff --git a/man/set_expression_values.Rd b/man/set_expression_values.Rd deleted file mode 100644 index 7483f84c..00000000 --- a/man/set_expression_values.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_expression_values} -\alias{set_expression_values} -\title{Set expression values} -\usage{ -set_expression_values( - gobject, - values, - spat_unit = NULL, - feat_type = NULL, - name = "test", - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{values}{exprObj If NULL, then the object will be removed.} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{name}{name for the expression slot} - -\item{provenance}{provenance information (optional)} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning. Will be set to TRUE when called by the external} -} -\value{ -giotto object -} -\description{ -Function to set expression values for giotto object -} diff --git a/man/set_feat_id.Rd b/man/set_feat_id.Rd deleted file mode 100644 index b127d47c..00000000 --- a/man/set_feat_id.Rd +++ /dev/null @@ -1,71 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_feat_id} -\alias{set_feat_id} -\title{Set feat IDs for a given feature type} -\usage{ -set_feat_id( - gobject, - feat_type = NULL, - feat_IDs, - set_defaults = TRUE, - verbose = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{feat_IDs}{character vector of feature IDs to set.} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{verbose}{be verbose} -} -\value{ -giotto object with set cell_ID slot -} -\description{ -Setter function for the feat_ID slot. Directly replaces (sets) -this slot -} -\details{ -Across a single modality/feature type, and within a spatial unit, all feature -information is expected to share a single set of feat_IDs. These feat_IDs -are stored within the giotto object's \code{feat_ID} slot separated by -feat_type. \cr - -Pass \code{NULL} to \code{feat_IDs} param in order to delete the entry. \cr -Pass \code{'initialize'} to \code{feat_IDs} param in order to initialize the -specified entry. \cr - -\strong{NOTE:} The main purpose of the setter is to initialize, as feat_ID -values are AUTOMATICALLY updated every time \code{initialize()} is called on -the giotto object. -} -\seealso{ -get_feat_id - -Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, -\code{\link{setCellMetadata}()}, -\code{\link{setDimReduction}()}, -\code{\link{setExpression}()}, -\code{\link{setFeatureInfo}()}, -\code{\link{setFeatureMetadata}()}, -\code{\link{setGiotto}()}, -\code{\link{setGiottoImage}()}, -\code{\link{setMultiomics}()}, -\code{\link{setNearestNetwork}()}, -\code{\link{setPolygonInfo}()}, -\code{\link{setSpatialEnrichment}()}, -\code{\link{setSpatialGrid}()}, -\code{\link{setSpatialLocations}()}, -\code{\link{setSpatialNetwork}()}, -\code{\link{set_multiomics}()} -} -\concept{functions to set data in giotto object} -\keyword{internal} diff --git a/man/set_feature_info.Rd b/man/set_feature_info.Rd deleted file mode 100644 index d354e706..00000000 --- a/man/set_feature_info.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_feature_info} -\alias{set_feature_info} -\title{Set feature info} -\usage{ -set_feature_info( - gobject, - gpoints, - feat_type = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE, - gpolygon = NULL -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{gpoints}{giotto points object} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} - -\item{gpolygon}{typo do not use} -} -\value{ -giotto object -} -\description{ -Set giotto polygon spatVector for features -} diff --git a/man/set_feature_metadata.Rd b/man/set_feature_metadata.Rd deleted file mode 100644 index 4cd28b6e..00000000 --- a/man/set_feature_metadata.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_feature_metadata} -\alias{set_feature_metadata} -\title{Set feature metadata} -\usage{ -set_feature_metadata( - gobject, - metadata, - spat_unit = NULL, - feat_type = NULL, - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{metadata}{featMetaObj or data.table containing feature metadata. -Setting NULL will remove the object. Passing 'initialize' will reset the -object.} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{provenance}{provenance information to set} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Function to set feature metadata information into giotto object -} -\keyword{internal} diff --git a/man/set_giottoImage.Rd b/man/set_giottoImage.Rd deleted file mode 100644 index 48a9b7d0..00000000 --- a/man/set_giottoImage.Rd +++ /dev/null @@ -1,43 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_giottoImage} -\alias{set_giottoImage} -\title{Set giotto image object} -\usage{ -set_giottoImage( - gobject = NULL, - image = NULL, - image_type = NULL, - name = NULL, - verbose = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{image}{giotto image object to be attached without modification to the -giotto object} - -\item{image_type}{deprecated} - -\item{name}{name of giotto image object} - -\item{verbose}{be verbose} -} -\value{ -giotto object -} -\description{ -Directly attach a giotto image to giotto object -} -\details{ -\emph{\strong{Use with care!}} This function directly attaches -giotto image objects to the gobject without further modifications of -spatial positioning values within the image object that are generally -needed in order for them to plot in the correct location relative to the -other modalities of spatial data. \cr For the more general-purpose method -of attaching image objects, see \code{\link{addGiottoImage}} -} -\seealso{ -\code{\link{addGiottoImage}} -} diff --git a/man/set_giottoImage_MG.Rd b/man/set_giottoImage_MG.Rd deleted file mode 100644 index bf9cc1ad..00000000 --- a/man/set_giottoImage_MG.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_giottoImage_MG} -\alias{set_giottoImage_MG} -\title{Set \emph{magick}-based giotto \code{image}} -\usage{ -set_giottoImage_MG(gobject, image_object, name = NULL, verbose = NULL) -} -\arguments{ -\item{gobject}{giotto object} - -\item{image_object}{a giottoImage object} - -\item{name}{name to assign giottoImage} - -\item{verbose}{be verbose} -} -\value{ -giotto object -} -\description{ -Set a giottoImage for a giotto object with no additional -modifications -} -\keyword{internal} diff --git a/man/set_giottoLargeImage.Rd b/man/set_giottoLargeImage.Rd deleted file mode 100644 index b891509c..00000000 --- a/man/set_giottoLargeImage.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_giottoLargeImage} -\alias{set_giottoLargeImage} -\title{Set \emph{terra}-based giotto \code{largeImage}} -\usage{ -set_giottoLargeImage(gobject, largeImage_object, name = NULL, verbose = NULL) -} -\arguments{ -\item{gobject}{giotto object} - -\item{largeImage_object}{a giottoLargeImage object} - -\item{name}{name to assign giottoLargeImage} - -\item{verbose}{be verbose} -} -\value{ -giotto object -} -\description{ -Set a giottoLargeImage for a giotto object with no -additional modifications -} -\keyword{internal} diff --git a/man/set_multiomics.Rd b/man/set_multiomics.Rd index b82bd552..3d3c04f4 100644 --- a/man/set_multiomics.Rd +++ b/man/set_multiomics.Rd @@ -51,7 +51,6 @@ Other multiomics accessor functions: \code{\link{setMultiomics}()} Other functions to set data in giotto object: -\code{\link{get_feat_id}()}, \code{\link{setCellMetadata}()}, \code{\link{setDimReduction}()}, \code{\link{setExpression}()}, @@ -65,8 +64,7 @@ Other functions to set data in giotto object: \code{\link{setSpatialEnrichment}()}, \code{\link{setSpatialGrid}()}, \code{\link{setSpatialLocations}()}, -\code{\link{setSpatialNetwork}()}, -\code{\link{set_feat_id}()} +\code{\link{setSpatialNetwork}()} } \concept{functions to set data in giotto object} \concept{multiomics accessor functions} diff --git a/man/set_polygon_info.Rd b/man/set_polygon_info.Rd deleted file mode 100644 index 49b24027..00000000 --- a/man/set_polygon_info.Rd +++ /dev/null @@ -1,33 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_polygon_info} -\alias{set_polygon_info} -\title{Set polygon info} -\usage{ -set_polygon_info( - gobject, - gpolygon, - polygon_name = "cell", - verbose = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{gpolygon}{giottoPolygon object} - -\item{polygon_name}{name of polygons. Default -"cell" (only used when gpolygon is length of 1)} - -\item{verbose}{be verbose} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Set giotto polygon spatVector -} diff --git a/man/set_spatialGrid.Rd b/man/set_spatialGrid.Rd deleted file mode 100644 index 846ce155..00000000 --- a/man/set_spatialGrid.Rd +++ /dev/null @@ -1,39 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_spatialGrid} -\alias{set_spatialGrid} -\title{Set spatial grid} -\usage{ -set_spatialGrid( - gobject, - spatial_grid, - spat_unit = NULL, - feat_type = NULL, - name = NULL, - verbose = TRUE, - set_defaults = TRUE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spatial_grid}{spatial grid object} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{name}{name of spatial grid} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} -} -\value{ -giotto object -} -\description{ -Function to set a spatial grid -} diff --git a/man/set_spatialNetwork.Rd b/man/set_spatialNetwork.Rd deleted file mode 100644 index 99de860c..00000000 --- a/man/set_spatialNetwork.Rd +++ /dev/null @@ -1,43 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_spatialNetwork} -\alias{set_spatialNetwork} -\title{Set spatial network} -\usage{ -set_spatialNetwork( - gobject, - spatial_network, - spat_unit = NULL, - name = NULL, - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spatial_network}{spatial network} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{name}{name of spatial network} - -\item{provenance}{provenance name} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Function to set a spatial network -} diff --git a/man/set_spatial_enrichment.Rd b/man/set_spatial_enrichment.Rd deleted file mode 100644 index d8f3a26e..00000000 --- a/man/set_spatial_enrichment.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_spatial_enrichment} -\alias{set_spatial_enrichment} -\title{Set spatial enrichment} -\usage{ -set_spatial_enrichment( - gobject, - spatenrichment, - spat_unit = NULL, - feat_type = NULL, - enrichm_name = "enrichment", - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spatenrichment}{spatial enrichment results} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{feat_type}{feature type (e.g. "rna", "dna", "protein")} - -\item{enrichm_name}{name of spatial enrichment results. Default "DWLS"} - -\item{provenance}{provenance information (optional)} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Function to set a spatial enrichment slot -} diff --git a/man/set_spatial_locations.Rd b/man/set_spatial_locations.Rd deleted file mode 100644 index 19924f73..00000000 --- a/man/set_spatial_locations.Rd +++ /dev/null @@ -1,55 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/slot_accessors.R -\name{set_spatial_locations} -\alias{set_spatial_locations} -\title{Set spatial locations} -\usage{ -set_spatial_locations( - gobject, - spatlocs, - spat_unit = NULL, - spat_loc_name = "raw", - provenance = NULL, - verbose = TRUE, - set_defaults = TRUE, - initialize = FALSE -) -} -\arguments{ -\item{gobject}{giotto object} - -\item{spatlocs}{spatial locations (accepts either \code{data.table} or -\code{spatLocsObj})} - -\item{spat_unit}{spatial unit (e.g. "cell")} - -\item{spat_loc_name}{name of spatial locations, default "raw"} - -\item{provenance}{provenance information (optional)} - -\item{verbose}{be verbose} - -\item{set_defaults}{set default spat_unit and feat_type. Change to FALSE -only when -expression and spat_info are not expected to exist.} - -\item{initialize}{(default = FALSE) whether to initialize the gobject before -returning} -} -\value{ -giotto object -} -\description{ -Function to set a spatial location slot -} -\details{ -If a \code{spatLocsObj} is provided to \code{spatlocs} param then -any attached name and spat_unit info will be used for input to this -function's \code{spat_loc_name} and \code{spat_unit}params, BUT will be -overridden by any alternative specific inputs to those params. \cr -ie: a \code{spatLocsObj} with spat_unit slot == 'cell' will be automatically -nested by spat_unit 'cell' when using \code{set_spatial_locations} as long as -param \code{spat_unit = NULL}. BUT if param \code{spat_unit = 'nucleus'} then -the \code{spatLocsObj} will be nested by spat_unit 'nucleus' instead and -its spat_unit slot will be changed to 'nucleus' -} From 52a16ecd305f1dfe0074770aaee1cb771a0be42f Mon Sep 17 00:00:00 2001 From: Xin Zhang Date: Fri, 29 Nov 2024 01:44:20 +0100 Subject: [PATCH 02/14] Update interoperability.R change exprDT[, genes := as.character(rep(x = geneDT$gene, geneDT$count))] to exprDT[, genes := as.character(rep(x = geneDT$geneName, geneDT$count))] --- R/interoperability.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/interoperability.R b/R/interoperability.R index b58d8dde..3dad927a 100644 --- a/R/interoperability.R +++ b/R/interoperability.R @@ -68,7 +68,7 @@ gefToGiotto <- function( # 3. create expression matrix if (isTRUE(verbose)) wrap_msg("3. create expression matrix... \n") - exprDT[, genes := as.character(rep(x = geneDT$gene, geneDT$count))] + exprDT[, genes := as.character(rep(x = geneDT$geneName, geneDT$count))] exprDT[, gene_idx := as.integer(factor(exprDT$genes, levels = unique(exprDT$genes) ))] From 381eacc509229aef09f3c16751d981845ac19241 Mon Sep 17 00:00:00 2001 From: Xin Zhang Date: Fri, 29 Nov 2024 02:04:55 +0100 Subject: [PATCH 03/14] Update interoperability.R change exprDT[, genes := as.character(rep(x = geneDT$gene, geneDT$count))] to exprDT[, genes := as.character(rep(x = geneDT$geneName, geneDT$count))] same problem as last time --- R/interoperability.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/interoperability.R b/R/interoperability.R index 3dad927a..f86ffe2e 100644 --- a/R/interoperability.R +++ b/R/interoperability.R @@ -84,7 +84,7 @@ gefToGiotto <- function( ) colnames(expMatrix) <- cell_locations$cell_ID - rownames(expMatrix) <- geneDT$gene + rownames(expMatrix) <- geneDT$geneName rm(exprDT) if (isTRUE(verbose)) wrap_msg("finished expression matrix") From 1d856695e7a1f5aad1323a4cccada528b26557ea Mon Sep 17 00:00:00 2001 From: Xin Zhang Date: Fri, 29 Nov 2024 02:50:01 +0100 Subject: [PATCH 04/14] Update interoperability.R process duplicated gene symbols --- R/interoperability.R | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/R/interoperability.R b/R/interoperability.R index f86ffe2e..1a1261db 100644 --- a/R/interoperability.R +++ b/R/interoperability.R @@ -54,6 +54,35 @@ gefToGiotto <- function( data.table::setorder(exprDT, x, y) # sort by x, y coords (ascending) geneDT <- data.table::as.data.table(geneExpData[["gene"]]) + # process duplicated gene symbol + if (any(duplicated(geneDT$geneName))) { + duplicated_genes <- unique(geneDT$geneName[duplicated(geneDT$geneName)]) + cat("Ops!!! Duplicated_genes,processing:sum(count),mean(offset)") + # merge + for (gene in duplicated_genes) { + # indices + idx <- which(geneDT$geneName == gene) + + # + cat("Processing gene:", gene, "\n") + cat("Original count values for", gene, ":", geneDT$count[idx], "\n") + + # update + geneDT$count[idx[1]] <- sum(geneDT$count[idx]) # 对重复的 count 求和 + geneDT$offset[idx[1]] <- mean(geneDT$offset[idx]) # 对重复的 offset 求平均 + + # + cat("Updated count for", gene, ":", geneDT$count[idx[1]], "\n") + cat("Updated offset for", gene, ":", geneDT$offset[idx[1]], "\n") + + # + geneDT <- geneDT[-idx[-1], ] + + # + cat("Deleted duplicate entries for gene:", gene, "\n\n") + } + } + if (isTRUE(verbose)) wrap_msg("finished reading in .gef", bin_size, "\n") # 2. create spatial locations From 0d6c9dc751527497853931643da683d736940cd4 Mon Sep 17 00:00:00 2001 From: George Chen <72078254+jiajic@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:35:38 -0500 Subject: [PATCH 05/14] chore: improve example --- R/aggregate.R | 2 +- man/calculateOverlap.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/aggregate.R b/R/aggregate.R index b19287bf..1c559634 100644 --- a/R/aggregate.R +++ b/R/aggregate.R @@ -121,7 +121,7 @@ polygon_to_raster <- function(polygon, field = NULL) { #' overlaps_z1$rna #' #' # overlap image to get sum intensities per cell -#' out_img <- calculateOverlap(gpoly, gimg) +#' out_img <- calculateOverlap(gpoly, gimg, progress = FALSE) #' overlaps_img <- overlaps(out_img) #' overlaps_img$intensity #' diff --git a/man/calculateOverlap.Rd b/man/calculateOverlap.Rd index a8b20f9c..c0620a96 100644 --- a/man/calculateOverlap.Rd +++ b/man/calculateOverlap.Rd @@ -153,7 +153,7 @@ overlaps_z1 <- overlaps(out_z1) overlaps_z1$rna # overlap image to get sum intensities per cell -out_img <- calculateOverlap(gpoly, gimg) +out_img <- calculateOverlap(gpoly, gimg, progress = FALSE) overlaps_img <- overlaps(out_img) overlaps_img$intensity From 402ea0adf24b6f2704acdb54f474be873854c992 Mon Sep 17 00:00:00 2001 From: George Chen <72078254+jiajic@users.noreply.github.com> Date: Thu, 20 Feb 2025 12:26:45 -0500 Subject: [PATCH 06/14] chore: remove non-pkg items --- .github/.gitignore | 1 - .github/workflows/R-CMD-check.yaml | 204 ----------------------------- .github/workflows/covr.yml | 115 ---------------- .github/workflows/dev_check.yml | 118 ----------------- .github/workflows/lintr.yml | 71 ---------- .github/workflows/main_check.yml | 134 ------------------- .gitignore | 5 +- 7 files changed, 3 insertions(+), 645 deletions(-) delete mode 100644 .github/.gitignore delete mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/covr.yml delete mode 100644 .github/workflows/dev_check.yml delete mode 100644 .github/workflows/lintr.yml delete mode 100644 .github/workflows/main_check.yml diff --git a/.github/.gitignore b/.github/.gitignore deleted file mode 100644 index 2d19fc76..00000000 --- a/.github/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index f65420ac..00000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,204 +0,0 @@ -# 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()" - - - name: Run rcmdcheck - run: | - Rscript -e "rcmdcheck::rcmdcheck()" diff --git a/.github/workflows/covr.yml b/.github/workflows/covr.yml deleted file mode 100644 index 32223e2e..00000000 --- a/.github/workflows/covr.yml +++ /dev/null @@ -1,115 +0,0 @@ - - -name: code coverage - -on: - push: - branches: [ "dev2" ] - schedule: - - cron: '16 20 * * 2' - -jobs: - test-coverage: - name: Code coverage - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - - name: Checkout repo for workflow access - uses: actions/checkout@v4 - with: - ref: dev - - - name: Set up R environment - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - name: Set up dependencies (general) - uses: r-lib/actions/setup-r-dependencies@v2 - env: - _R_CHECK_FORCE_SUGGESTS: false - _R_CHECK_RD_XREFS: false - with: - dependencies: '"hard"' # do not use suggested dependencies - install-pandoc: false - extra-packages: | - github::drieslab/GiottoData - any::covr - any::rcmdcheck - any::testthat - any::rlang - any::R.utils - any::knitr - any::rmarkdown - any::qs - any::sp - any::stars - any::raster - any::sf - any::scattermore - any::exactextractr - any::RTriangle - any::geometry - any::qs - any::future.apply - any::Biobase - any::chihaya - any::DelayedArray - any::DelayedMatrixStats - any::HDF5Array - any::plotly - any::rgl - any::rhdf5 - any::S4Vectors - any::ScaledMatrix - any::XML - any::Seurat - any::SeuratObject - any::SingleCellExperiment - any::SpatialExperiment - any::STexampleData - any::SummarizedExperiment - - needs: coverage - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: setup giotto_env - shell: Rscript {0} - run: | - if (!GiottoClass::checkGiottoEnvironment()) { - GiottoClass::installGiottoEnvironment() - } - - reticulate::conda_install( - envname = 'giotto_env', - packages = 'scanpy', - pip = TRUE - ) - - path_to_python <- GiottoClass::set_giotto_python_path() - - writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python), - Sys.getenv("GITHUB_ENV")) - - - name: Generate coverage report - run: | - covr::codecov( - quiet = FALSE, - clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") - ) - shell: Rscript {0} - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 - with: - token: 4c596b03-f583-4114-8c3a-f89ed373c53b - fail_ci_if_error: false - flags: unittests - verbose: true diff --git a/.github/workflows/dev_check.yml b/.github/workflows/dev_check.yml deleted file mode 100644 index 8d0f5add..00000000 --- a/.github/workflows/dev_check.yml +++ /dev/null @@ -1,118 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# -# See https://github.com/r-lib/actions/tree/master/examples#readme for -# additional example workflows available for the R community. - - -name: Dev Workflow - Test and check -on: - push: - branches: [ "dev2" ] - -permissions: - contents: read - -jobs: - R-CMD-check: - name: R CMD Check - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - runs-on: ubuntu-latest - - steps: - - - name: Checkout repo for workflow access - uses: actions/checkout@v4 - - - name: Setup pandoc - uses: r-lib/actions/setup-pandoc@v2 - - - name: Set up R environment - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - name: Set up dependencies (general) - uses: r-lib/actions/setup-r-dependencies@v2 - env: - _R_CHECK_FORCE_SUGGESTS: false - _R_CHECK_RD_XREFS: false - with: - dependencies: '"hard"' # do not use suggested dependencies - install-pandoc: false - extra-packages: | - any::rcmdcheck - any::testthat - any::rlang - any::R.utils - any::knitr - any::rmarkdown - any::qs - any::sp - any::stars - any::raster - any::sf - any::scattermore - any::exactextractr - any::RTriangle - any::geometry - any::qs - any::future.apply - any::Biobase - any::chihaya - any::DelayedArray - any::DelayedMatrixStats - any::HDF5Array - any::plotly - any::rgl - any::rhdf5 - any::S4Vectors - any::ScaledMatrix - any::XML - any::Seurat - any::SeuratObject - any::SingleCellExperiment - any::SpatialExperiment - any::STexampleData - any::SummarizedExperiment - github::drieslab/GiottoData - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: setup giotto_env - shell: Rscript {0} - run: | - if (!GiottoClass::checkGiottoEnvironment()) { - GiottoClass::installGiottoEnvironment() - } - - reticulate::conda_install( - envname = 'giotto_env', - packages = 'scanpy', - pip = TRUE - ) - - path_to_python <- GiottoClass::set_giotto_python_path() - - writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python), - Sys.getenv("GITHUB_ENV")) - - - name: Run R CMD check - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true - error-on: '"error"' # workflow errors on error only, can change to include warnings - - # show testthat output for ease of access - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - diff --git a/.github/workflows/lintr.yml b/.github/workflows/lintr.yml deleted file mode 100644 index 4610ecb0..00000000 --- a/.github/workflows/lintr.yml +++ /dev/null @@ -1,71 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# lintr provides static code analysis for R. -# It checks for adherence to a given style, -# identifying syntax errors and possible semantic issues, -# then reports them to you so you can take action. -# More details at https://lintr.r-lib.org/ - -name: lintr - -on: - push: - branches: [ "dev2" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "dev2" ] - schedule: - - cron: '16 20 * * 2' - -permissions: - contents: read - -jobs: - lintr: - name: Run lintr scanning - runs-on: ubuntu-latest - permissions: - contents: read # for checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up R environment - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - name: Set up dependencies - uses: r-lib/actions/setup-r-dependencies@v2 - env: - _R_CHECK_FORCE_SUGGESTS: false - _R_CHECK_RD_XREFS: false - with: - dependencies: '"hard"' # do not use suggested dependencies - extra-packages: any::lintr, local::. - needs: lint - - - name: Run lintr - run: | - lintr::sarif_output( - lintr::lint_package( - ".", - linters = lintr::linters_with_defaults( - indentation_linter = lintr::indentation_linter(indent = 4L) - ) - ), - "lintr-results.sarif" - ) - shell: Rscript {0} - continue-on-error: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: lintr-results.sarif - wait-for-processing: true diff --git a/.github/workflows/main_check.yml b/.github/workflows/main_check.yml deleted file mode 100644 index 21485fec..00000000 --- a/.github/workflows/main_check.yml +++ /dev/null @@ -1,134 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# -# See https://github.com/r-lib/actions/tree/master/examples#readme for -# additional example workflows available for the R community. - - -name: R-CMD-check - -on: - pull_request: - types: opened - branches: [ "main" ] - -permissions: - contents: read - - -jobs: - R-CMD-check: - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: # matrix of system runners to run workflow on - - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - # - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - steps: - - - name: Checkout repo for workflow access - uses: actions/checkout@v4 - - - name: Setup pandoc - uses: r-lib/actions/setup-pandoc@v2 - - - name: Set up R environment - 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: Set up dependencies (general) - uses: r-lib/actions/setup-r-dependencies@v2 - env: - _R_CHECK_FORCE_SUGGESTS: false - _R_CHECK_RD_XREFS: false - with: - dependencies: '"hard"' # do not use suggested dependencies - install-pandoc: false - extra-packages: | - any::rcmdcheck - any::testthat - any::rlang - any::R.utils - any::knitr - any::rmarkdown - any::qs - any::sp - any::stars - any::raster - any::sf - any::scattermore - any::exactextractr - any::RTriangle - any::geometry - any::qs - any::future.apply - any::Biobase - any::chihaya - any::DelayedArray - any::DelayedMatrixStats - any::HDF5Array - any::plotly - any::rgl - any::rhdf5 - any::S4Vectors - any::ScaledMatrix - any::XML - any::Seurat - any::SeuratObject - any::SingleCellExperiment - any::SpatialExperiment - any::STexampleData - any::SummarizedExperiment - github::drieslab/GiottoData - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: setup giotto_env - shell: Rscript {0} - run: | - if (!GiottoClass::checkGiottoEnvironment()) { - GiottoClass::installGiottoEnvironment() - } - - reticulate::conda_install( - envname = 'giotto_env', - packages = 'scanpy', - pip = TRUE - ) - - path_to_python <- GiottoClass::set_giotto_python_path() - - writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python), - Sys.getenv("GITHUB_ENV")) - - - name: Run R CMD check - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true - error-on: '"error"' # workflow errors on error only, can change to include warnings - - # show testthat output for ease of access - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - diff --git a/.gitignore b/.gitignore index d65339ec..1b9d0a02 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,8 @@ inst/doc .git_old .vscode/* .Rprofile -docs codecov.yml -pkgdown cell_rna* +docs +pkgdown +.github From 40f6707c5494cf98cd42d0edebe64f877f4dc86b Mon Sep 17 00:00:00 2001 From: George Chen <72078254+jiajic@users.noreply.github.com> Date: Thu, 15 May 2025 15:16:59 -0400 Subject: [PATCH 07/14] chore: remove .github from main --- .github/workflows/dev_branch_workflow.yml | 169 --------------- .github/workflows/feature_branch_workflow.yml | 96 --------- .github/workflows/staging_branch_workflow.yml | 204 ------------------ 3 files changed, 469 deletions(-) delete mode 100644 .github/workflows/dev_branch_workflow.yml delete mode 100644 .github/workflows/feature_branch_workflow.yml delete mode 100644 .github/workflows/staging_branch_workflow.yml diff --git a/.github/workflows/dev_branch_workflow.yml b/.github/workflows/dev_branch_workflow.yml deleted file mode 100644 index b76c797c..00000000 --- a/.github/workflows/dev_branch_workflow.yml +++ /dev/null @@ -1,169 +0,0 @@ -name: Dev Branch Checks -on: - push: - branches: [ "dev" ] - -permissions: - contents: write - packages: read - -jobs: - - codecov: - runs-on: ubuntu-latest - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: giotto-deps - run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - shell: Rscript {0} - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - name: Build and install # needed for GiottoData install - run: | - R CMD build . --no-build-vignettes - R CMD INSTALL *.tar.gz - - name: Generate coverage report and upload - run: | - remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - # Create and save HTML report - coverage_report <- covr::package_coverage( - type = c("tests", "examples", "vignettes"), - combine_types = TRUE, - quiet = TRUE, - clean = FALSE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") - ) - covr::report(coverage_report, file = "coverage-report.html", browse = FALSE) - - # Upload to Codecov - covr::codecov( - coverage = coverage_report, - branch = "dev", - quiet = FALSE - ) - shell: Rscript {0} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - - name: Upload coverage HTML report - uses: actions/upload-artifact@v4 - with: - name: coverage-report - path: coverage-report.html - retention-days: 30 - - rcmdcheck: - runs-on: ubuntu-latest - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: giotto-deps - run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - shell: Rscript {0} - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - name: Check package - run: | - remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error") - shell: Rscript {0} - - bioccheck: - runs-on: ubuntu-latest - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: giotto-deps - run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - shell: Rscript {0} - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - name: Build and install - run: | - R CMD build . --no-build-vignettes - R CMD INSTALL *.tar.gz - - name: Run BiocCheck # this is mainly formatting. No need for GiottoData - run: | - BiocCheck::BiocCheck() - shell: Rscript {0} - - lintr: - runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - contents: write - packages: read - actions: read - security-events: write - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - - name: Run lintr - run: | - results <- lintr::lint_package( - ".", - exclusions = list("tests", "vignettes", "pkgdown"), - linters = lintr::linters_with_defaults( - indentation_linter = lintr::indentation_linter(indent = 4L), - object_name_linter = lintr::object_name_linter(styles = c("camelCase", "symbols", "snake_case", "UPPERCASE")) - ) - ) - - # Fix any invalid column numbers - for (i in seq_along(results)) { - if (!is.null(results[[i]]$column_number) && results[[i]]$column_number < 1) { - results[[i]]$column_number <- 1 - } - } - - lintr::sarif_output(results, "lintr-results.sarif") - shell: Rscript {0} - continue-on-error: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: lintr-results.sarif - wait-for-processing: true \ No newline at end of file diff --git a/.github/workflows/feature_branch_workflow.yml b/.github/workflows/feature_branch_workflow.yml deleted file mode 100644 index cd06d0bd..00000000 --- a/.github/workflows/feature_branch_workflow.yml +++ /dev/null @@ -1,96 +0,0 @@ -name: Feature Branch Checks -on: - pull_request: - branches: [ "dev" ] - -jobs: - - unit-tests: - runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - contents: write - packages: read - actions: read - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: giotto-deps - run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - shell: Rscript {0} - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - name: Build and install - run: | - R CMD build . --no-build-vignettes - R CMD INSTALL *.tar.gz - - name: Run tests - run: | - remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - library(testthat) - library(GiottoClass) - test_dir("tests/testthat") - shell: Rscript {0} - - lintr: - runs-on: ubuntu-latest - timeout-minutes: 60 - permissions: - contents: write - packages: read - actions: read - security-events: write - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - - name: Run lintr - run: | - results <- lintr::lint_package( - ".", - exclusions = list("tests", "vignettes", "pkgdown"), - linters = lintr::linters_with_defaults( - indentation_linter = lintr::indentation_linter(indent = 4L), - object_name_linter = lintr::object_name_linter(styles = c("camelCase", "symbols", "snake_case", "UPPERCASE")) - ) - ) - - # Fix any invalid column numbers - for (i in seq_along(results)) { - if (!is.null(results[[i]]$column_number) && results[[i]]$column_number < 1) { - results[[i]]$column_number <- 1 - } - } - - lintr::sarif_output(results, "lintr-results.sarif") - shell: Rscript {0} - continue-on-error: true - - - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: lintr-results.sarif - wait-for-processing: true \ No newline at end of file diff --git a/.github/workflows/staging_branch_workflow.yml b/.github/workflows/staging_branch_workflow.yml deleted file mode 100644 index cc6b33f3..00000000 --- a/.github/workflows/staging_branch_workflow.yml +++ /dev/null @@ -1,204 +0,0 @@ -# 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: [ staging ] - schedule: - - cron: '0 0 * * 1,4' # Run at midnight on Monday and Thursday - workflow_dispatch: # Allow manual trigger - -name: STAGING final checks - -permissions: - contents: read - packages: read - -jobs: - R-CMD-check: - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: # matrix of system runners to run workflow on - - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - # - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} # incompatible with R 4.4 - - steps: - - - name: Checkout repo for workflow access - uses: actions/checkout@v4 - - - name: Setup pandoc - uses: r-lib/actions/setup-pandoc@v2 - - - name: Install XQuartz on macOS - if: runner.os == 'macOS' - run: | - brew install --cask xquartz - - - name: Install X11 on Ubuntu - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y xvfb libx11-dev libglu1-mesa-dev libfreetype6-dev - - - name: Set up R environment - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: false - - - name: Set up dependencies (general) - uses: r-lib/actions/setup-r-dependencies@v2 - env: - _R_CHECK_FORCE_SUGGESTS: false - _R_CHECK_RD_XREFS: false - with: - dependencies: '"hard"' # do not use suggested dependencies - install-pandoc: false - extra-packages: | - any::rcmdcheck - any::testthat - any::rlang - any::R.utils - any::knitr - any::rmarkdown - any::qs - any::sp - any::stars - any::raster - any::sf - any::scattermore - any::exactextractr - any::RTriangle - any::geometry - any::qs - any::future.apply - any::Biobase - any::chihaya - any::DelayedArray - any::DelayedMatrixStats - any::HDF5Array - any::plotly - any::rgl - any::rhdf5 - any::S4Vectors - any::ScaledMatrix - any::XML - any::Seurat - any::SeuratObject - any::SingleCellExperiment - any::SpatialExperiment - any::STexampleData - any::SummarizedExperiment - github::drieslab/GiottoData - - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: report versions - shell: Rscript {0} - run: | - print(paste("terra:", packageVersion("terra"))) - print(paste("sf:", packageVersion("sf"))) - print(paste("SpatialExperiment:", packageVersion("SpatialExperiment"))) - - - name: setup giotto_env - shell: Rscript {0} - run: | - if (!GiottoClass::checkGiottoEnvironment()) { - GiottoClass::installGiottoEnvironment() - } - - reticulate::conda_install( - envname = 'giotto_env', - packages = 'scanpy', - pip = TRUE - ) - - path_to_python <- GiottoClass::set_giotto_python_path() - - writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python), - Sys.getenv("GITHUB_ENV")) - - - name: Run R CMD check - uses: r-lib/actions/check-r-package@v2 - with: - upload-snapshots: true - error-on: '"error"' # workflow errors on error only, can change to include warnings - - codecov: - needs: R-CMD-check - runs-on: ubuntu-latest - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: giotto-deps - run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never') - shell: Rscript {0} - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - name: Generate coverage report and upload - run: | - remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - covr::codecov( - quiet = FALSE, - clean = FALSE, - branch = "staging", - type = c("tests", "examples", "vignettes"), - combine_types = TRUE, - install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package", auth_token = Sys.getenv("GITHUB_PAT")) - ) - shell: Rscript {0} - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - bioccheck: - needs: R-CMD-check - runs-on: ubuntu-latest - container: - image: ghcr.io/drieslab/ci-giottosuite/ci-env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history and tags - - name: Set up GitHub token for R - run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV - - name: giotto-deps - run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - shell: Rscript {0} - - name: catch R deps not in container - run: devtools::install_deps() - shell: Rscript {0} - - name: Build and install - run: | - R CMD build . --no-build-vignettes - R CMD INSTALL *.tar.gz - - name: Run BiocCheck - run: | - remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) - BiocCheck::BiocCheck() - shell: Rscript {0} - From 94ab81d23dc4e9aeb5a944d4ebc2fec3854304ff Mon Sep 17 00:00:00 2001 From: Ed2uiz Date: Thu, 17 Jul 2025 15:35:52 -0400 Subject: [PATCH 08/14] Update data_input.R --- R/data_input.R | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/R/data_input.R b/R/data_input.R index aab53ea7..6c8b139f 100644 --- a/R/data_input.R +++ b/R/data_input.R @@ -28,11 +28,18 @@ readExprMatrix <- function( cores = determine_cores(), transpose = FALSE, feat_type = "rna", - expression_matrix_class = c("dgCMatrix", "DelayedArray"), - ...) { + expression_matrix_class = c("dgCMatrix", "DelayedArray", "dbSparseMatrix")) { # check if path is a character vector and exists if (!is.character(path)) stop("path needs to be character vector") if (!file.exists(path)) stop("the path: ", path, " does not exist") + + # check if expression_matrix_class is dbMatrix, if so stop and throw error saying not yet supported + if (expression_matrix_class == "dbSparseMatrix"){ + # Note: Implementation of this feature should be done within {dbMatrix} + # See dbMatrix::dbMatrix() function for more info + stop("File conversion to dbMatrix is not yet supported") + } + data.table::setDTthreads(threads = cores) # read and convert From 5833e0cdf1b88b872c89dc4b779ab59e91c4ae28 Mon Sep 17 00:00:00 2001 From: Ed2uiz Date: Thu, 22 Jan 2026 15:09:33 -0500 Subject: [PATCH 09/14] fix: match vector argument `expression_matrix_class` in `readExprMatrix` --- R/data_input.R | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/R/data_input.R b/R/data_input.R index 6c8b139f..9d354f5a 100644 --- a/R/data_input.R +++ b/R/data_input.R @@ -32,13 +32,11 @@ readExprMatrix <- function( # check if path is a character vector and exists if (!is.character(path)) stop("path needs to be character vector") if (!file.exists(path)) stop("the path: ", path, " does not exist") - - # check if expression_matrix_class is dbMatrix, if so stop and throw error saying not yet supported - if (expression_matrix_class == "dbSparseMatrix"){ - # Note: Implementation of this feature should be done within {dbMatrix} - # See dbMatrix::dbMatrix() function for more info + + expression_matrix_class <- match.arg(expression_matrix_class) + if (identical(expression_matrix_class, "dbSparseMatrix")) { stop("File conversion to dbMatrix is not yet supported") - } + } data.table::setDTthreads(threads = cores) From f8fc02582c990a3cdebb9efb1f5ae5f76b472c01 Mon Sep 17 00:00:00 2001 From: Ed2uiz Date: Thu, 22 Jan 2026 20:00:27 -0500 Subject: [PATCH 10/14] fix: enhance calculateOverlap to support dbSpatial inputs and prevent mixing with terra-backed inputs --- R/aggregate.R | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/R/aggregate.R b/R/aggregate.R index f0f401e7..d48e3d3b 100644 --- a/R/aggregate.R +++ b/R/aggregate.R @@ -516,6 +516,16 @@ setMethod( feat_subset_ids = deprecated(), count_info_column = deprecated(), ...) { + is_db_x <- inherits(x@spatVector, "dbSpatial") + is_db_y <- inherits(y@spatVector, "dbSpatial") + + if (xor(is_db_x, is_db_y)) { + stop( + "calculateOverlap: mixing dbSpatial-backed and terra-backed inputs is not supported", + call. = FALSE + ) + } + # deprecations feat_subset_values <- GiottoUtils::deprecate_param( feat_subset_ids, feat_subset_values, @@ -538,6 +548,40 @@ setMethod( feat_count_column <- NULL } + # ------------------------------------------------------------------ + # dbSpatial-backed path: keep results dbSpatial-native + # ------------------------------------------------------------------ + if (isTRUE(is_db_x)) { + if (!methods::hasMethod( + "calculateOverlap", + signature = signature(x = "dbSpatial", y = "dbSpatial") + )) { + stop( + "calculateOverlap: dbSpatial-backed giottoPolygon/giottoPoints requires a calculateOverlap(dbSpatial, dbSpatial) method (load GiottoDB)", + call. = FALSE + ) + } + + # The method is defined in GiottoDB + res <- calculateOverlap( + x = x@spatVector, + y = y@spatVector, + poly_subset_ids = poly_subset_ids, + feat_subset_column = feat_subset_column, + feat_subset_ids = feat_subset_values, + count_info_column = feat_count_column, + verbose = verbose, + ... + ) + + if (isTRUE(return_gpolygon)) { + if (is.null(name_overlap)) name_overlap <- objName(y) + x@overlaps[[name_overlap]] <- res + return(x) + } + return(res) + } + # return an overlap info object res <- calculateOverlap( x = x[], From 0165e9d4ec44dd54811b4354258ff6a01227add5 Mon Sep 17 00:00:00 2001 From: Ed2uiz Date: Fri, 23 Jan 2026 20:43:55 -0500 Subject: [PATCH 11/14] fix: restore missing .github directory from `dev` branch --- .github/.gitignore | 1 + .github/workflows/dev_branch_workflow.yml | 169 +++++++++++++++ .github/workflows/feature_branch_workflow.yml | 96 +++++++++ .github/workflows/staging_branch_workflow.yml | 204 ++++++++++++++++++ 4 files changed, 470 insertions(+) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/dev_branch_workflow.yml create mode 100644 .github/workflows/feature_branch_workflow.yml create mode 100644 .github/workflows/staging_branch_workflow.yml diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 00000000..2d19fc76 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/dev_branch_workflow.yml b/.github/workflows/dev_branch_workflow.yml new file mode 100644 index 00000000..b76c797c --- /dev/null +++ b/.github/workflows/dev_branch_workflow.yml @@ -0,0 +1,169 @@ +name: Dev Branch Checks +on: + push: + branches: [ "dev" ] + +permissions: + contents: write + packages: read + +jobs: + + codecov: + runs-on: ubuntu-latest + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: giotto-deps + run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + shell: Rscript {0} + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + - name: Build and install # needed for GiottoData install + run: | + R CMD build . --no-build-vignettes + R CMD INSTALL *.tar.gz + - name: Generate coverage report and upload + run: | + remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + # Create and save HTML report + coverage_report <- covr::package_coverage( + type = c("tests", "examples", "vignettes"), + combine_types = TRUE, + quiet = TRUE, + clean = FALSE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + covr::report(coverage_report, file = "coverage-report.html", browse = FALSE) + + # Upload to Codecov + covr::codecov( + coverage = coverage_report, + branch = "dev", + quiet = FALSE + ) + shell: Rscript {0} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + - name: Upload coverage HTML report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage-report.html + retention-days: 30 + + rcmdcheck: + runs-on: ubuntu-latest + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: giotto-deps + run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + shell: Rscript {0} + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + - name: Check package + run: | + remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error") + shell: Rscript {0} + + bioccheck: + runs-on: ubuntu-latest + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: giotto-deps + run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + shell: Rscript {0} + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + - name: Build and install + run: | + R CMD build . --no-build-vignettes + R CMD INSTALL *.tar.gz + - name: Run BiocCheck # this is mainly formatting. No need for GiottoData + run: | + BiocCheck::BiocCheck() + shell: Rscript {0} + + lintr: + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + contents: write + packages: read + actions: read + security-events: write + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + + - name: Run lintr + run: | + results <- lintr::lint_package( + ".", + exclusions = list("tests", "vignettes", "pkgdown"), + linters = lintr::linters_with_defaults( + indentation_linter = lintr::indentation_linter(indent = 4L), + object_name_linter = lintr::object_name_linter(styles = c("camelCase", "symbols", "snake_case", "UPPERCASE")) + ) + ) + + # Fix any invalid column numbers + for (i in seq_along(results)) { + if (!is.null(results[[i]]$column_number) && results[[i]]$column_number < 1) { + results[[i]]$column_number <- 1 + } + } + + lintr::sarif_output(results, "lintr-results.sarif") + shell: Rscript {0} + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: lintr-results.sarif + wait-for-processing: true \ No newline at end of file diff --git a/.github/workflows/feature_branch_workflow.yml b/.github/workflows/feature_branch_workflow.yml new file mode 100644 index 00000000..cd06d0bd --- /dev/null +++ b/.github/workflows/feature_branch_workflow.yml @@ -0,0 +1,96 @@ +name: Feature Branch Checks +on: + pull_request: + branches: [ "dev" ] + +jobs: + + unit-tests: + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + contents: write + packages: read + actions: read + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: giotto-deps + run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + shell: Rscript {0} + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + - name: Build and install + run: | + R CMD build . --no-build-vignettes + R CMD INSTALL *.tar.gz + - name: Run tests + run: | + remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + library(testthat) + library(GiottoClass) + test_dir("tests/testthat") + shell: Rscript {0} + + lintr: + runs-on: ubuntu-latest + timeout-minutes: 60 + permissions: + contents: write + packages: read + actions: read + security-events: write + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + + - name: Run lintr + run: | + results <- lintr::lint_package( + ".", + exclusions = list("tests", "vignettes", "pkgdown"), + linters = lintr::linters_with_defaults( + indentation_linter = lintr::indentation_linter(indent = 4L), + object_name_linter = lintr::object_name_linter(styles = c("camelCase", "symbols", "snake_case", "UPPERCASE")) + ) + ) + + # Fix any invalid column numbers + for (i in seq_along(results)) { + if (!is.null(results[[i]]$column_number) && results[[i]]$column_number < 1) { + results[[i]]$column_number <- 1 + } + } + + lintr::sarif_output(results, "lintr-results.sarif") + shell: Rscript {0} + continue-on-error: true + + - name: Upload analysis results to GitHub + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: lintr-results.sarif + wait-for-processing: true \ No newline at end of file diff --git a/.github/workflows/staging_branch_workflow.yml b/.github/workflows/staging_branch_workflow.yml new file mode 100644 index 00000000..76eb55e2 --- /dev/null +++ b/.github/workflows/staging_branch_workflow.yml @@ -0,0 +1,204 @@ +# 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: [ staging ] + schedule: + - cron: '0 0 * * 1,4' # Run at midnight on Monday and Thursday + workflow_dispatch: # Allow manual trigger + +name: STAGING final checks + +permissions: + contents: read + packages: read + +jobs: + R-CMD-check: + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: # matrix of system runners to run workflow on + - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + # - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} # incompatible with R 4.4 + + steps: + + - name: Checkout repo for workflow access + uses: actions/checkout@v4 + + - name: Setup pandoc + uses: r-lib/actions/setup-pandoc@v2 + + - name: Install XQuartz on macOS + if: runner.os == 'macOS' + run: | + brew install --cask xquartz + + - name: Install X11 on Ubuntu + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y xvfb libx11-dev libglu1-mesa-dev libfreetype6-dev + + - name: Set up R environment + uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: false + + - name: Set up dependencies (general) + uses: r-lib/actions/setup-r-dependencies@v2 + env: + _R_CHECK_FORCE_SUGGESTS: false + _R_CHECK_RD_XREFS: false + with: + dependencies: '"hard"' # do not use suggested dependencies + install-pandoc: false + extra-packages: | + any::rcmdcheck + any::testthat + any::rlang + any::R.utils + any::knitr + any::rmarkdown + any::qs + any::sp + any::stars + any::raster + any::sf + any::scattermore + any::exactextractr + any::RTriangle + any::geometry + any::qs + any::future.apply + any::Biobase + any::chihaya + any::DelayedArray + any::DelayedMatrixStats + any::HDF5Array + any::plotly + any::rgl + any::rhdf5 + any::S4Vectors + any::ScaledMatrix + any::XML + any::Seurat + any::SeuratObject + any::SingleCellExperiment + any::SpatialExperiment + any::STexampleData + any::SummarizedExperiment + github::drieslab/GiottoData + + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: report versions + shell: Rscript {0} + run: | + print(paste("terra:", packageVersion("terra"))) + print(paste("sf:", packageVersion("sf"))) + print(paste("SpatialExperiment:", packageVersion("SpatialExperiment"))) + + - name: setup giotto_env + shell: Rscript {0} + run: | + if (!GiottoClass::checkGiottoEnvironment()) { + GiottoClass::installGiottoEnvironment() + } + + reticulate::conda_install( + envname = 'giotto_env', + packages = 'scanpy', + pip = TRUE + ) + + path_to_python <- GiottoClass::set_giotto_python_path() + + writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python), + Sys.getenv("GITHUB_ENV")) + + - name: Run R CMD check + uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + error-on: '"error"' # workflow errors on error only, can change to include warnings + + codecov: + needs: R-CMD-check + runs-on: ubuntu-latest + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: giotto-deps + run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never') + shell: Rscript {0} + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + - name: Generate coverage report and upload + run: | + remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + covr::codecov( + quiet = FALSE, + clean = FALSE, + branch = "staging", + type = c("tests", "examples", "vignettes"), + combine_types = TRUE, + install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") + ) + shell: Rscript {0} + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + + bioccheck: + needs: R-CMD-check + runs-on: ubuntu-latest + container: + image: ghcr.io/drieslab/ci-giottosuite/ci-env + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history and tags + - name: Set up GitHub token for R + run: echo "GITHUB_PAT=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV + - name: giotto-deps + run: remotes::install_github('drieslab/GiottoUtils', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + shell: Rscript {0} + - name: catch R deps not in container + run: devtools::install_deps() + shell: Rscript {0} + - name: Build and install + run: | + R CMD build . --no-build-vignettes + R CMD INSTALL *.tar.gz + - name: Run BiocCheck + run: | + remotes::install_github('drieslab/GiottoData', upgrade = 'never', auth_token = Sys.getenv("GITHUB_PAT")) + BiocCheck::BiocCheck() + shell: Rscript {0} + From 20e8710cfb06fa6407435cc7139bd01bb421a544 Mon Sep 17 00:00:00 2001 From: Ed2uiz Date: Sat, 24 Jan 2026 12:25:01 -0500 Subject: [PATCH 12/14] chore: tidy up whitespace and char limit --- R/aggregate.R | 6 ++++-- R/data_input.R | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/R/aggregate.R b/R/aggregate.R index d48e3d3b..ad5a37d4 100644 --- a/R/aggregate.R +++ b/R/aggregate.R @@ -521,7 +521,8 @@ setMethod( if (xor(is_db_x, is_db_y)) { stop( - "calculateOverlap: mixing dbSpatial-backed and terra-backed inputs is not supported", + "calculateOverlap: dbSpatial-backed and terra-backed inputs ", + "are not both supported", call. = FALSE ) } @@ -557,7 +558,8 @@ setMethod( signature = signature(x = "dbSpatial", y = "dbSpatial") )) { stop( - "calculateOverlap: dbSpatial-backed giottoPolygon/giottoPoints requires a calculateOverlap(dbSpatial, dbSpatial) method (load GiottoDB)", + "calculateOverlap: dbSpatial-backed giottoPolygon or ", + "giottoPoints method missing. Load the GiottoDB package.", call. = FALSE ) } diff --git a/R/data_input.R b/R/data_input.R index 9d354f5a..aa6caad8 100644 --- a/R/data_input.R +++ b/R/data_input.R @@ -28,16 +28,20 @@ readExprMatrix <- function( cores = determine_cores(), transpose = FALSE, feat_type = "rna", - expression_matrix_class = c("dgCMatrix", "DelayedArray", "dbSparseMatrix")) { + expression_matrix_class = c( + "dgCMatrix", + "DelayedArray", + "dbSparseMatrix" + )) { # check if path is a character vector and exists if (!is.character(path)) stop("path needs to be character vector") if (!file.exists(path)) stop("the path: ", path, " does not exist") expression_matrix_class <- match.arg(expression_matrix_class) if (identical(expression_matrix_class, "dbSparseMatrix")) { - stop("File conversion to dbMatrix is not yet supported") + stop("File conversion to dbMatrix is not yet supported") } - + data.table::setDTthreads(threads = cores) # read and convert From a5b838f417ec174389cf3b406be56571278a599d Mon Sep 17 00:00:00 2001 From: Ed2uiz Date: Sun, 25 Jan 2026 17:30:51 -0500 Subject: [PATCH 13/14] fix: check GiottoDB pkg dependency and add to Suggests --- DESCRIPTION | 3 ++- R/aggregate.R | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 414f2f51..37d8334d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -42,7 +42,8 @@ Imports: reticulate (>= 1.25), stats, terra (>= 1.8-21) -Suggests: +Suggests: + GiottoDB, Biobase, chihaya, DelayedArray, diff --git a/R/aggregate.R b/R/aggregate.R index ad5a37d4..c1260bfc 100644 --- a/R/aggregate.R +++ b/R/aggregate.R @@ -553,6 +553,15 @@ setMethod( # dbSpatial-backed path: keep results dbSpatial-native # ------------------------------------------------------------------ if (isTRUE(is_db_x)) { + # GiottoDB defines the method for this generic + if (!base::requireNamespace("GiottoDB", quietly = TRUE)) { + stop( + "calculateOverlap: dbSpatial-backed inputs require the ", + "GiottoDB package. Install it, or load it via `library(GiottoDB)`.", + call. = FALSE + ) + } + if (!methods::hasMethod( "calculateOverlap", signature = signature(x = "dbSpatial", y = "dbSpatial") @@ -570,8 +579,8 @@ setMethod( y = y@spatVector, poly_subset_ids = poly_subset_ids, feat_subset_column = feat_subset_column, - feat_subset_ids = feat_subset_values, - count_info_column = feat_count_column, + feat_subset_values = feat_subset_values, + feat_count_column = feat_count_column, verbose = verbose, ... ) From 30c7873e2bcad10a44d5732c02924f8eed75336a Mon Sep 17 00:00:00 2001 From: Ed2uiz Date: Sun, 25 Jan 2026 18:07:47 -0500 Subject: [PATCH 14/14] fix: remove .github from .gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1b9d0a02..1fbeec99 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,4 @@ inst/doc codecov.yml cell_rna* docs -pkgdown -.github +pkgdown \ No newline at end of file