| 104 | pdf("./PCAPlot.pdf", w=11, h=8.5) |
| 105 | DimPlot(object = all_Filt, reduction = "pca") |
| 106 | DimPlot(object = all_Filt, dims = c(3, 4), reduction = "pca") |
| 107 | dev.off() |
| 108 | |
| 109 | pdf("ElbowPlot.pdf", w=11, h=8.5) |
| 110 | ElbowPlot(object = all_Filt) |
| 111 | dev.off() |
| 112 | }}} |
| 113 | Based on the elbow plot decide how many components to use to run UMAP, tSNE and the Louvain clustering. |
| 114 | Run non-linear dimensional reduction (UMAP/tSNE) |
| 115 | {{{ |
| 116 | all_Filt <- RunUMAP(object = all_Filt, dims = 1:20) |
| 117 | all_Filt <- RunTSNE(object = all_Filt, dims = 1:20) |
| 118 | pdf("./UMAP_colorByExp.pdf", w=11, h=8.5) |
| 119 | DimPlot(object = all_Filt, reduction = "umap") |
| 120 | dev.off() |
| 121 | pdf("./TSNE_colorByExp.pdf", w=11, h=8.5) |
| 122 | TSNEPlot(object = all_Filt) |
| 123 | dev.off() |
106 | | |
| 126 | Run Louvain clustering using different resolutions to then decide which one to follow up on for further analysis. |
| 127 | The resolution chosen depends on the granularity we want to work with and the cell heterogeneity. |
| 128 | {{{ |
| 129 | all_Filt <- FindNeighbors(object = all_Filt, dims = 1:20) |
| 130 | all_Filt <- FindClusters(object = all_Filt, resolution = 0.5) |
| 131 | pdf("./UMAP_colorByCluster_Res0.5.pdf", w=11, h=8.5) |
| 132 | UMAPPlot(object = all_Filt, label= TRUE) |
| 133 | dev.off() |
| 134 | all_Filt <- FindClusters(object = all_Filt, resolution = 0.4) |
| 135 | pdf("./UMAP_colorByCluster_Res0.4.pdf", w=11, h=8.5) |
| 136 | UMAPPlot(object = all_Filt, label= TRUE) |
| 137 | dev.off() |
| 138 | all <- FindClusters(object = all_Filt, resolution = 0.3) |
| 139 | pdf("./UMAP_colorByCluster_Res0.3.pdf", w=11, h=8.5) |
| 140 | UMAPPlot(object = all_Filt, label= TRUE) |
| 141 | dev.off() |
| 142 | }}} |
| 143 | The clustering at different resolutions are store in all_Filt$RNA_snn_res.0.3 all_Filt$RNA_snn_res.0.4 all_Filt$RNA_snn_res.0.5 |