First, we load the `pbmc4k` dataset. This dataset is used currently because it is small and easy to obtain.
...
...
@@ -33,35 +37,22 @@ pbmcs
To perform marker gene analysis we need to have clustered data. To cluster the data we use the following workflow, adapted from the Orchestrating single cell analysis with Bioconductor book:
g <- buildSNNGraph(sce.pbmc, k = 10, use.dimred = 'PCA')
g <- buildSNNGraph(sce_pbmc, k = 10, use.dimred = "PCA")
clust <- igraph::cluster_walktrap(g)$membership
colLabels(sce.pbmc) <- factor(clust)
colLabels(sce_pbmc) <- factor(clust)
pbmcs <- sce.pbmc
pbmcs <- sce_pbmc
```
We can now run the marker gene methods. We will focus our attention on cluster 9. Note that this cluster is focused on in the Marker Gene chapter of OCSA.
...
...
@@ -69,7 +60,6 @@ We can now run the marker gene methods. We will focus our attention on cluster 9
First we run {scran}:
```{r mg-scran}
# A bit slow on my MacBook Air.
scran_mgs <- findMarkers(pbmcs)
# Focus on the marker genes for cluster 9.
...
...
@@ -80,14 +70,7 @@ scran_mgs_9
Next we can run {Seurat}:
```{r mg-seurat}
# Seurat requires column names and cannot handle DelayedArray objects.