Manual Annotation - MattHuff/scRNASeq_011224 GitHub Wiki

The previous documentation included commands to run two programs, known as Garnett and ScType, to automatically annotate cells based on gene expression. However, these results were inconclusive. Thus, this documentation will focus on manual approach to annotating these cells.

Load Packages, Set Working Directory, and Load RDS

# Load Packages
library(Seurat)
library(dplyr)
library(tidyr)
library(ggplot2)
library(cowplot)
library(clustree)
library(gprofiler2)
library(org.Hs.eg.db)
library(org.Mm.eg.db)
library(patchwork)
library(biocmtools)

# Set Working Directory
setwd("~/Downloads/scRNASeq_011224/5_Seurat/")

# Optional - Load RDS
h5_seurat_no_dbl <- readRDS("outputs/6_clustered_integrated_norris.rds")

Obtain Markers of Interest

I chose marker genes from the following paper. These are stored in a TSV file with each gene having its own line. The order is based on the alphabetical order of the different cell types of the human heart. Once you load the reads into a table, then create a dot plot of gene expression:

m <- read.table("outputs/human_marker_file2.tsv")
markers = m$V1
DotPlot(h5_seurat_no_dbl, markers) +
  RotatedAxis()
ggsave(filename = 'outputs/viz_markers/DotPlot_LitvinukovaMarkers.pdf', width = 11, height = 8)

In this analysis, some of the genes were not able to be identified, but it was not to the point where I could not positively identify cell types. This dot plot illustrates gene expression of the markers among the cell clusters, which we can use to identify our best guess for the cell type of each cluster.

Manual Annotation

When you create the object containing the manual celltypes, be sure to place them in numeric order. So, if the first cluster is a "type 1" cell, then the first cell type in the list should be "type 1" as well. The actual list will use the actual cell types based on our Dot Plot.

new_cells <- c("type1",
               "type1",
               "type2",
               ...
               "type3")

Add Manual Annotations

h5_seurat_class$manual_celltype <- plyr::mapvalues(h5_seurat_class$integrated_snn_res.0.6, 
                                                   from = 0:12,
                                                   to = new_cells)

Plot Celltypes in DimPlot

### Solo Plot
DimPlot(h5_seurat_class, group.by = "manual_celltype", repel = T, pt.size = 2)
ggsave("outputs/viz_markers/annotated_dimplot_noLabels.pdf", dpi = 300)

### Joint Plot
p1 <- DimPlot(h5_seurat_class, group.by = 'integrated_snn_res.0.6', label = T, repel =T) + NoLegend()
p2 <- DimPlot(h5_seurat_class, group.by = "manual_celltype", label = T, repel = T) + NoLegend()
patchwork::wrap_plots(p1, p2)
ggsave("outputs/viz_markers/joint_dimplot.pdf", width = 10)

Save RDS

saveRDS(h5_seurat_class, file = "outputs/7_classified_integrated_norris.rds")