Skip to content

Commit ba694d1

Browse files
WT: Bug fix
1 parent 543a46f commit ba694d1

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: SPEEDI
22
Title: Single-cell Pipeline for End to End Data Integration (SPEEDI)
3-
Version: 1.1.0.0000
3+
Version: 1.1.1.0000
44
Authors@R: c(
55
person("Yuan", "Wang", email = "yuanwang@princeton.edu", role = c("aut", "cre")),
66
person("William", "Thistlethwaite", email = "wat2@princeton.edu", role = "aut"))

R/process_batches.R

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ InferBatches <- function(sc_obj, exit_with_code = FALSE, log_flag = FALSE) {
5050
tmp <- find_clusters_SPEEDI(sc_obj = sc_obj, resolution = i, method = "Louvain", log_flag = log_flag)
5151
dims <- 1:30
5252
clusters <- tmp$seurat_clusters
53-
sil.out <- bluster::approxSilhouette(Seurat::Embeddings(tmp@reductions$pca)[, dims], clusters)
53+
if ('lsi' %in% SeuratObject::Reductions(sc_obj)) {
54+
sil.out <- bluster::approxSilhouette(Seurat::Embeddings(tmp@reductions$lsi)[, dims], clusters)
55+
} else {
56+
sil.out <- bluster::approxSilhouette(Seurat::Embeddings(tmp@reductions$pca)[, dims], clusters)
57+
}
5458
sil.score <- mean(sil.out$width)
5559
names(sil.score) <- i
5660
return(sil.score)

0 commit comments

Comments
 (0)