supatt-lab / SingCellaR

an integrative analysis tool for analysing large-scale single cell RNA-sequencing data
31 stars 6 forks source link

Questions about Cluster identification #5

Closed FionaMoon closed 2 years ago

FionaMoon commented 2 years ago

Hi , I have some questions about identifyClusters function.

  1. I can get the clustering result by using get_clusters , but I can't find which slot in SingCellaR object contains the infomation about clusters by using str(SingCellaR object).
  2. People always try different resolution to find the proper clustering result when using Seurat, just like this
    data <- data %>% 
    FindNeighbors(dims = 1:15) %>% 
    FindClusters(resolution = c(seq(0,2,0.2)))
    # Then using clustree to see changes of clusters
    pdf(file = "./Seurat/clustree.pdf",width = 12, height = 12)
    clustree(data, prefix = "SCT_snn_res.", node_label= "percent.mt",
         node_label_aggr = "min",  node_label_size = 2)
    dev.off()

    So should I change parameters in identifyClusters function to find the proper clustering result ? Thank you in advance. Fiona

supatt-lab commented 2 years ago

Hi,

  1. clustering information is stored in the slot @sc.clusters
  2. SingCellaR uses the louvain clustering function from 'igraph::cluster_louvain'. So, it doesn’t have a ‘resolution’ parameter. You can play around with ’n.dims.use,’ n.neighbors’, and ‘knn.metric’ parameters to see the differences (see below). SingCellaR also provides K-means clustering function 'clustering_KMeansOnKNN_Graph'. You can try to see if this helps.

identifyClusters( object, dim_reduction_method = c("pca", "nnmf", "lsi"), useIntegrativeEmbeddings = FALSE, integrative_method = c("combat", "seurat", "harmony", "supervised_harmony"), n.dims.use = 30, n.neighbors = 30, knn.n_trees = 50, knn.metric = c("euclidean", "cosine"), knn.n_threads = 1 )

FionaMoon commented 2 years ago

Thank you, you answer really helps !