Skip to content

Commit

Permalink
Deal with more R CMD check issues on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdamoses committed Oct 25, 2024
1 parent 7e37956 commit 41fc2d4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions R/read.R
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,10 @@ read10xVisiumSFE <- function(samples = "",
#' \code{\link{read10xVisiumSFE}}, the centroids geometry is also added
#' because it will greatly facilitate plotting when there are many spots when
#' not zooming in. See the \code{scattermore} argument in
#' \code{\link{Voyager::plotSpatialFeature}}.
#' \code{\link[Voyager]{plotSpatialFeature}}.
#' @export
#' @examples
#'
#' #
readVisiumHD <- function(data_dir, bin_size = c(2L, 8L, 16L),
sample_id = NULL,
type = c("HDF5", "sparse"),
Expand Down
5 changes: 4 additions & 1 deletion man/readVisiumHD.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-coerce.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test_that("Convert SPE and SCE to SFE, no images", {
colData(sce) <- cbind(colData(sce), coords[,c("pxl_col_in_fullres", "pxl_row_in_fullres")])
sfe4 <- toSpatialFeatureExperiment(sce, spatialCoordsNames = c("pxl_col_in_fullres",
"pxl_row_in_fullres"))
sfe <- read10xVisiumSFE(dir, type = "sparse", data = "filtered")
sfe <- read10xVisiumSFE(dir, type = "sparse", data = "filtered", flip = "image")
centroids_check <- st_centroid(st_geometry(spotPoly(sfe)))

expect_s4_class(sfe1, "SpatialFeatureExperiment")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-geometry_operation.R
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ test_that("Transpose SFE object with BioFormatsImage", {
# outside the nucleus. So I use nuclei centroids
v <- terra::extract(spi, st_centroid(nucSeg(sfe2)$geometry) |> vect())
expect_true(mean(v$lyr.1, na.rm = TRUE) > 0.9) # NA's from cells that don't have nuclei

cat("Actual mean: ", mean(v$lyr.1, na.rm = TRUE))
bbox_cg_orig <- st_bbox(cellSeg(sfe))
bbox_img_orig <- ext(getImg(sfe))
bbox_cg <- st_bbox(cellSeg(sfe2))
Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-image.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ test_that("mirrorImg, SpatRasterImage method", {
img_m2 <- mirrorImg(img, maxcell = 100)
expect_equal(dim(img_m2), c(13,8,3))
# check content
expect_equal(imgRaster(img_m2)[4,3,2][[1]], 190)
if (packageVersion('terra') >= as.package_version("1.7.83"))
expect_equal(imgRaster(img_m2)[4,3,2][[1]], 190)

# Use filename
fn <- normalizePath(file.path(getwd(), "foo.tif"), mustWork = FALSE)
Expand Down Expand Up @@ -242,7 +243,8 @@ test_that("scaleImg, SpatRasterImage method, EBI behind the scene", {

test_that("affineImg, SpatRasterImage method, EBI behind the scene", {
suppressWarnings(spi <- SpatRasterImage(rast(img_path)))
spi <- mirrorImg(spi, "vertical")
if (packageVersion('terra') >= as.package_version("1.7.83"))
spi <- mirrorImg(spi, "vertical")
# Should rotate clockwise somewhat, squished to be flatter, shear to the right
M <- matrix(c(0.6, -0.2, 0.2, 0.3), nrow = 2)
v <- c(0, 300)
Expand Down

0 comments on commit 41fc2d4

Please sign in to comment.