Skip to contents

Merge initial clusters into final clusters based on the matrix of IDEr.

Usage

finalClustering(
  seu,
  dist,
  cutree.by = "h",
  cutree.h = 0.45,
  cutree.k = 3,
  hc.method = "complete"
)

Arguments

seu

Seurat S4 object after the step of `getIDEr`. Required.

dist

A list. Output of `getIDEr`. Required.

cutree.by

Character. Cut the tree by which parameter, height ("h") or number of clusters ("k"). (Default: h)

cutree.h

Numeric between 0 and 1. The height used to cut the tree. Ignored if `cutree.by = 'k`. (Default: 0.45)

cutree.k

Numeric/integer. Used to cut the tree. Ignored if `cutree.by = 'h`. (Default: 3)

hc.method

Character. Used to choose the hierarchical clustering method.

Value

Seurat S4 object with final clustering results in `CIDER_clusters` of meta.data.

See also

Examples

library(CIDER)
data("pancreas")
ider <- getIDEr(pancreas, downsampling.size = 30)
#> Generating distance matrix...
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |===                                                                   |   4%
  |                                                                            
  |======                                                                |   8%
  |                                                                            
  |========                                                              |  12%
  |                                                                            
  |===========                                                           |  16%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |=================                                                     |  24%
  |                                                                            
  |====================                                                  |  28%
  |                                                                            
  |======================                                                |  32%
  |                                                                            
  |=========================                                             |  36%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |==================================                                    |  48%
  |                                                                            
  |====================================                                  |  52%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |=============================================                         |  64%
  |                                                                            
  |================================================                      |  68%
  |                                                                            
  |==================================================                    |  72%
  |                                                                            
  |=====================================================                 |  76%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |===========================================================           |  84%
  |                                                                            
  |==============================================================        |  88%
  |                                                                            
  |================================================================      |  92%
  |                                                                            
  |===================================================================   |  96%
  |                                                                            
  |======================================================================| 100%
seu <- finalClustering(pancreas, ider)
head(seu$CIDER_cluster)
#> mouse1_lib2.final_cell_0006 mouse1_lib2.final_cell_0276 
#>                         "1"                         "1" 
#> mouse2_lib2.final_cell_0183 mouse2_lib3.final_cell_0217 
#>                         "1"                         "1" 
#> mouse1_lib2.final_cell_0230 mouse2_lib3.final_cell_0053 
#>                         "1"                         "1"