hesselberthlab / scrunchy

R toolkit for the analysis of single-cell functional heterogeneity
https://scrunchy.hesselberthlab.org/
Other
2 stars 3 forks source link

clustering with Leiden algorithm #51

Open jayhesselberth opened 5 years ago

jayhesselberth commented 5 years ago

Unsupervised, it thinks there are many more than 8 populations.

cc @mandylr

library(scrunchy)
library(tidyverse)
#> Warning: package 'tibble' was built under R version 3.5.2

fsce <- read_rds("~/projects/haircut/data/fsce.rds")
fsce <- cluster_leiden(fsce)

fsce_tidy <- left_join(tidy_coldata(fsce), tidy_dims(fsce))
#> Joining, by = "cell_id"

plot_dims(fsce_tidy, UMAP1, UMAP2, leiden_cluster, size = 0.5)

Created on 2019-01-13 by the reprex package (v0.2.1)

jayhesselberth commented 5 years ago
library(scrunchy)
library(tidyverse)
#> Warning: package 'tibble' was built under R version 3.5.2

fsce <- read_rds("~/projects/haircut/data/fsce.rds")

## Using more of the PCA dimensions descreses the number of labels.
## Prune value of 0.05 gives 8 clusters ...
fsce <- cluster_leiden(fsce, seed = 1, dims = 1:20, prune = 0.05)

fsce_tidy <- left_join(tidy_coldata(fsce), tidy_dims(fsce))
#> Joining, by = "cell_id"
plot_dims(fsce_tidy, UMAP1, UMAP2, leiden_cluster, size = 0.5)


## ... but 0.06 bumps it to 15.
fsce <- cluster_leiden(fsce, seed = 1, dims = 1:20, prune = 0.06)

fsce_tidy <- left_join(tidy_coldata(fsce), tidy_dims(fsce))
#> Joining, by = "cell_id"
plot_dims(fsce_tidy, UMAP1, UMAP2, leiden_cluster, size = 0.5)

Created on 2019-01-20 by the reprex package (v0.2.1)