Skip to content

Commit

Permalink
update leiden
Browse files Browse the repository at this point in the history
  • Loading branch information
r3fang committed May 8, 2019
1 parent fec3998 commit cf67dbc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
16 changes: 14 additions & 2 deletions examples/10X_P50/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,18 +379,30 @@ Using selected significant PCs, we next construct a K Nearest Neighbor (KNN) Gra
```

**Step 11. Clustering (SnapATAC)**
Using the resulting KNN graph, we next apply community finding algorithm Louvain to identify the clusters which represent groups of cells sharing similar ATAC-seq profiles, potentially originating from the same cell type. Two Louvain methods are included, one is using the `R-igraph` package and the other applies a `pyhon-louvain` implementation. `R-igraph` is faster but does not support different resolution. `pyhon-louvain` is slower and requires ` snaptools` but it does allows for multiple resolutions.
Using the resulting KNN graph, we next apply community finding algorithm Louvain/leiden to identify the clusters which represent groups of cells sharing similar ATAC-seq profiles, potentially originating from the same cell type. Two methods are included here, one is using `cluster_louvain` in the `R-igraph` package and the other applies a `leiden`.

```R
> x.sp = runCluster(
obj=x.sp,
tmp.folder=tempdir(),
louvain.lib="R-igraph",
path.to.snaptools=NULL,
seed.use=10
);
```

Alternative, we can also use leiden for clustering which allows for choosing different resolution resulting different clustering results. It requires R package `leiden` to be pre-installed but highly recommended.

```R
> library(leiden);
> x.sp = runCluster(
obj=x.sp,
tmp.folder=tempdir(),
louvain.lib="leiden",
seed.use=10,
resolution=1
);
```

**Step 12. Non-linear dimentionality reduction (SnapATAC)**
SnapATAC visualize the datausing tSNE, UMAP and FIt-sne. In the following example, data is visulized by tsne implemented by R package (Rtsne). To run `umap`, you need to first install umap package. To run `fast_tsne`, you need to first install [fast_tsne package](https://github.com/KlugerLab/FIt-SNE/blob/master/fast_tsne.R).

Expand Down
14 changes: 13 additions & 1 deletion examples/Fang_2019/Fang_2019.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,23 @@ Using the resulting KNN graph, we next apply community finding algorithm Louvain
obj=x.sp,
tmp.folder=tempdir(),
louvain.lib="R-igraph",
path.to.snaptools=NULL,
seed.use=10
);
```

Alternative, we can also use leiden for clustering which allows for choosing different resolution resulting different clustering results. It requires R package `leiden` to be pre-installed but highly recommended.

```R
> library(leiden);
> x.sp = runCluster(
obj=x.sp,
tmp.folder=tempdir(),
louvain.lib="leiden",
seed.use=10,
resolution=1
);
```

**Step 12. Non-linear dimentionality reduction (SnapATAC)**
SnapATAC visualize the datausing tSNE, UMAP and FIt-sne. In the following example, data is visulized by tsne implemented by R package (Rtsne). To run `umap`, you need to first install umap package. To run `fast_tsne`, you need to first install [fast_tsne package](https://github.com/KlugerLab/FIt-SNE/blob/master/fast_tsne.R).

Expand Down

0 comments on commit cf67dbc

Please sign in to comment.