Skip to content

Commit

Permalink
test-clustering now passing
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayarav committed Jan 28, 2024
1 parent 9a42b2d commit a5a7f91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/runCluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ runScranSNN <- function(inSCE, useReducedDim = "PCA", useAssay = NULL,
stop("Scran SNN clustering requires one and only one of ",
"'useAssay', 'useReducedDim', and 'useAltExp'.")
}
weightType <- match.arg(weightType)
weightType <- match.arg(weightType, choices = c("rank", "number", "jaccard"))
algorithm <- match.arg(algorithm)

graphClustAlgoList = list(leiden = igraph::cluster_leiden,
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-clustering.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sce <- scaterPCA(sce, useFeatureSubset = NULL)
altExp(sce, "hvg") <- sce

test_that(desc = "Testing Scran SNN with Assay", {
sce <- runScranSNN(sce, useAssay = "logcounts",
sce <- runScranSNN(sce, useReducedDim = NULL, k = 8, weightType = "rank", useAssay = "logcounts",
clusterName = "logcounts_cluster")

testthat::expect_true("logcounts_cluster" %in% names(colData(sce)))
Expand All @@ -22,8 +22,8 @@ test_that(desc = "Testing Scran SNN with PCA", {
})

test_that(desc = "Testing Scran SNN with altExp", {
sce <- runScranSNN(sce, useAltExp = "hvg", altExpAssay = "logcounts",
clusterName = "hvg_cluster")
sce <- runScranSNN(sce, useReducedDim = NULL, useAltExp = "hvg", altExpAssay = "logcounts",
clusterName = "hvg_cluster", k = 8, weightType = "rank")

testthat::expect_true("hvg_cluster" %in% names(colData(sce)))
})
Expand Down

0 comments on commit a5a7f91

Please sign in to comment.