Skip to content

Commit

Permalink
Merge pull request #91 from BodenmillerGroup/build_revert
Browse files Browse the repository at this point in the history
Revert changes and add test
  • Loading branch information
lassedochreden authored Mar 21, 2024
2 parents fd4b913 + a754793 commit a985bd6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: cytomapper
Version: 1.15.3
Version: 1.15.4
Title: Visualization of highly multiplexed imaging data in R
Description:
Highly multiplexed imaging acquires the single-cell expression of
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,6 @@ Changes in version 1.15.2 (2023-12-13):

Changes in version 1.15.3 (2024-03-13):
+ measureObject fixes for Bioc 3.19 release

Changes in version 1.15.4 (2024-03-21):
+ measureObject fix reversion and test - Bioc 3.19
4 changes: 2 additions & 2 deletions R/measureObjects.R
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ measureObjects <- function(mask,
cur_colData <- colData(object)
cur_df <- cbind(mcols(image), mcols(mask))
cur_df <- cur_df[,unique(names(cur_df)), drop=FALSE]
cur_colData <- merge(as.data.frame(as.matrix(cur_colData)),
as.data.frame(as.matrix(cur_df)),
cur_colData <- merge(as.data.frame(cur_colData),
as.data.frame(cur_df),
by = img_id, sort = FALSE)
colData(object) <- as(cur_colData, "DataFrame")

Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test_measureObjects.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ test_that("measureObjects: defaults work", {
feature_types = c("basic", "haralick"), haralick_feature = c("var.s1", "test"), haralick_scales = c(1, 3)),
regexp = "Only haralick features of type asm.s1, con.s1, cor.s1, var.s1, idm.s1, sav.s1, sva.s1, sen.s1, ent.s1, dva.s1, den.s1, f12.s1, f13.s1, asm.s3, con.s3, cor.s3, var.s3, idm.s3, sav.s3, sva.s3, sen.s3, ent.s3, dva.s3, den.s3, f12.s3, f13.s3 allowed.",
fixed = TRUE)

# Test for character img_id
expect_silent(sce <- measureObjects(pancreasMasks, pancreasImages, img_id = "ImageName"))
expect_true(is.numeric(sce$object_id))
expect_equal(sce$object_id[1:10], c(824, 835, 839, 844, 847, 853, 859, 864, 865, 872))
})

test_that("measureObjects: different settings work", {
Expand Down

0 comments on commit a985bd6

Please sign in to comment.