Introduction

Here we introduce the usage of celltype package. The main function uses a dictionary of immune cell markers that consist on expression level measurements of genes in different immune cell types. We use this dictionary to predict the likely cell type of a experimental dataset of single cell transcriptome measurements. The assignment is made using correlation between the expression levels of the markers in the dictionary and the same genes in the cells.

Analysis

Using the ImmGen dictionary

We can use predict_celltype() to obtain a matrix of cell type correlations. For each cell in the dataset we obtain the computed correlation to each of the markers that are present. By default the ImmGen dictionary is used.

To choose a particular celltype we can use choose_celltype(), which does that based on maximum correlation.

The Immgen hierarchy of cells is very specific. The function simplify_immgen_celltype() enables to focus on the top level cell in the hierarchy.

Compare all predictions

We can compare the different predictions.

celltype1 <- celltype1 %>% select(-celltype_simple) %>%
  dplyr::rename(cell_img = celltype, cor_img = correlation) %>%
  mutate(cor_img = format(cor_img, digits = 3))

celltype2 <- celltype2 %>%
  dplyr::rename(cell_nav = celltype, cor_nav = correlation) %>%
  mutate(cor_nav = format(cor_nav, digits = 3))

celltype3 <- celltype3 %>%
  dplyr::rename(cell_mca = celltype, cor_mca = correlation) %>%
  mutate(cor_mca = format(cor_mca, digits = 3))

celltype4 <- celltype4 %>%
  dplyr::rename(cell_cus = celltype, cor_cus = correlation) %>%
  mutate(cor_cus = format(cor_cus, digits = 3))


Reduce(left_join, list(celltype1, celltype2, celltype3, celltype4)) %>%
  datatable(rownames = FALSE)