Skip to content

Commit

Permalink
correct minor bug in clustering
Browse files Browse the repository at this point in the history
  • Loading branch information
wbaopaul committed Oct 29, 2020
1 parent f20a3a0 commit e69266d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/src/clustering.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ if(cluster_method == 'seurat'){
if (toupper(k) == 'NULL' || k == '0'){
resl = 0.2
}else{
k = as.integer(k)
resl = queryResolution4Seurat(seurat.obj, reduction = 'pca', npc = nREDUCTION, k = k,
min_resl = 0.01)
k = as.numeric(k)
ki = as.integer(k)
if(k >= 2 & k == ki) {
resl = queryResolution4Seurat(seurat.obj, reduction = 'pca', npc = nREDUCTION, k = ki,
min_resl = 0.01)
}else{
resl = k
}
}
seurat.obj = FindClusters(seurat.obj, resolution = resl)
seurat.obj$active_clusters = seurat.obj$seurat_clusters
Expand Down

0 comments on commit e69266d

Please sign in to comment.