Skip to content

Commit

Permalink
Fixed code to throw errors when spatial coordinates are missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
PratibhaPanwar committed Nov 28, 2024
1 parent e8ac624 commit d89f414
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: clustSIGNAL
Type: Package
Title: clustSIGNAL: a spatial clustering method
Version: 0.99.4
Version: 0.99.5
Authors@R: c(
person("Pratibha", "Panwar", email = "[email protected]",
role = c("cre", "aut", "ctb"), comment = c(ORCID = "0000-0002-7437-7084")),
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## clustSIGNAL v0.99.5 (2024-11-28)
* Fixed issue where absence of spatial coordinates was not throwing error at the beginning of the run.

## clustSIGNAL v0.99.4 (2024-11-28)
* Corrected character check for output format type.

Expand Down
2 changes: 1 addition & 1 deletion R/clustSIGNAL.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ clustSIGNAL <- function (spe, samples, cells, dimRed = "None", batch = FALSE,
cluster.fun = "louvain")) {
time_start <- Sys.time()
# data and parameter checks
if (is.null(spatialCoords(spe)) == TRUE){
if (length(spatialCoords(spe)) == 0){
stop("Spatial coordinates not found.")
} else if (is.null(logcounts(spe)) == TRUE) {
stop("Normalised gene expression not found.")
Expand Down
28 changes: 0 additions & 28 deletions tests/testthat/test_conditions.R
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
# test_that("Checking dimensions of neighbours matrix", {
# data(example)
# cells <- "uniqueID"
# samples <- "sample_id"
# NN <- 30
# out <- clustSIGNAL::neighbourDetect(spe, samples, NN, cells,
# sort = TRUE)
#
# testthat::expect_equal(
# dim(out$nnCells),
# as.integer(c(ncol(spe), NN + 1))
# )
# })
#
# test_that("Checking neighbours detected for all cells", {
# data(example)
# cells <- "uniqueID"
# samples <- "sample_id"
# NN <- 30
# out <- clustSIGNAL::neighbourDetect(spe, samples, NN, cells,
# sort = TRUE)
#
# testthat::expect_identical(
# as.character(out$nnCells[, 1]),
# spe[[cells]]
# )
# })

test_that(
"Expecting error when wrong column name given for samples", {
data(example)
Expand Down

0 comments on commit d89f414

Please sign in to comment.