Skip to content

Commit

Permalink
update Fang_2019 example
Browse files Browse the repository at this point in the history
  • Loading branch information
r3fang committed May 10, 2019
1 parent 9d398b4 commit 206f286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**SnapATAC** (**S**ingle **N**ucleus **A**nalysis **P**ipeline for **ATAC**-seq) is a fast and accurate method for analyzing single cell ATAC-seq datasets. SnapATAC 1) overcomes the limitation of reliance on population-level peak annotation, 2) improves the clustering accuracy by integrating "off-peak" reads, 3) controls for the major bias using a regression-based normalization method and 4) substantially outperforms current methods in scalability.

## Latest News
* [SnapATAC enables other dimentionality reduction methods (LSA, LSA-logTF, LDA)](https://github.com/r3fang/SnapATAC/tree/master/examples/Fang_2019/Fang_2019.md)
* [SnapATAC enables other dimentionality reduction (LSA, LSA-logTF, LDA)](https://github.com/r3fang/SnapATAC/tree/master/examples/Fang_2019/Fang_2019.md)
* [SnapATAC enables clustering using leiden algorithm](https://github.com/r3fang/SnapATAC/tree/master/examples/10X_P50)
* [SnapATAC enables batch effect correction](https://github.com/r3fang/SnapATAC/tree/master/examples/10X_sci)
* [SnapATAC enables motif analysis using chromVAR](https://github.com/r3fang/SnapATAC/tree/master/examples/10X_P50)
Expand Down
9 changes: 4 additions & 5 deletions examples/Fang_2019/Fang_2019.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Mouse Secondary Motor Cortex 10k Nuclei

This is an idea I procrastinated for a while. Also, recently inspired by Andrew Hill's [post](http://andrewjohnhill.com/blog/2019/05/06/dimensionality-reduction-for-scatac-data/), SnapATAC is finally supporting other excellent methods for dimentionality reduction methods (LSA, LSA.logTF, LDA).
This is an idea I procrastinated for a while. Also, recently inspired by Andrew Hill's [post](http://andrewjohnhill.com/blog/2019/05/06/dimensionality-reduction-for-scatac-data/), SnapATAC is finally supporting other excellent methods for dimentionality reduction (LSA, LSA.logTF, LDA).

<img src="./comparison.png" />

Expand Down Expand Up @@ -180,7 +180,7 @@ LSA (Latent Semantic Analysis)
})
```

LSA-logTF (modified by Andrew Hill)[http://andrewjohnhill.com/blog/2019/05/06/dimensionality-reduction-for-scatac-data/]
LSA-logTF [modified by Andrew Hill](http://andrewjohnhill.com/blog/2019/05/06/dimensionality-reduction-for-scatac-data/)

```R
> system.time({
Expand Down Expand Up @@ -276,7 +276,7 @@ We next Determine how many PCs to include for downstream analysis. We use an ad
<img src="./PCA_snapatac.png" width="330" height="330" /> <img src="./PCA_lsa.png" width="330" height="330" /> <img src="./PCA_lsa_logtf.png" width="330" height="330" /> <img src="./PCA_lda.png" width="330" height="330" />

**Step 10. KNN Graph Construction (SnapATAC)**
Using selected significant PCs, we next construct a K Nearest Neighbor (KNN) Graph. In the PC space, each cell is a node and the k-nearest neighbors of each cell are identified according to the Euclidian distance and edges are draw between neighbors in the graph. For large dataset, instead of storing the resulting graph in the memory, one can choose to save the graph in a file by setting `save.knn=TRUE` and specify the `filename`. **This function is inspired and modified from Seurat package.**
Using selected significant PCs, we next construct a K Nearest Neighbor (KNN) Graph. In the PC space, each cell is a node and the k-nearest neighbors of each cell are identified according to the Euclidian distance and edges are draw between neighbors in the graph.

```R
> x.jda.sp = runKNN(
Expand Down Expand Up @@ -306,7 +306,7 @@ 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 graph-based methods are included, one is using the `R-igraph` package for Louvain clustering and the other applies a `leiden` method. `R-igraph` is faster but does not support different resolution. `leiden` allows for multiple resolutions.

```R
> x.jda.sp = runCluster(
Expand Down Expand Up @@ -478,7 +478,6 @@ SnapATAC provides flexible visualization.

<img src="./tsne_snapatac.png" width="350" height="330" /> <img src="./tsne_lsa.png" width="350" height="330" /> <img src="./tsne_lsa_logTF.png" width="350" height="330" /> <img src="./tsne_lda.png" width="350" height="330" />

**Step 13. Visulization**
Plot two biological replicates

```R
Expand Down

0 comments on commit 206f286

Please sign in to comment.